@@ -5,7 +5,6 @@ |
||
5 | 5 | use Ffcms\Core\App as MainApp; |
6 | 6 | use Ffcms\Core\Arch\ActiveModel; |
7 | 7 | use Ffcms\Core\Helper\Type\Arr; |
8 | -use Ffcms\Core\Helper\Type\Str; |
|
9 | 8 | |
10 | 9 | class Role extends ActiveModel |
11 | 10 | { |
@@ -26,12 +26,12 @@ |
||
26 | 26 | */ |
27 | 27 | public static function get($role_id) |
28 | 28 | { |
29 | - $role = MainApp::$Memory->get('user.role.cache.' . $role_id); |
|
29 | + $role = MainApp::$Memory->get('user.role.cache.'.$role_id); |
|
30 | 30 | |
31 | 31 | // not founded in cache |
32 | 32 | if ($role === null) { |
33 | 33 | $role = self::find($role_id); |
34 | - MainApp::$Memory->set('user.role.cache.' . $role_id, $role); |
|
34 | + MainApp::$Memory->set('user.role.cache.'.$role_id, $role); |
|
35 | 35 | } |
36 | 36 | return $role; |
37 | 37 | } |
@@ -9,7 +9,6 @@ |
||
9 | 9 | use Ffcms\Core\App; |
10 | 10 | use Ffcms\Core\Exception\SyntaxException; |
11 | 11 | use Ffcms\Core\Helper\FileSystem\File; |
12 | -use Ffcms\Core\Helper\Type\Arr; |
|
13 | 12 | use Ffcms\Core\Helper\Type\Integer; |
14 | 13 | use Ffcms\Core\Helper\Type\Str; |
15 | 14 |
@@ -32,20 +32,20 @@ discard block |
||
32 | 32 | // cache some data |
33 | 33 | $rootSize = App::$Cache->get('root.size'); |
34 | 34 | if ($rootSize === null) { |
35 | - $rootSize = round(Directory::getSize('/') / (1024*1000), 2) . ' mb'; |
|
35 | + $rootSize = round(Directory::getSize('/') / (1024 * 1000), 2).' mb'; |
|
36 | 36 | App::$Cache->set('root.size', $rootSize, 60 * 60 * 24); // 24 hours caching |
37 | 37 | } |
38 | 38 | $loadAvg = App::$Cache->get('load.average'); |
39 | 39 | if ($loadAvg === null) { |
40 | 40 | $loadAvg = Environment::loadAverage(); |
41 | - App::$Cache->set('load.average', $loadAvg, 60*5); // 5 min cache |
|
41 | + App::$Cache->set('load.average', $loadAvg, 60 * 5); // 5 min cache |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | $stats = [ |
45 | - 'ff_version' => App::$Properties->version['num'] . ' (' . App::$Properties->version['date'] . ')', |
|
46 | - 'php_version' => Environment::phpVersion() . ' (' . Environment::phpSAPI() . ')', |
|
45 | + 'ff_version' => App::$Properties->version['num'].' ('.App::$Properties->version['date'].')', |
|
46 | + 'php_version' => Environment::phpVersion().' ('.Environment::phpSAPI().')', |
|
47 | 47 | 'os_name' => Environment::osName(), |
48 | - 'database_name' => App::$Database->connection()->getDatabaseName() . ' (' . App::$Database->connection()->getDriverName() . ')', |
|
48 | + 'database_name' => App::$Database->connection()->getDatabaseName().' ('.App::$Database->connection()->getDriverName().')', |
|
49 | 49 | 'file_size' => $rootSize, |
50 | 50 | 'load_avg' => $loadAvg |
51 | 51 | ]; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | public function actionFiles() |
87 | 87 | { |
88 | 88 | return App::$View->render('files', [ |
89 | - 'connector' => App::$Alias->scriptUrl . '/api/main/files?lang=' . App::$Request->getLanguage() |
|
89 | + 'connector' => App::$Alias->scriptUrl.'/api/main/files?lang='.App::$Request->getLanguage() |
|
90 | 90 | ]); |
91 | 91 | } |
92 | 92 | |
@@ -145,9 +145,9 @@ discard block |
||
145 | 145 | */ |
146 | 146 | public function actionDeleteroute() |
147 | 147 | { |
148 | - $type = (string)App::$Request->query->get('type'); |
|
149 | - $loader = (string)App::$Request->query->get('loader'); |
|
150 | - $source = Str::lowerCase((string)App::$Request->query->get('path')); |
|
148 | + $type = (string) App::$Request->query->get('type'); |
|
149 | + $loader = (string) App::$Request->query->get('loader'); |
|
150 | + $source = Str::lowerCase((string) App::$Request->query->get('path')); |
|
151 | 151 | |
152 | 152 | $model = new EntityDeleteRoute($type, $loader, $source); |
153 | 153 | if ($model->send()) { |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Extend\Core\Arch\FrontAppController; |
6 | 6 | use Ffcms\Core\Arch\View; |
7 | -use Apps\Model\Front\User; |
|
8 | 7 | |
9 | 8 | |
10 | 9 | class Main extends FrontAppController |
@@ -25,6 +25,6 @@ |
||
25 | 25 | |
26 | 26 | public function actionRead($id) |
27 | 27 | { |
28 | - echo "Action read called" . $id; |
|
28 | + echo "Action read called".$id; |
|
29 | 29 | } |
30 | 30 | } |
31 | 31 | \ No newline at end of file |
@@ -9,7 +9,6 @@ |
||
9 | 9 | use Ffcms\Core\Helper\Date; |
10 | 10 | use Ffcms\Core\Helper\FileSystem\Directory; |
11 | 11 | use Ffcms\Core\Helper\FileSystem\File; |
12 | -use Ffcms\Core\Helper\Type\Integer; |
|
13 | 12 | use Ffcms\Core\Helper\Type\Obj; |
14 | 13 | use Ffcms\Core\Helper\Serialize; |
15 | 14 | use Ffcms\Core\Helper\Type\Str; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | if ($this->_content->id === null) { |
52 | 52 | $this->_new = true; |
53 | 53 | if (null === $this->galleryFreeId) { |
54 | - $this->galleryFreeId = '_tmp_' . Str::randomLatin(mt_rand(16, 32)); |
|
54 | + $this->galleryFreeId = '_tmp_'.Str::randomLatin(mt_rand(16, 32)); |
|
55 | 55 | } |
56 | 56 | if (null === $this->authorId) { |
57 | 57 | $this->authorId = App::$User->identity()->getId(); |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function rules() |
83 | 83 | { |
84 | - $res = [ |
|
85 | - ['title.' . App::$Request->getLanguage(), 'required'], |
|
86 | - ['text.' . App::$Request->getLanguage(), 'required', null, true, true], |
|
84 | + $res = [ |
|
85 | + ['title.'.App::$Request->getLanguage(), 'required'], |
|
86 | + ['text.'.App::$Request->getLanguage(), 'required', null, true, true], |
|
87 | 87 | ['text', 'used', null, true, true], |
88 | 88 | ['path', 'reverse_match', '/[\/\'~`\!@#\$%\^&\*\(\)+=\{\}\[\]\|;:"\<\>,\?\\\]/'], |
89 | 89 | [['path', 'categoryId', 'authorId', 'display', 'galleryFreeId', 'title'], 'required'], |
@@ -96,9 +96,9 @@ discard block |
||
96 | 96 | ]; |
97 | 97 | |
98 | 98 | foreach (App::$Properties->get('languages') as $lang) { |
99 | - $res[] = ['title.' . $lang, 'length_max', 120, null, true, true]; |
|
100 | - $res[] = ['keywords.' . $lang, 'length_max', 150]; |
|
101 | - $res[] = ['description.' . $lang, 'length_max', 250]; |
|
99 | + $res[] = ['title.'.$lang, 'length_max', 120, null, true, true]; |
|
100 | + $res[] = ['keywords.'.$lang, 'length_max', 150]; |
|
101 | + $res[] = ['description.'.$lang, 'length_max', 250]; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | return $res; |
@@ -142,8 +142,8 @@ discard block |
||
142 | 142 | $this->_content->meta_description = Serialize::encode(App::$Security->strip_tags($this->metaDescription)); |
143 | 143 | $this->_content->source = App::$Security->strip_tags($this->source); |
144 | 144 | // check if rating is changed |
145 | - if ((int)$this->addRating !== 0) { |
|
146 | - $this->_content->rating += (int)$this->addRating; |
|
145 | + if ((int) $this->addRating !== 0) { |
|
146 | + $this->_content->rating += (int) $this->addRating; |
|
147 | 147 | } |
148 | 148 | // check if special comment hash is exist |
149 | 149 | if ($this->_new || Str::length($this->_content->comment_hash) < 32) { |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | } |
156 | 156 | |
157 | 157 | // save poster data |
158 | - $posterPath = '/upload/gallery/' . $this->galleryFreeId . '/orig/' . $this->poster; |
|
158 | + $posterPath = '/upload/gallery/'.$this->galleryFreeId.'/orig/'.$this->poster; |
|
159 | 159 | if (File::exist($posterPath)) { |
160 | 160 | $this->_content->poster = $this->poster; |
161 | 161 | } |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | |
169 | 169 | // move files |
170 | 170 | if ($tmpGalleryId !== $this->_content->id) { |
171 | - Directory::rename('/upload/gallery/' . $tmpGalleryId, $this->_content->id); |
|
171 | + Directory::rename('/upload/gallery/'.$tmpGalleryId, $this->_content->id); |
|
172 | 172 | } |
173 | 173 | } |
174 | 174 | |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | $data = ContentCategory::getSortedCategories(); |
182 | 182 | $response = []; |
183 | 183 | foreach ($data as $key=>$val) { |
184 | - $response[] = (string)$key; |
|
184 | + $response[] = (string) $key; |
|
185 | 185 | } |
186 | 186 | return $response; |
187 | 187 | } |
@@ -2,7 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace Apps\Model\Front\Profile; |
4 | 4 | |
5 | -use Apps\ActiveRecord\Blacklist; |
|
6 | 5 | use Apps\ActiveRecord\WallPost as WallRecords; |
7 | 6 | use Ffcms\Core\App; |
8 | 7 | use Ffcms\Core\Interfaces\iUser; |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Ffcms\Core\App; |
6 | 6 | use Ffcms\Core\Arch\Model; |
7 | -use Ffcms\Core\Helper\Type\Obj; |
|
8 | 7 | use Ffcms\Core\Helper\Type\Str; |
9 | 8 | use Ffcms\Core\Interfaces\iUser; |
10 | 9 |
@@ -26,7 +26,7 @@ |
||
26 | 26 | $query = new UserRecords(); |
27 | 27 | |
28 | 28 | // set current page and offset |
29 | - $page = (int)App::$Request->query->get('page'); |
|
29 | + $page = (int) App::$Request->query->get('page'); |
|
30 | 30 | $offset = $page * self::ITEM_PER_PAGE; |
31 | 31 | |
32 | 32 | // build pagination |
@@ -98,7 +98,7 @@ |
||
98 | 98 | if ($this->newpassword !== null && Str::length($this->newpassword) >= 3) { |
99 | 99 | $this->_user->password = App::$Security->password_hash($this->newpassword); |
100 | 100 | } |
101 | - } elseif($property === 'approve_token') { |
|
101 | + } elseif ($property === 'approve_token') { |
|
102 | 102 | if ($value == "1") { |
103 | 103 | $this->_user->approve_token = '0'; |
104 | 104 | } else { |
@@ -52,7 +52,7 @@ |
||
52 | 52 | public function save() |
53 | 53 | { |
54 | 54 | // check if target is myself or always exist in block list |
55 | - if ($this->_user->getId() === (int)$this->id || Blacklist::have($this->_user->getId(), $this->id)) { |
|
55 | + if ($this->_user->getId() === (int) $this->id || Blacklist::have($this->_user->getId(), $this->id)) { |
|
56 | 56 | return false; |
57 | 57 | } |
58 | 58 |