@@ -26,20 +26,20 @@ discard block |
||
26 | 26 | */ |
27 | 27 | public function actionHelp() |
28 | 28 | { |
29 | - $text = "You are using FFCMS console application." . PHP_EOL; |
|
30 | - $text .= "This application support next basic commands:" . PHP_EOL; |
|
31 | - $text .= "\t main/info - show info about CMS" . PHP_EOL; |
|
32 | - $text .= "\t main/install - install FFCMS from console line." . PHP_EOL; |
|
33 | - $text .= "\t main/update - update package to current minor version if available." . PHP_EOL; |
|
34 | - $text .= "\t main/chmod - update chmod for ffcms special folders. Can be used after project deployment." . PHP_EOL; |
|
35 | - $text .= "\t main/buildperms - build and update permissions map for applications." . PHP_EOL; |
|
36 | - $text .= "\t create/model workground/modelName - create model carcase default." . PHP_EOL; |
|
37 | - $text .= "\t create/ar activeRecordName - create active record table and model." . PHP_EOL; |
|
38 | - $text .= "\t create/controller workground/controllerName - create default controller carcase." . PHP_EOL; |
|
39 | - $text .= "\t create/widget workground/widgetName/widgetName - create default widget carcase." . PHP_EOL; |
|
40 | - $text .= "\t db/import activeRecordName - import to database single schema from ar model." . PHP_EOL; |
|
41 | - $text .= "\t db/importAll - import all active record tables to database." . PHP_EOL; |
|
42 | - $text .= "\t db/adduser - add new user into database." . PHP_EOL; |
|
29 | + $text = "You are using FFCMS console application.".PHP_EOL; |
|
30 | + $text .= "This application support next basic commands:".PHP_EOL; |
|
31 | + $text .= "\t main/info - show info about CMS".PHP_EOL; |
|
32 | + $text .= "\t main/install - install FFCMS from console line.".PHP_EOL; |
|
33 | + $text .= "\t main/update - update package to current minor version if available.".PHP_EOL; |
|
34 | + $text .= "\t main/chmod - update chmod for ffcms special folders. Can be used after project deployment.".PHP_EOL; |
|
35 | + $text .= "\t main/buildperms - build and update permissions map for applications.".PHP_EOL; |
|
36 | + $text .= "\t create/model workground/modelName - create model carcase default.".PHP_EOL; |
|
37 | + $text .= "\t create/ar activeRecordName - create active record table and model.".PHP_EOL; |
|
38 | + $text .= "\t create/controller workground/controllerName - create default controller carcase.".PHP_EOL; |
|
39 | + $text .= "\t create/widget workground/widgetName/widgetName - create default widget carcase.".PHP_EOL; |
|
40 | + $text .= "\t db/import activeRecordName - import to database single schema from ar model.".PHP_EOL; |
|
41 | + $text .= "\t db/importAll - import all active record tables to database.".PHP_EOL; |
|
42 | + $text .= "\t db/adduser - add new user into database.".PHP_EOL; |
|
43 | 43 | return $text; |
44 | 44 | } |
45 | 45 | |
@@ -49,17 +49,17 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function actionInfo() |
51 | 51 | { |
52 | - $text = "Information about FFCMS package and environment:" . PHP_EOL; |
|
53 | - $text .= "\t PHP version: " . phpversion() . PHP_EOL; |
|
54 | - $text .= "\t Dist path: " . root . PHP_EOL; |
|
55 | - $text .= "\t Used version: " . Console::$Properties->version['num'] . ' [build: ' . Console::$Properties->version['date'] . ']' . PHP_EOL; |
|
56 | - $text .= "Information about FFCMS cmf packages:" . PHP_EOL; |
|
52 | + $text = "Information about FFCMS package and environment:".PHP_EOL; |
|
53 | + $text .= "\t PHP version: ".phpversion().PHP_EOL; |
|
54 | + $text .= "\t Dist path: ".root.PHP_EOL; |
|
55 | + $text .= "\t Used version: ".Console::$Properties->version['num'].' [build: '.Console::$Properties->version['date'].']'.PHP_EOL; |
|
56 | + $text .= "Information about FFCMS cmf packages:".PHP_EOL; |
|
57 | 57 | |
58 | 58 | $composerInfo = File::read('/composer.lock'); |
59 | 59 | if (false !== $composerInfo) { |
60 | 60 | $jsonInfo = json_decode($composerInfo); |
61 | 61 | foreach ($jsonInfo->packages as $item) { |
62 | - $text .= "\t Package: " . $item->name . ' => ' . $item->version . PHP_EOL; |
|
62 | + $text .= "\t Package: ".$item->name.' => '.$item->version.PHP_EOL; |
|
63 | 63 | } |
64 | 64 | } else { |
65 | 65 | $text .= "\t Composer is never be used - no information available."; |
@@ -95,16 +95,16 @@ discard block |
||
95 | 95 | preg_match_all('/public function action(\w*?)\(/', $byte, $matches); // matches[0] contains all methods ;) |
96 | 96 | if (Obj::isArray($matches[1]) && count($matches[1]) > 0) { |
97 | 97 | foreach ($matches[1] as $perm) { |
98 | - $permissions[] = 'Admin/' . $className . '/' . $perm; |
|
98 | + $permissions[] = 'Admin/'.$className.'/'.$perm; |
|
99 | 99 | } |
100 | 100 | } |
101 | 101 | } |
102 | 102 | |
103 | 103 | // prepare save string |
104 | - $stringSave = "<?php \n\nreturn " . var_export($permissions, true) . ';'; |
|
104 | + $stringSave = "<?php \n\nreturn ".var_export($permissions, true).';'; |
|
105 | 105 | File::write('/Private/Config/Permissions.php', $stringSave); |
106 | 106 | |
107 | - return 'Permissions configuration is successful updated! Founded permissions: ' . count($permissions); |
|
107 | + return 'Permissions configuration is successful updated! Founded permissions: '.count($permissions); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | /** |
@@ -118,9 +118,9 @@ discard block |
||
118 | 118 | if (Directory::exist($obj)) { |
119 | 119 | Directory::recursiveChmod($obj, 0777); |
120 | 120 | } elseif (File::exist($obj)) { |
121 | - chmod(root . $obj, 0777); |
|
121 | + chmod(root.$obj, 0777); |
|
122 | 122 | } else { |
123 | - $errors .= Console::$Output->write('Filesystem object is not founded: ' . $obj); |
|
123 | + $errors .= Console::$Output->write('Filesystem object is not founded: '.$obj); |
|
124 | 124 | } |
125 | 125 | } |
126 | 126 | |
@@ -154,38 +154,38 @@ discard block |
||
154 | 154 | |
155 | 155 | // database config from input |
156 | 156 | echo Console::$Output->writeHeader('Database connection configuration'); |
157 | - echo 'Driver(default:' . $config['driver'] . '):'; |
|
157 | + echo 'Driver(default:'.$config['driver'].'):'; |
|
158 | 158 | $dbDriver = Console::$Input->read(); |
159 | 159 | if (Arr::in($dbDriver, ['mysql', 'pgsql', 'sqlite'])) { |
160 | 160 | $newConfig['driver'] = $dbDriver; |
161 | 161 | } |
162 | 162 | |
163 | 163 | // for sqlite its would be a path |
164 | - echo 'Host(default:' . $config['host'] . '):'; |
|
164 | + echo 'Host(default:'.$config['host'].'):'; |
|
165 | 165 | $dbHost = Console::$Input->read(); |
166 | 166 | if (!Str::likeEmpty($dbHost)) { |
167 | 167 | $newConfig['host'] = $dbHost; |
168 | 168 | } |
169 | 169 | |
170 | - echo 'Database name(default:' . $config['database'] . '):'; |
|
170 | + echo 'Database name(default:'.$config['database'].'):'; |
|
171 | 171 | $dbName = Console::$Input->read(); |
172 | 172 | if (!Str::likeEmpty($dbName)) { |
173 | 173 | $newConfig['database'] = $dbName; |
174 | 174 | } |
175 | 175 | |
176 | - echo 'User(default:' . $config['username'] . '):'; |
|
176 | + echo 'User(default:'.$config['username'].'):'; |
|
177 | 177 | $dbUser = Console::$Input->read(); |
178 | 178 | if (!Str::likeEmpty($dbUser)) { |
179 | 179 | $newConfig['username'] = $dbUser; |
180 | 180 | } |
181 | 181 | |
182 | - echo 'Password(default:' . $config['password'] . '):'; |
|
182 | + echo 'Password(default:'.$config['password'].'):'; |
|
183 | 183 | $dbPwd = Console::$Input->read(); |
184 | 184 | if (!Str::likeEmpty($dbPwd)) { |
185 | 185 | $newConfig['password'] = $dbPwd; |
186 | 186 | } |
187 | 187 | |
188 | - echo 'Table prefix(default:' . $config['prefix'] . '):'; |
|
188 | + echo 'Table prefix(default:'.$config['prefix'].'):'; |
|
189 | 189 | $dbPrefix = Console::$Input->read(); |
190 | 190 | if (!Str::likeEmpty($dbPrefix)) { |
191 | 191 | $newConfig['prefix'] = $dbPrefix; |
@@ -198,11 +198,11 @@ discard block |
||
198 | 198 | try { |
199 | 199 | Console::$Database->connection('install')->getDatabaseName(); |
200 | 200 | } catch (\Exception $e) { |
201 | - return 'Testing database connection is failed! Run installer again and pass tested connection data! Log: ' . $e->getMessage(); |
|
201 | + return 'Testing database connection is failed! Run installer again and pass tested connection data! Log: '.$e->getMessage(); |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | // autoload isn't work here |
205 | - include(root . '/Apps/Controller/Console/Db.php'); |
|
205 | + include(root.'/Apps/Controller/Console/Db.php'); |
|
206 | 206 | |
207 | 207 | // import db data |
208 | 208 | $dbController = new DbController(); |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | |
211 | 211 | // set website send from email from input |
212 | 212 | $emailConfig = Console::$Properties->get('adminEmail'); |
213 | - echo 'Website sendFrom email(default: ' . $emailConfig . '):'; |
|
213 | + echo 'Website sendFrom email(default: '.$emailConfig.'):'; |
|
214 | 214 | $email = Console::$Input->read(); |
215 | 215 | if (!Str::isEmail($email)) { |
216 | 216 | $email = $emailConfig; |
@@ -223,9 +223,9 @@ discard block |
||
223 | 223 | $allCfg['database'] = $dbConfigs; |
224 | 224 | $allCfg['adminEmail'] = $email; |
225 | 225 | echo Console::$Output->write('Generate password salt for BLOWFISH crypt'); |
226 | - $allCfg['passwordSalt'] = '$2a$07$' . Str::randomLatinNumeric(mt_rand(21, 30)) . '$'; |
|
226 | + $allCfg['passwordSalt'] = '$2a$07$'.Str::randomLatinNumeric(mt_rand(21, 30)).'$'; |
|
227 | 227 | echo Console::$Output->write('Generate security cookies for debug panel'); |
228 | - $allCfg['debug']['cookie']['key'] = 'fdebug_' . Str::randomLatinNumeric(mt_rand(8, 32)); |
|
228 | + $allCfg['debug']['cookie']['key'] = 'fdebug_'.Str::randomLatinNumeric(mt_rand(8, 32)); |
|
229 | 229 | $allCfg['debug']['cookie']['value'] = Str::randomLatinNumeric(mt_rand(32, 128)); |
230 | 230 | |
231 | 231 | // write config data |
@@ -14,13 +14,13 @@ discard block |
||
14 | 14 | $this->title = __('User list'); |
15 | 15 | |
16 | 16 | if ($id === 'all') { |
17 | - $this->title .= ': ' . __('All'); |
|
17 | + $this->title .= ': '.__('All'); |
|
18 | 18 | } elseif ($id === 'rating') { |
19 | - $this->title .= ': ' . __('Rating'); |
|
19 | + $this->title .= ': '.__('Rating'); |
|
20 | 20 | } elseif ($id === 'city') { |
21 | - $this->title .= ': ' . __('City') . ' ' . \App::$Security->strip_tags($add); |
|
21 | + $this->title .= ': '.__('City').' '.\App::$Security->strip_tags($add); |
|
22 | 22 | } elseif ($id === 'hobby') { |
23 | - $this->title .= ': ' . __('Hobby') . ' ' . \App::$Security->strip_tags($add); |
|
23 | + $this->title .= ': '.__('Hobby').' '.\App::$Security->strip_tags($add); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | $this->breadcrumbs = [ |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | <?php |
37 | 37 | if ($records === null || $records->count() < 1) { |
38 | - echo '<div class="alert alert-danger">' . __('Users are not founded!') . '</div>'; |
|
38 | + echo '<div class="alert alert-danger">'.__('Users are not founded!').'</div>'; |
|
39 | 39 | return; |
40 | 40 | } |
41 | 41 | ?> |
@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | </div> |
49 | 49 | <div class="col-md-8"> |
50 | 50 | <h3> |
51 | - <?= Url::link(['profile/show', $profile->user_id], Str::likeEmpty($profile->nick) ? __('No name') . '(id' . $profile->user_id . ')' : $profile->nick) ?> |
|
51 | + <?= Url::link(['profile/show', $profile->user_id], Str::likeEmpty($profile->nick) ? __('No name').'(id'.$profile->user_id.')' : $profile->nick) ?> |
|
52 | 52 | </h3> |
53 | 53 | <p><?= __('Registered') ?>: <?= Date::convertToDatetime($profile->created_at, Date::FORMAT_TO_DAY) ?></p> |
54 | 54 | <?php if (\App::$User->identity() !== null && $profile->user_id !== \App::$User->identity()->getId()): ?> |
55 | - <?= Url::link(['profile/messages', null, null, ['newdialog' => $profile->user_id]], '<i class="fa fa-pencil-square-o"></i> ' . __('New message'), ['class' => 'btn btn-info']) ?> |
|
55 | + <?= Url::link(['profile/messages', null, null, ['newdialog' => $profile->user_id]], '<i class="fa fa-pencil-square-o"></i> '.__('New message'), ['class' => 'btn btn-info']) ?> |
|
56 | 56 | <?php endif; ?> |
57 | 57 | </div> |
58 | 58 | <div class="col-md-2"> |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | date_default_timezone_set(App::$Properties->get('timezone')); |
14 | 14 | |
15 | 15 | return [ |
16 | - 'Database' => function () { |
|
16 | + 'Database' => function() { |
|
17 | 17 | $capsule = new Capsule; |
18 | 18 | if (env_name !== 'Install') { |
19 | 19 | try { |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | try { |
35 | 35 | $capsule->connection()->getPdo(); |
36 | 36 | } catch (\Exception $e) { |
37 | - $instUri = \App::$Alias->scriptUrl . '/install'; |
|
37 | + $instUri = \App::$Alias->scriptUrl.'/install'; |
|
38 | 38 | \App::$Response->redirect($instUri, true); |
39 | 39 | } |
40 | 40 | } |
@@ -46,10 +46,10 @@ discard block |
||
46 | 46 | try { |
47 | 47 | $pdo = \App::$Database->connection()->getPdo(); |
48 | 48 | $handler = new PdoSessionHandler($pdo, [ |
49 | - 'db_table' => App::$Properties->get('database')['prefix'] . 'sessions' |
|
49 | + 'db_table' => App::$Properties->get('database')['prefix'].'sessions' |
|
50 | 50 | ]); |
51 | 51 | } catch (Exception $e) { |
52 | - $handler = new NativeFileSessionHandler(root . '/Private/Sessions'); |
|
52 | + $handler = new NativeFileSessionHandler(root.'/Private/Sessions'); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | $storage = new NativeSessionStorage([ |
@@ -60,21 +60,21 @@ discard block |
||
60 | 60 | |
61 | 61 | return new Session($storage); |
62 | 62 | }, |
63 | - 'User' => function () { |
|
63 | + 'User' => function() { |
|
64 | 64 | return new Apps\ActiveRecord\User(); |
65 | 65 | }, |
66 | - 'Mailer' => function () { |
|
66 | + 'Mailer' => function() { |
|
67 | 67 | $swiftTransport = Swift_MailTransport::newInstance(); |
68 | 68 | return Swift_Mailer::newInstance($swiftTransport); |
69 | 69 | }, |
70 | - 'Captcha' => function () { |
|
70 | + 'Captcha' => function() { |
|
71 | 71 | return new Extend\Core\Captcha\Gregwar(); |
72 | 72 | }, |
73 | - 'Cache' => function () { |
|
73 | + 'Cache' => function() { |
|
74 | 74 | // initialize cache manager. You can use redis, memcache or anything else. Look at: phpfastcache.com |
75 | 75 | CacheManager::setup([ |
76 | 76 | 'storage' => 'files', |
77 | - 'path' => root . '/Private/Cache' |
|
77 | + 'path' => root.'/Private/Cache' |
|
78 | 78 | ]); |
79 | 79 | return CacheManager::getInstance('files'); |
80 | 80 | }, |
@@ -95,5 +95,5 @@ |
||
95 | 95 | </div> |
96 | 96 | <?php if (count($staticItems) < 1 && count($dynamicItems) < 1): ?> |
97 | 97 | <p class="alert alert-warning"><?= __('Custom routes is not yet found') ?></p> |
98 | -<?php endif ;?> |
|
99 | -<?= Url::link(['main/addroute'], '<i class="fa fa-plus"></i> ' . __('New route'), ['class' => 'btn btn-primary']) ?> |
|
100 | 98 | \ No newline at end of file |
99 | +<?php endif; ?> |
|
100 | +<?= Url::link(['main/addroute'], '<i class="fa fa-plus"></i> '.__('New route'), ['class' => 'btn btn-primary']) ?> |
|
101 | 101 | \ No newline at end of file |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | { |
60 | 60 | $this->_path = $path; |
61 | 61 | $this->_configs = $configs; |
62 | - $this->_page = (int)$offset; |
|
62 | + $this->_page = (int) $offset; |
|
63 | 63 | $this->_sort = $sort; |
64 | 64 | parent::__construct(); |
65 | 65 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | public function before() |
73 | 73 | { |
74 | 74 | // find one or more categories where we must looking for content items |
75 | - if ((int)$this->_configs['multiCategories'] === 1) { |
|
75 | + if ((int) $this->_configs['multiCategories'] === 1) { |
|
76 | 76 | $this->findCategories(); |
77 | 77 | } else { |
78 | 78 | $this->findCategory(); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function setItemLimit($limit) |
93 | 93 | { |
94 | - $this->_customItemLimit = (int)$limit; |
|
94 | + $this->_customItemLimit = (int) $limit; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | private function findCategories() |
120 | 120 | { |
121 | 121 | // get all categories for current path and child of it |
122 | - $query = ContentCategory::where('path', 'like', $this->_path . '%'); |
|
122 | + $query = ContentCategory::where('path', 'like', $this->_path.'%'); |
|
123 | 123 | if ($query->count() < 1) { |
124 | 124 | throw new NotFoundException(__('Category is not founded')); |
125 | 125 | } |
@@ -152,10 +152,10 @@ discard block |
||
152 | 152 | } |
153 | 153 | |
154 | 154 | // calculate selection offset |
155 | - $itemPerPage = (int)$this->_configs['itemPerCategory']; |
|
155 | + $itemPerPage = (int) $this->_configs['itemPerCategory']; |
|
156 | 156 | // check if custom itemlimit defined over model api |
157 | 157 | if ($this->_customItemLimit !== false) { |
158 | - $itemPerPage = (int)$this->_customItemLimit; |
|
158 | + $itemPerPage = (int) $this->_customItemLimit; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | $offset = $this->_page * $itemPerPage; |
@@ -197,15 +197,15 @@ discard block |
||
197 | 197 | $catConfigs = Serialize::decode($this->_currentCategory->configs); |
198 | 198 | // prepare rss url link for current category if enabled |
199 | 199 | $rssUrl = false; |
200 | - if ((int)$this->_configs['rss'] === 1 && (int)$catConfigs['showRss'] === 1) { |
|
201 | - $rssUrl = App::$Alias->baseUrl . '/content/rss/' . $this->_currentCategory->path; |
|
200 | + if ((int) $this->_configs['rss'] === 1 && (int) $catConfigs['showRss'] === 1) { |
|
201 | + $rssUrl = App::$Alias->baseUrl.'/content/rss/'.$this->_currentCategory->path; |
|
202 | 202 | $rssUrl = rtrim($rssUrl, '/'); |
203 | 203 | } |
204 | 204 | |
205 | 205 | // prepare sorting urls |
206 | 206 | $catSortParams = []; |
207 | 207 | if (App::$Request->query->get('page') !== null) { |
208 | - $catSortParams['page'] = (int)App::$Request->query->get('page'); |
|
208 | + $catSortParams['page'] = (int) App::$Request->query->get('page'); |
|
209 | 209 | } |
210 | 210 | $catSortUrls = [ |
211 | 211 | 'views' => Url::to('content/list', $this->_currentCategory->path, null, Arr::merge($catSortParams, ['sort' => 'views']), false), |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | ]; |
225 | 225 | |
226 | 226 | // check if this category is hidden |
227 | - if ((int)$this->category['configs']['showCategory'] !== 1) { |
|
227 | + if ((int) $this->category['configs']['showCategory'] !== 1) { |
|
228 | 228 | throw new ForbiddenException(__('This category is not available to view')); |
229 | 229 | } |
230 | 230 | |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | // check if current user can rate item |
280 | 280 | $ignoredRate = App::$Session->get('content.rate.ignore'); |
281 | 281 | $canRate = true; |
282 | - if (Obj::isArray($ignoredRate) && Arr::in((string)$row->id, $ignoredRate)) { |
|
282 | + if (Obj::isArray($ignoredRate) && Arr::in((string) $row->id, $ignoredRate)) { |
|
283 | 283 | $canRate = false; |
284 | 284 | } |
285 | 285 | if (!App::$User->isAuth()) { |
@@ -299,11 +299,11 @@ discard block |
||
299 | 299 | 'poster' => $row->getPosterUri(), |
300 | 300 | 'thumb' => $row->getPosterThumbUri(), |
301 | 301 | 'thumbSize' => File::size($row->getPosterThumbUri()), |
302 | - 'views' => (int)$row->views, |
|
303 | - 'rating' => (int)$row->rating, |
|
302 | + 'views' => (int) $row->views, |
|
303 | + 'rating' => (int) $row->rating, |
|
304 | 304 | 'canRate' => $canRate, |
305 | 305 | 'category' => $this->categories[$row->category_id], |
306 | - 'uri' => '/content/read/' . $itemPath, |
|
306 | + 'uri' => '/content/read/'.$itemPath, |
|
307 | 307 | 'tags' => $tags |
308 | 308 | ]; |
309 | 309 | } |
@@ -52,16 +52,16 @@ discard block |
||
52 | 52 | $this->data[$lang][] = [ |
53 | 53 | 'uri' => Url::standaloneUrl($uri, $lang), |
54 | 54 | 'lastmod' => Date::convertToDatetime($lastmod, 'c'), |
55 | - 'freq' => (string)$freq, |
|
56 | - 'priority' => (float)$priority |
|
55 | + 'freq' => (string) $freq, |
|
56 | + 'priority' => (float) $priority |
|
57 | 57 | ]; |
58 | 58 | } |
59 | 59 | } else { // only one language, multilanguage is disabled |
60 | 60 | $this->data[App::$Properties->get('singleLanguage')][] = [ |
61 | 61 | 'uri' => Url::standaloneUrl($uri), |
62 | 62 | 'lastmod' => Date::convertToDatetime($lastmod, 'c'), |
63 | - 'freq' => (string)$freq, |
|
64 | - 'priority' => (float)$priority |
|
63 | + 'freq' => (string) $freq, |
|
64 | + 'priority' => (float) $priority |
|
65 | 65 | ]; |
66 | 66 | } |
67 | 67 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | 'items' => $items |
87 | 87 | ]); |
88 | 88 | |
89 | - File::write(EntityIndexList::INDEX_PATH . '/' . $uniqueName . '.' . $lang . '.xml', $xml); |
|
89 | + File::write(EntityIndexList::INDEX_PATH.'/'.$uniqueName.'.'.$lang.'.xml', $xml); |
|
90 | 90 | } |
91 | 91 | return true; |
92 | 92 | } |
@@ -15,19 +15,19 @@ |
||
15 | 15 | <h1><?= __('Sitemap') ?></h1> |
16 | 16 | <hr /> |
17 | 17 | <p><?= __('Sitemap its a special application to generate sitemap as xml file over sitemap standart for search engines.') ?></p> |
18 | -<p><?= __('Sitemap main index') ?>: <a href="<?= \App::$Alias->scriptUrl . '/sitemap' ?>" target="_blank">/sitemap</a></p> |
|
18 | +<p><?= __('Sitemap main index') ?>: <a href="<?= \App::$Alias->scriptUrl.'/sitemap' ?>" target="_blank">/sitemap</a></p> |
|
19 | 19 | <h3><?= __('Sitemap files') ?></h3> |
20 | 20 | <?php |
21 | 21 | $items = []; |
22 | 22 | if ($model->files === null || count($model->files) < 1) { |
23 | - echo '<p class="alert alert-warning">' . __('No sitemap files found! Maybe cron manager is not configured') . '</p>'; |
|
23 | + echo '<p class="alert alert-warning">'.__('No sitemap files found! Maybe cron manager is not configured').'</p>'; |
|
24 | 24 | return; |
25 | 25 | } |
26 | 26 | |
27 | -foreach($model->files as $file) { |
|
27 | +foreach ($model->files as $file) { |
|
28 | 28 | $items[] = [ |
29 | 29 | 'type' => 'link', |
30 | - 'link' => \App::$Alias->scriptUrl . $file, |
|
30 | + 'link' => \App::$Alias->scriptUrl.$file, |
|
31 | 31 | 'text' => $file, |
32 | 32 | 'linkProperty' => ['target' => '_blank'] |
33 | 33 | ]; |
@@ -17,7 +17,7 @@ |
||
17 | 17 | <hr /> |
18 | 18 | <?php |
19 | 19 | if ($model->items === null || count($model->items) < 1) { |
20 | - echo '<p class="alert alert-warning">' . __('No notifications available') . '</p>'; |
|
20 | + echo '<p class="alert alert-warning">'.__('No notifications available').'</p>'; |
|
21 | 21 | return; |
22 | 22 | } |
23 | 23 | ?> |
@@ -49,12 +49,12 @@ discard block |
||
49 | 49 | public function check() |
50 | 50 | { |
51 | 51 | // check if user is auth'd or guest name is defined |
52 | - if (!App::$User->isAuth() && ((int)$this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) { |
|
52 | + if (!App::$User->isAuth() && ((int) $this->_configs['guestAdd'] !== 1 || Str::length($this->guestName) < 2)) { |
|
53 | 53 | throw new JsonException(__('Guest name is not defined')); |
54 | 54 | } |
55 | 55 | |
56 | 56 | // guest moderation |
57 | - if (!App::$User->isAuth() && (bool)$this->_configs['guestModerate']) { |
|
57 | + if (!App::$User->isAuth() && (bool) $this->_configs['guestModerate']) { |
|
58 | 58 | $captcha = App::$Request->request->get('captcha'); |
59 | 59 | if (!App::$Captcha->validate($captcha)) { |
60 | 60 | throw new JsonException(__('Captcha is incorrect! Click on image to refresh and try again')); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | } |
68 | 68 | |
69 | 69 | // check if message length is correct |
70 | - if (Str::length($this->message) < (int)$this->_configs['minLength'] || Str::length($this->message) > (int)$this->_configs['maxLength']) { |
|
70 | + if (Str::length($this->message) < (int) $this->_configs['minLength'] || Str::length($this->message) > (int) $this->_configs['maxLength']) { |
|
71 | 71 | throw new JsonException(__('Message length is incorrect. Current: %cur%, min - %min%, max - %max%', [ |
72 | 72 | 'cur' => Str::length($this->message), |
73 | 73 | 'min' => $this->_configs['minLength'], |
@@ -112,15 +112,15 @@ discard block |
||
112 | 112 | $record->lang = App::$Request->getLanguage(); |
113 | 113 | $record->ip = $this->ip; |
114 | 114 | // check if premoderation is enabled and user is guest |
115 | - if ((bool)$this->_configs['guestModerate'] && $this->_userId < 1) { |
|
115 | + if ((bool) $this->_configs['guestModerate'] && $this->_userId < 1) { |
|
116 | 116 | $record->moderate = 1; |
117 | 117 | } |
118 | 118 | $record->save(); |
119 | 119 | |
120 | 120 | // add notification for comment post owner |
121 | 121 | $commentPost = $record->getCommentPost(); |
122 | - if ($commentPost !== null && (int)$commentPost->user_id !== 0 && (int)$commentPost->user_id !== $this->_userId) { |
|
123 | - $notify = new EntityAddNotification((int)$commentPost->user_id); |
|
122 | + if ($commentPost !== null && (int) $commentPost->user_id !== 0 && (int) $commentPost->user_id !== $this->_userId) { |
|
123 | + $notify = new EntityAddNotification((int) $commentPost->user_id); |
|
124 | 124 | $notify->add($commentPost->pathway, EntityAddNotification::MSG_ADD_COMMENTANSWER, [ |
125 | 125 | 'snippet' => Text::snippet(App::$Security->strip_tags($this->message), 50), |
126 | 126 | 'post' => Text::snippet(App::$Security->strip_tags($commentPost->message), 50) |