aboutsummaryrefslogtreecommitdiff
path: root/app/class/Modelfont.php
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2020-04-17 19:01:05 +0200
committervincent-peugnet <v.peugnet@free.fr>2020-04-17 19:01:05 +0200
commit802f5135b0979bab3bf30ae1733f9867e2caed7a (patch)
tree3575cb7dd353e7f1ce74b079aa1559b5d69054bf /app/class/Modelfont.php
parent74e2b3fdd66bfbe99bae771fa3a0b6c427fc0f86 (diff)
downloadwcms-802f5135b0979bab3bf30ae1733f9867e2caed7a.tar.gz
wcms-802f5135b0979bab3bf30ae1733f9867e2caed7a.zip
apply psr12
Diffstat (limited to 'app/class/Modelfont.php')
-rw-r--r--app/class/Modelfont.php39
1 files changed, 13 insertions, 26 deletions
diff --git a/app/class/Modelfont.php b/app/class/Modelfont.php
index 3f25e21..4353b1c 100644
--- a/app/class/Modelfont.php
+++ b/app/class/Modelfont.php
@@ -5,16 +5,16 @@ namespace Wcms;
class Modelfont extends Model
{
- const FONT_TYPES = ['woff2', 'woff', 'otf', 'ttf', 'eot', 'svg'];
+ protected const FONT_TYPES = ['woff2', 'woff', 'otf', 'ttf', 'eot', 'svg'];
- public function fontdircheck()
- {
- if(!is_dir(Model::FONT_DIR)) {
- return mkdir(Model::FONT_DIR);
- } else {
- return true;
- }
- }
+ public function fontdircheck()
+ {
+ if (!is_dir(Model::FONT_DIR)) {
+ return mkdir(Model::FONT_DIR);
+ } else {
+ return true;
+ }
+ }
public function getfontlist()
{
@@ -44,15 +44,12 @@ class Modelfont extends Model
$list = [];
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != "..") {
-
$list[] = $entry;
-
}
}
}
return $list;
-
}
public function fontlist(array $list)
@@ -82,7 +79,6 @@ class Modelfont extends Model
{
$write = file_put_contents(Model::GLOBAL_DIR . 'fonts.css', $fontface);
if ($write !== false) {
-
}
}
@@ -101,9 +97,11 @@ class Modelfont extends Model
$id = $infosfichier['filename'];
}
if (!file_exists($this::FONT_DIR . $id . '.' . $extension_upload)) {
-
$extension_upload = strtolower($extension_upload);
- $uploadok = move_uploaded_file($file['font']['tmp_name'], $this::FONT_DIR . $id . '.' . $extension_upload);
+ $uploadok = move_uploaded_file(
+ $file['font']['tmp_name'],
+ $this::FONT_DIR . $id . '.' . $extension_upload
+ );
if ($uploadok) {
$message = true;
} else {
@@ -111,22 +109,11 @@ class Modelfont extends Model
}
} else {
$message = 'filealreadyexist';
-
}
}
} else {
$message = 'filetoobig';
-
}
return $message;
}
-
-
-
-
}
-
-
-
-
-?> \ No newline at end of file