@@ -56,7 +56,7 @@ |
||
56 | 56 | ]); |
57 | 57 | |
58 | 58 | $configs->newcontent = serialize([ |
59 | - 'categories' => ['2','3'], |
|
59 | + 'categories' => ['2', '3'], |
|
60 | 60 | 'count' => '5', |
61 | 61 | 'cache' => '60' |
62 | 62 | ]); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | public function before() |
44 | 44 | { |
45 | 45 | foreach ($this->_apps as $app) { |
46 | - $this->_definedControllers[] = (string)$app->sys_name; |
|
46 | + $this->_definedControllers[] = (string) $app->sys_name; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | parent::before(); |
@@ -79,14 +79,14 @@ discard block |
||
79 | 79 | public function make() |
80 | 80 | { |
81 | 81 | $cName = ucfirst(Str::lowerCase($this->sysname)); |
82 | - $cPath = 'Apps\Controller\Admin\\' . $cName; |
|
82 | + $cPath = 'Apps\Controller\Admin\\'.$cName; |
|
83 | 83 | // if object class is not loaded - prevent install |
84 | - if (!class_exists($cPath) || !defined($cPath . '::VERSION')) { |
|
84 | + if (!class_exists($cPath) || !defined($cPath.'::VERSION')) { |
|
85 | 85 | return false; |
86 | 86 | } |
87 | 87 | |
88 | 88 | // get ext version |
89 | - $cVersion = constant($cPath . '::VERSION'); |
|
89 | + $cVersion = constant($cPath.'::VERSION'); |
|
90 | 90 | if ($cVersion === null || Str::likeEmpty($cVersion)) { |
91 | 91 | $cVersion = '1.0.0'; |
92 | 92 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | // callback to install method in extension |
104 | 104 | if (method_exists($cPath, 'install')) { |
105 | - call_user_func($cPath . '::install'); |
|
105 | + call_user_func($cPath.'::install'); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | return true; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public static function all($columns = ['*']) |
39 | 39 | { |
40 | - $cacheName = 'activercord.app.all.' . implode('.', $columns); |
|
40 | + $cacheName = 'activercord.app.all.'.implode('.', $columns); |
|
41 | 41 | $records = MemoryObject::instance()->get($cacheName); |
42 | 42 | if ($records === null) { |
43 | 43 | $records = parent::all($columns); |
@@ -175,16 +175,16 @@ discard block |
||
175 | 175 | */ |
176 | 176 | public function getScriptVersion() |
177 | 177 | { |
178 | - $class = 'Apps\Controller\Admin\\' . $this->sys_name; |
|
178 | + $class = 'Apps\Controller\Admin\\'.$this->sys_name; |
|
179 | 179 | if (!class_exists($class)) { |
180 | 180 | return false; |
181 | 181 | } |
182 | 182 | |
183 | - if (!defined($class . '::VERSION')) { |
|
183 | + if (!defined($class.'::VERSION')) { |
|
184 | 184 | return false; |
185 | 185 | } |
186 | 186 | |
187 | - return constant($class . '::VERSION'); |
|
187 | + return constant($class.'::VERSION'); |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | } |
191 | 191 | \ No newline at end of file |
@@ -33,12 +33,12 @@ discard block |
||
33 | 33 | parent::before(); |
34 | 34 | $configs = AppRecord::getConfigs('app', 'Content'); |
35 | 35 | // prevent null-type config data |
36 | - if ((int)$configs['gallerySize'] > 0) { |
|
37 | - $this->maxSize = (int)$configs['gallerySize'] * 1024; |
|
36 | + if ((int) $configs['gallerySize'] > 0) { |
|
37 | + $this->maxSize = (int) $configs['gallerySize'] * 1024; |
|
38 | 38 | } |
39 | 39 | |
40 | - if ((int)$configs['galleryResize'] > 0) { |
|
41 | - $this->maxResize = (int)$configs['galleryResize']; |
|
40 | + if ((int) $configs['galleryResize'] > 0) { |
|
41 | + $this->maxResize = (int) $configs['galleryResize']; |
|
42 | 42 | } |
43 | 43 | } |
44 | 44 | |
@@ -117,8 +117,8 @@ discard block |
||
117 | 117 | } |
118 | 118 | |
119 | 119 | // check if directory exist |
120 | - if (!Directory::exist('/upload/gallery/' . $id)) { |
|
121 | - Directory::create('/upload/gallery/' . $id); |
|
120 | + if (!Directory::exist('/upload/gallery/'.$id)) { |
|
121 | + Directory::create('/upload/gallery/'.$id); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | // get file object |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | |
131 | 131 | // check file size |
132 | 132 | if ($file->getSize() < 1 || $file->getSize() > $this->maxSize) { |
133 | - throw new ForbiddenException(__('File size is too big. Max size: %size%kb', ['size' => (int)($this->maxSize/1024)])); |
|
133 | + throw new ForbiddenException(__('File size is too big. Max size: %size%kb', ['size' => (int) ($this->maxSize / 1024)])); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | // check file extension |
@@ -139,41 +139,41 @@ discard block |
||
139 | 139 | } |
140 | 140 | |
141 | 141 | // create origin directory |
142 | - $originPath = '/upload/gallery/' . $id . '/orig/'; |
|
142 | + $originPath = '/upload/gallery/'.$id.'/orig/'; |
|
143 | 143 | if (!Directory::exist($originPath)) { |
144 | 144 | Directory::create($originPath); |
145 | 145 | } |
146 | 146 | |
147 | 147 | // lets make a new file name |
148 | - $fileName = App::$Security->simpleHash($file->getClientOriginalName() . $file->getSize()); |
|
149 | - $fileNewName = $fileName . '.' . $file->guessExtension(); |
|
148 | + $fileName = App::$Security->simpleHash($file->getClientOriginalName().$file->getSize()); |
|
149 | + $fileNewName = $fileName.'.'.$file->guessExtension(); |
|
150 | 150 | // check if image is already loaded |
151 | - if (File::exist($originPath . $fileNewName)) { |
|
151 | + if (File::exist($originPath.$fileNewName)) { |
|
152 | 152 | throw new ForbiddenException(__('File is always exists!')); |
153 | 153 | } |
154 | 154 | // save file from tmp to gallery origin directory |
155 | 155 | $file->move(Normalize::diskFullPath($originPath), $fileNewName); |
156 | 156 | |
157 | 157 | // lets resize preview image for it |
158 | - $thumbPath = '/upload/gallery/' . $id . '/thumb/'; |
|
158 | + $thumbPath = '/upload/gallery/'.$id.'/thumb/'; |
|
159 | 159 | if (!Directory::exist($thumbPath)) { |
160 | 160 | Directory::create($thumbPath); |
161 | 161 | } |
162 | 162 | |
163 | 163 | $thumb = new Image(); |
164 | - $thumb->setCacheDir(root . '/Private/Cache/images'); |
|
164 | + $thumb->setCacheDir(root.'/Private/Cache/images'); |
|
165 | 165 | |
166 | 166 | // open original file, resize it and save |
167 | - $thumbSaveName = Normalize::diskFullPath($thumbPath) . '/' . $fileName . '.jpg'; |
|
168 | - $thumb->open(Normalize::diskFullPath($originPath) . DIRECTORY_SEPARATOR . $fileNewName) |
|
167 | + $thumbSaveName = Normalize::diskFullPath($thumbPath).'/'.$fileName.'.jpg'; |
|
168 | + $thumb->open(Normalize::diskFullPath($originPath).DIRECTORY_SEPARATOR.$fileNewName) |
|
169 | 169 | ->cropResize($this->maxResize) |
170 | 170 | ->save($thumbSaveName, 'jpg', 90); |
171 | 171 | $thumb = null; |
172 | 172 | |
173 | 173 | $this->setJsonHeader(); |
174 | 174 | return json_encode(['status' => 1, 'file' => [ |
175 | - 'thumbnailUrl' => '/upload/gallery/' . $id . '/thumb/' . $fileName . '.jpg', |
|
176 | - 'url' => '/upload/gallery/' . $id . '/orig/' . $fileNewName, |
|
175 | + 'thumbnailUrl' => '/upload/gallery/'.$id.'/thumb/'.$fileName.'.jpg', |
|
176 | + 'url' => '/upload/gallery/'.$id.'/orig/'.$fileNewName, |
|
177 | 177 | 'name' => $fileNewName |
178 | 178 | ]]); |
179 | 179 | } |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | throw new NativeException('Permission denied'); |
198 | 198 | } |
199 | 199 | |
200 | - $thumbDir = Normalize::diskFullPath('/upload/gallery/' . $id . '/orig/'); |
|
200 | + $thumbDir = Normalize::diskFullPath('/upload/gallery/'.$id.'/orig/'); |
|
201 | 201 | if (!Directory::exist($thumbDir)) { |
202 | 202 | throw new NotFoundException('Nothing found'); |
203 | 203 | } |
@@ -212,10 +212,10 @@ discard block |
||
212 | 212 | $fileExt = Str::lastIn($file, '.'); |
213 | 213 | $fileName = Str::sub($file, 0, -Str::length($fileExt)); |
214 | 214 | $output[] = [ |
215 | - 'thumbnailUrl' => '/upload/gallery/' . $id . '/thumb/' . $fileName . '.jpg', |
|
216 | - 'url' => '/upload/gallery/' . $id . '/orig/' . $file, |
|
215 | + 'thumbnailUrl' => '/upload/gallery/'.$id.'/thumb/'.$fileName.'.jpg', |
|
216 | + 'url' => '/upload/gallery/'.$id.'/orig/'.$file, |
|
217 | 217 | 'name' => $file, |
218 | - 'size' => File::size('/upload/gallery/' . $id . '/orig/' . $file) |
|
218 | + 'size' => File::size('/upload/gallery/'.$id.'/orig/'.$file) |
|
219 | 219 | ]; |
220 | 220 | } |
221 | 221 | |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | public function actionGallerydelete($id, $file = null) |
235 | 235 | { |
236 | 236 | if ($file === null || Str::likeEmpty($file)) { |
237 | - $file = (string)$this->request->query->get('file', null); |
|
237 | + $file = (string) $this->request->query->get('file', null); |
|
238 | 238 | } |
239 | 239 | // check passed data |
240 | 240 | if (Str::likeEmpty($file) || !Obj::isLikeInt($id)) { |
@@ -249,8 +249,8 @@ discard block |
||
249 | 249 | } |
250 | 250 | |
251 | 251 | // generate path |
252 | - $thumb = '/upload/gallery/' . $id . '/thumb/' . $fileName . '.jpg'; |
|
253 | - $full = '/upload/gallery/' . $id . '/orig/' . $file; |
|
252 | + $thumb = '/upload/gallery/'.$id.'/thumb/'.$fileName.'.jpg'; |
|
253 | + $full = '/upload/gallery/'.$id.'/orig/'.$file; |
|
254 | 254 | |
255 | 255 | // check if file exists and remove |
256 | 256 | if (File::exist($thumb) || File::exist($full)) { |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $connector = new \elFinderConnector(new \elFinder([ |
38 | 38 | 'locale' => '', |
39 | 39 | 'roots' => [ |
40 | - ['driver' => 'LocalFileSystem', 'path' => root . '/upload/', 'URL' => App::$Alias->scriptUrl . '/upload/'] |
|
40 | + ['driver' => 'LocalFileSystem', 'path' => root.'/upload/', 'URL' => App::$Alias->scriptUrl.'/upload/'] |
|
41 | 41 | ] |
42 | 42 | ])); |
43 | 43 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | if (App::$Cache->get('download.ffcms.api.news.'.$this->lang) !== null) { |
106 | 106 | $news = App::$Cache->get('download.ffcms.api.news.'.$this->lang); |
107 | 107 | } else { |
108 | - $news = Url::download('https://ffcms.org/api/api/news?lang=' . $this->lang); |
|
108 | + $news = Url::download('https://ffcms.org/api/api/news?lang='.$this->lang); |
|
109 | 109 | if ($news !== null && !Str::likeEmpty($news)) { |
110 | 110 | App::$Cache->set('download.ffcms.api.news.'.$this->lang, $news, 3600 * 12); |
111 | 111 | } |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | foreach ($all as $file) { |
41 | 41 | $file = Str::cleanExtension(basename($file)); |
42 | 42 | // $file="3.0.0-3.0.1" become to $start = 3.0.0,$end=3.0.1 |
43 | - list($start,$end) = explode('-', $file); |
|
43 | + list($start, $end) = explode('-', $file); |
|
44 | 44 | // true: start <= db & script >= $end |
45 | - if (version_compare($this->dbVersion, $start) !== 1 && version_compare($this->scriptVersion, $end) !== -1) { |
|
45 | + if (version_compare($this->dbVersion, $start) !== 1 && version_compare($this->scriptVersion, $end) !== -1) { |
|
46 | 46 | $this->updateQueries[] = $file; |
47 | 47 | } |
48 | 48 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | { |
57 | 57 | // run update queries from included files |
58 | 58 | foreach ($this->updateQueries as $file) { |
59 | - @include root . '/Private/Database/Updates/' . $file . '.php'; |
|
59 | + @include root.'/Private/Database/Updates/'.$file.'.php'; |
|
60 | 60 | } |
61 | 61 | // update version in db table |
62 | 62 | $row = System::getVar('version'); |
@@ -34,12 +34,12 @@ |
||
34 | 34 | */ |
35 | 35 | public function make() |
36 | 36 | { |
37 | - $archive = $this->name . '.zip'; |
|
37 | + $archive = $this->name.'.zip'; |
|
38 | 38 | // download archive |
39 | - File::saveFromUrl($this->url, '/' . $archive); |
|
39 | + File::saveFromUrl($this->url, '/'.$archive); |
|
40 | 40 | // extract archive |
41 | 41 | $zip = new \ZipArchive(); |
42 | - if ($zip->open(root . '/' . $archive) === true) { |
|
42 | + if ($zip->open(root.'/'.$archive) === true) { |
|
43 | 43 | $zip->extractTo(root); |
44 | 44 | $zip->close(); |
45 | 45 | // cleanup cache |
@@ -27,20 +27,20 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function actionHelp() |
29 | 29 | { |
30 | - $text = "You are using FFCMS console application." . PHP_EOL; |
|
31 | - $text .= "This application support next basic commands:" . PHP_EOL; |
|
32 | - $text .= "\t main/info - show info about CMS" . PHP_EOL; |
|
33 | - $text .= "\t main/install - install FFCMS from console line." . PHP_EOL; |
|
34 | - $text .= "\t main/update - update package to current minor version if available." . PHP_EOL; |
|
35 | - $text .= "\t main/chmod - update chmod for ffcms special folders. Can be used after project deployment." . PHP_EOL; |
|
36 | - $text .= "\t main/buildperms - build and update permissions map for applications." . PHP_EOL; |
|
37 | - $text .= "\t create/model workground/modelName - create model carcase default." . PHP_EOL; |
|
38 | - $text .= "\t create/ar activeRecordName - create active record table and model." . PHP_EOL; |
|
39 | - $text .= "\t create/controller workground/controllerName - create default controller carcase." . PHP_EOL; |
|
40 | - $text .= "\t create/widget workground/widgetName/widgetName - create default widget carcase." . PHP_EOL; |
|
41 | - $text .= "\t db/import activeRecordName - import to database single schema from ar model." . PHP_EOL; |
|
42 | - $text .= "\t db/importAll - import all active record tables to database." . PHP_EOL; |
|
43 | - $text .= "\t db/adduser - add new user into database." . PHP_EOL; |
|
30 | + $text = "You are using FFCMS console application.".PHP_EOL; |
|
31 | + $text .= "This application support next basic commands:".PHP_EOL; |
|
32 | + $text .= "\t main/info - show info about CMS".PHP_EOL; |
|
33 | + $text .= "\t main/install - install FFCMS from console line.".PHP_EOL; |
|
34 | + $text .= "\t main/update - update package to current minor version if available.".PHP_EOL; |
|
35 | + $text .= "\t main/chmod - update chmod for ffcms special folders. Can be used after project deployment.".PHP_EOL; |
|
36 | + $text .= "\t main/buildperms - build and update permissions map for applications.".PHP_EOL; |
|
37 | + $text .= "\t create/model workground/modelName - create model carcase default.".PHP_EOL; |
|
38 | + $text .= "\t create/ar activeRecordName - create active record table and model.".PHP_EOL; |
|
39 | + $text .= "\t create/controller workground/controllerName - create default controller carcase.".PHP_EOL; |
|
40 | + $text .= "\t create/widget workground/widgetName/widgetName - create default widget carcase.".PHP_EOL; |
|
41 | + $text .= "\t db/import activeRecordName - import to database single schema from ar model.".PHP_EOL; |
|
42 | + $text .= "\t db/importAll - import all active record tables to database.".PHP_EOL; |
|
43 | + $text .= "\t db/adduser - add new user into database.".PHP_EOL; |
|
44 | 44 | return $text; |
45 | 45 | } |
46 | 46 | |
@@ -50,17 +50,17 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function actionInfo() |
52 | 52 | { |
53 | - $text = "Information about FFCMS package and environment:" . PHP_EOL; |
|
54 | - $text .= "\t PHP version: " . phpversion() . PHP_EOL; |
|
55 | - $text .= "\t Dist path: " . root . PHP_EOL; |
|
56 | - $text .= "\t Used version: " . Version::VERSION . ' [build: ' . Version::DATE . ']' . PHP_EOL; |
|
57 | - $text .= "Information about FFCMS cmf packages:" . PHP_EOL; |
|
53 | + $text = "Information about FFCMS package and environment:".PHP_EOL; |
|
54 | + $text .= "\t PHP version: ".phpversion().PHP_EOL; |
|
55 | + $text .= "\t Dist path: ".root.PHP_EOL; |
|
56 | + $text .= "\t Used version: ".Version::VERSION.' [build: '.Version::DATE.']'.PHP_EOL; |
|
57 | + $text .= "Information about FFCMS cmf packages:".PHP_EOL; |
|
58 | 58 | |
59 | 59 | $composerInfo = File::read('/composer.lock'); |
60 | 60 | if (false !== $composerInfo) { |
61 | 61 | $jsonInfo = json_decode($composerInfo); |
62 | 62 | foreach ($jsonInfo->packages as $item) { |
63 | - $text .= "\t Package: " . $item->name . ' => ' . $item->version . PHP_EOL; |
|
63 | + $text .= "\t Package: ".$item->name.' => '.$item->version.PHP_EOL; |
|
64 | 64 | } |
65 | 65 | } else { |
66 | 66 | $text .= "\t Composer is never be used - no information available."; |
@@ -96,16 +96,16 @@ discard block |
||
96 | 96 | preg_match_all('/public function action(\w*?)\(/', $byte, $matches); // matches[0] contains all methods ;) |
97 | 97 | if (Obj::isArray($matches[1]) && count($matches[1]) > 0) { |
98 | 98 | foreach ($matches[1] as $perm) { |
99 | - $permissions[] = 'Admin/' . $className . '/' . $perm; |
|
99 | + $permissions[] = 'Admin/'.$className.'/'.$perm; |
|
100 | 100 | } |
101 | 101 | } |
102 | 102 | } |
103 | 103 | |
104 | 104 | // prepare save string |
105 | - $stringSave = "<?php \n\nreturn " . var_export($permissions, true) . ';'; |
|
105 | + $stringSave = "<?php \n\nreturn ".var_export($permissions, true).';'; |
|
106 | 106 | File::write('/Private/Config/Permissions.php', $stringSave); |
107 | 107 | |
108 | - return 'Permissions configuration is successful updated! Founded permissions: ' . count($permissions); |
|
108 | + return 'Permissions configuration is successful updated! Founded permissions: '.count($permissions); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |
@@ -119,9 +119,9 @@ discard block |
||
119 | 119 | if (Directory::exist($obj)) { |
120 | 120 | Directory::recursiveChmod($obj, 0777); |
121 | 121 | } elseif (File::exist($obj)) { |
122 | - chmod(root . $obj, 0777); |
|
122 | + chmod(root.$obj, 0777); |
|
123 | 123 | } else { |
124 | - $errors .= Console::$Output->write('Filesystem object is not founded: ' . $obj); |
|
124 | + $errors .= Console::$Output->write('Filesystem object is not founded: '.$obj); |
|
125 | 125 | } |
126 | 126 | } |
127 | 127 | |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | } |
141 | 141 | |
142 | 142 | echo Console::$Output->writeHeader('License start'); |
143 | - echo File::read('/LICENSE') . PHP_EOL; |
|
143 | + echo File::read('/LICENSE').PHP_EOL; |
|
144 | 144 | echo Console::$Output->writeHeader('License end'); |
145 | 145 | |
146 | 146 | $config = Console::$Properties->get('database'); |
@@ -159,38 +159,38 @@ discard block |
||
159 | 159 | |
160 | 160 | // database config from input |
161 | 161 | echo Console::$Output->writeHeader('Database connection configuration'); |
162 | - echo 'Driver(default:' . $config['driver'] . '):'; |
|
162 | + echo 'Driver(default:'.$config['driver'].'):'; |
|
163 | 163 | $dbDriver = Console::$Input->read(); |
164 | 164 | if (Arr::in($dbDriver, ['mysql', 'pgsql', 'sqlite'])) { |
165 | 165 | $newConfig['driver'] = $dbDriver; |
166 | 166 | } |
167 | 167 | |
168 | 168 | // for sqlite its would be a path |
169 | - echo 'Host(default:' . $config['host'] . '):'; |
|
169 | + echo 'Host(default:'.$config['host'].'):'; |
|
170 | 170 | $dbHost = Console::$Input->read(); |
171 | 171 | if (!Str::likeEmpty($dbHost)) { |
172 | 172 | $newConfig['host'] = $dbHost; |
173 | 173 | } |
174 | 174 | |
175 | - echo 'Database name(default:' . $config['database'] . '):'; |
|
175 | + echo 'Database name(default:'.$config['database'].'):'; |
|
176 | 176 | $dbName = Console::$Input->read(); |
177 | 177 | if (!Str::likeEmpty($dbName)) { |
178 | 178 | $newConfig['database'] = $dbName; |
179 | 179 | } |
180 | 180 | |
181 | - echo 'User(default:' . $config['username'] . '):'; |
|
181 | + echo 'User(default:'.$config['username'].'):'; |
|
182 | 182 | $dbUser = Console::$Input->read(); |
183 | 183 | if (!Str::likeEmpty($dbUser)) { |
184 | 184 | $newConfig['username'] = $dbUser; |
185 | 185 | } |
186 | 186 | |
187 | - echo 'Password(default:' . $config['password'] . '):'; |
|
187 | + echo 'Password(default:'.$config['password'].'):'; |
|
188 | 188 | $dbPwd = Console::$Input->read(); |
189 | 189 | if (!Str::likeEmpty($dbPwd)) { |
190 | 190 | $newConfig['password'] = $dbPwd; |
191 | 191 | } |
192 | 192 | |
193 | - echo 'Table prefix(default:' . $config['prefix'] . '):'; |
|
193 | + echo 'Table prefix(default:'.$config['prefix'].'):'; |
|
194 | 194 | $dbPrefix = Console::$Input->read(); |
195 | 195 | if (!Str::likeEmpty($dbPrefix)) { |
196 | 196 | $newConfig['prefix'] = $dbPrefix; |
@@ -203,11 +203,11 @@ discard block |
||
203 | 203 | try { |
204 | 204 | Console::$Database->connection('install')->getDatabaseName(); |
205 | 205 | } catch (\Exception $e) { |
206 | - return 'Testing database connection is failed! Run installer again and pass tested connection data! Log: ' . $e->getMessage(); |
|
206 | + return 'Testing database connection is failed! Run installer again and pass tested connection data! Log: '.$e->getMessage(); |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | // autoload isn't work here |
210 | - include(root . '/Apps/Controller/Console/Db.php'); |
|
210 | + include(root.'/Apps/Controller/Console/Db.php'); |
|
211 | 211 | |
212 | 212 | // import db data |
213 | 213 | $dbController = new DbController(); |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | |
216 | 216 | // set website send from email from input |
217 | 217 | $emailConfig = Console::$Properties->get('adminEmail'); |
218 | - echo 'Website sendFrom email(default: ' . $emailConfig . '):'; |
|
218 | + echo 'Website sendFrom email(default: '.$emailConfig.'):'; |
|
219 | 219 | $email = Console::$Input->read(); |
220 | 220 | if (!Str::isEmail($email)) { |
221 | 221 | $email = $emailConfig; |
@@ -236,9 +236,9 @@ discard block |
||
236 | 236 | $allCfg['adminEmail'] = $email; |
237 | 237 | $allCfg['baseDomain'] = $baseDomain; |
238 | 238 | echo Console::$Output->write('Generate password salt for BLOWFISH crypt'); |
239 | - $allCfg['passwordSalt'] = '$2a$07$' . Str::randomLatinNumeric(mt_rand(21, 30)) . '$'; |
|
239 | + $allCfg['passwordSalt'] = '$2a$07$'.Str::randomLatinNumeric(mt_rand(21, 30)).'$'; |
|
240 | 240 | echo Console::$Output->write('Generate security cookies for debug panel'); |
241 | - $allCfg['debug']['cookie']['key'] = 'fdebug_' . Str::randomLatinNumeric(mt_rand(8, 32)); |
|
241 | + $allCfg['debug']['cookie']['key'] = 'fdebug_'.Str::randomLatinNumeric(mt_rand(8, 32)); |
|
242 | 242 | $allCfg['debug']['cookie']['value'] = Str::randomLatinNumeric(mt_rand(32, 128)); |
243 | 243 | |
244 | 244 | // write config data |
@@ -47,21 +47,21 @@ discard block |
||
47 | 47 | // cache some data |
48 | 48 | $rootSize = App::$Cache->get('root.size'); |
49 | 49 | if ($rootSize === null) { |
50 | - $rootSize = round(Directory::getSize('/') / (1024*1000), 2) . ' mb'; |
|
50 | + $rootSize = round(Directory::getSize('/') / (1024 * 1000), 2).' mb'; |
|
51 | 51 | App::$Cache->set('root.size', $rootSize, 86400); // 24 hours caching = 60 * 60 * 24 |
52 | 52 | } |
53 | 53 | $loadAvg = App::$Cache->get('load.average'); |
54 | 54 | if ($loadAvg === null) { |
55 | 55 | $loadAvg = Environment::loadAverage(); |
56 | - App::$Cache->set('load.average', $loadAvg, 60*5); // 5 min cache |
|
56 | + App::$Cache->set('load.average', $loadAvg, 60 * 5); // 5 min cache |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | // prepare system statistic |
60 | 60 | $stats = [ |
61 | - 'ff_version' => Version::VERSION . ' (' . Version::DATE . ')', |
|
62 | - 'php_version' => Environment::phpVersion() . ' (' . Environment::phpSAPI() . ')', |
|
61 | + 'ff_version' => Version::VERSION.' ('.Version::DATE.')', |
|
62 | + 'php_version' => Environment::phpVersion().' ('.Environment::phpSAPI().')', |
|
63 | 63 | 'os_name' => Environment::osName(), |
64 | - 'database_name' => App::$Database->connection()->getDatabaseName() . ' (' . App::$Database->connection()->getDriverName() . ')', |
|
64 | + 'database_name' => App::$Database->connection()->getDatabaseName().' ('.App::$Database->connection()->getDriverName().')', |
|
65 | 65 | 'file_size' => $rootSize, |
66 | 66 | 'load_avg' => $loadAvg |
67 | 67 | ]; |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | public function actionFiles() |
114 | 114 | { |
115 | 115 | return $this->view->render('files', [ |
116 | - 'connector' => App::$Alias->scriptUrl . '/api/main/files?lang=' . $this->request->getLanguage() |
|
116 | + 'connector' => App::$Alias->scriptUrl.'/api/main/files?lang='.$this->request->getLanguage() |
|
117 | 117 | ]); |
118 | 118 | } |
119 | 119 | |
@@ -186,9 +186,9 @@ discard block |
||
186 | 186 | */ |
187 | 187 | public function actionDeleteroute() |
188 | 188 | { |
189 | - $type = (string)$this->request->query->get('type'); |
|
190 | - $loader = (string)$this->request->query->get('loader'); |
|
191 | - $source = Str::lowerCase((string)$this->request->query->get('path')); |
|
189 | + $type = (string) $this->request->query->get('type'); |
|
190 | + $loader = (string) $this->request->query->get('loader'); |
|
191 | + $source = Str::lowerCase((string) $this->request->query->get('path')); |
|
192 | 192 | |
193 | 193 | $model = new EntityDeleteRoute($type, $loader, $source); |
194 | 194 | if ($model->send() && $model->validate()) { |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | { |
212 | 212 | $stats = App::$Cache->stats(); |
213 | 213 | // get size in mb from cache stats |
214 | - $size = round((int)$stats['size'] / (1024*1024), 2); |
|
214 | + $size = round((int) $stats['size'] / (1024 * 1024), 2); |
|
215 | 215 | |
216 | 216 | // check if submited |
217 | 217 | if ($this->request->request->get('clearcache', false)) { |