@@ -27,12 +27,12 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public static function getByPath($path = '') |
29 | 29 | { |
30 | - if (MainApp::$Memory->get('cache.content.category.path.' . $path) !== null) { |
|
31 | - return MainApp::$Memory->get('cache.content.category.path.' . $path); |
|
30 | + if (MainApp::$Memory->get('cache.content.category.path.'.$path) !== null) { |
|
31 | + return MainApp::$Memory->get('cache.content.category.path.'.$path); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | $record = self::where('path', '=', $path)->first(); |
35 | - MainApp::$Memory->set('cache.content.category.path.' . $path, $record); |
|
35 | + MainApp::$Memory->set('cache.content.category.path.'.$path, $record); |
|
36 | 36 | return $record; |
37 | 37 | } |
38 | 38 | |
@@ -43,12 +43,12 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public static function getById($id) |
45 | 45 | { |
46 | - if (MainApp::$Memory->get('cache.content.category.id.' . $id) !== null) { |
|
47 | - return MainApp::$Memory->get('cache.content.category.id.' . $id); |
|
46 | + if (MainApp::$Memory->get('cache.content.category.id.'.$id) !== null) { |
|
47 | + return MainApp::$Memory->get('cache.content.category.id.'.$id); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | $record = self::find($id); |
51 | - MainApp::$Memory->set('cache.content.category.id.' . $id, $record); |
|
51 | + MainApp::$Memory->set('cache.content.category.id.'.$id, $record); |
|
52 | 52 | return $record; |
53 | 53 | } |
54 | 54 | |
@@ -82,12 +82,12 @@ discard block |
||
82 | 82 | } else { |
83 | 83 | // set level marker based on slashes count in pathway |
84 | 84 | $slashCount = Str::entryCount($path, '/'); |
85 | - for ($i=-1; $i <= $slashCount; $i++) { |
|
85 | + for ($i = -1; $i <= $slashCount; $i++) { |
|
86 | 86 | $title .= '--'; |
87 | 87 | } |
88 | 88 | } |
89 | 89 | // add canonical title from db |
90 | - $title .= ' ' . Serialize::getDecodeLocale($data->title); |
|
90 | + $title .= ' '.Serialize::getDecodeLocale($data->title); |
|
91 | 91 | // set response as array [id => title, ... ] |
92 | 92 | $response[$data->id] = $title; |
93 | 93 | } |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | |
149 | 149 | $scriptVersion = $this->getScriptVersion(); |
150 | 150 | |
151 | - return $scriptVersion === (float)$this->version; |
|
151 | + return $scriptVersion === (float) $this->version; |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | /** |
@@ -157,16 +157,16 @@ discard block |
||
157 | 157 | */ |
158 | 158 | public function getScriptVersion() |
159 | 159 | { |
160 | - $class = 'Apps\Controller\Admin\\' . $this->sys_name; |
|
160 | + $class = 'Apps\Controller\Admin\\'.$this->sys_name; |
|
161 | 161 | if (!class_exists($class)) { |
162 | 162 | return false; |
163 | 163 | } |
164 | 164 | |
165 | - if (!defined($class . '::VERSION')) { |
|
165 | + if (!defined($class.'::VERSION')) { |
|
166 | 166 | return false; |
167 | 167 | } |
168 | 168 | |
169 | - return (float)constant($class . '::VERSION'); |
|
169 | + return (float) constant($class.'::VERSION'); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | } |
173 | 173 | \ No newline at end of file |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | // build path and check is file exists on disk |
98 | - $path = '/upload/gallery/' . $this->id . '/orig/' . $pName; |
|
98 | + $path = '/upload/gallery/'.$this->id.'/orig/'.$pName; |
|
99 | 99 | if (!File::exist($path)) { |
100 | 100 | return null; |
101 | 101 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | // remove extension, thumbs always in jpeg ;D |
118 | 118 | $pName = Str::cleanExtension($pName); |
119 | - $path = '/upload/gallery/' . $this->id . '/thumb/' . $pName . '.jpg'; |
|
119 | + $path = '/upload/gallery/'.$this->id.'/thumb/'.$pName.'.jpg'; |
|
120 | 120 | |
121 | 121 | if (!File::exist($path)) { |
122 | 122 | return null; |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | } |
33 | 33 | // check cache is defined |
34 | 34 | if ($this->cache === null || !Obj::isLikeInt($this->cache)) { |
35 | - $this->cache = (int)$cfg['cache']; |
|
35 | + $this->cache = (int) $cfg['cache']; |
|
36 | 36 | } |
37 | 37 | // check item count is defined |
38 | 38 | if ($this->count === null || !Obj::isLikeInt($this->count)) { |
39 | - $this->count = (int)$cfg['count']; |
|
39 | + $this->count = (int) $cfg['count']; |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 | |
@@ -56,12 +56,12 @@ discard block |
||
56 | 56 | $query = $this->makeQuery(); |
57 | 57 | } else { |
58 | 58 | // try get query result from cache |
59 | - $query = App::$Cache->get('widget.newcontent.' . $cacheHash); |
|
59 | + $query = App::$Cache->get('widget.newcontent.'.$cacheHash); |
|
60 | 60 | if ($query === null) { |
61 | 61 | // if query is not cached make it |
62 | 62 | $query = $this->makeQuery(); |
63 | 63 | // and save result to cache |
64 | - App::$Cache->set('widget.newcontent.' . $cacheHash, $query, $this->cache); |
|
64 | + App::$Cache->set('widget.newcontent.'.$cacheHash, $query, $this->cache); |
|
65 | 65 | } |
66 | 66 | } |
67 | 67 |
@@ -33,7 +33,7 @@ |
||
33 | 33 | foreach (App::$Translate->getAvailableLangs() as $lang) { |
34 | 34 | $items[] = [ |
35 | 35 | 'type' => 'link', |
36 | - 'link' => App::$Alias->baseUrlNoLang . '/' . $lang . App::$Request->getPathInfo(), |
|
36 | + 'link' => App::$Alias->baseUrlNoLang.'/'.$lang.App::$Request->getPathInfo(), |
|
37 | 37 | 'text' => '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="flag flag-'.$lang.'" />', |
38 | 38 | 'html' => true, |
39 | 39 | '!secure' => true |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | $uriRequest = $_SERVER['REQUEST_URI']; |
13 | 13 | |
14 | 14 | // get configs to prepare posible route to switch environment |
15 | -$configs = require(root . '/Private/Config/Default.php'); |
|
15 | +$configs = require(root.'/Private/Config/Default.php'); |
|
16 | 16 | // remove base path |
17 | 17 | $uriRequest = substr($uriRequest, strlen($configs['basePath'])); |
18 | 18 | $uriArray = explode('/', $uriRequest); |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | $uriLoader = ucfirst(strtolower(str_replace('.', '', $uriLoader))); |
24 | 24 | |
25 | 25 | // if loader of interface is available - require it |
26 | -if (in_array($uriLoader, $loaderList, true) && file_exists(root . '/Loader/' . $uriLoader . '/index.php')) { |
|
27 | - require_once (root . '/Loader/' . $uriLoader . '/index.php'); |
|
26 | +if (in_array($uriLoader, $loaderList, true) && file_exists(root.'/Loader/'.$uriLoader.'/index.php')) { |
|
27 | + require_once (root.'/Loader/'.$uriLoader.'/index.php'); |
|
28 | 28 | } else { // else - try to load default interface |
29 | - require_once (root . '/Loader/Front/index.php'); |
|
29 | + require_once (root.'/Loader/Front/index.php'); |
|
30 | 30 | } |
31 | 31 | \ No newline at end of file |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | die(); |
7 | 7 | } |
8 | 8 | |
9 | -require_once (root . '/Loader/Autoload.php'); |
|
9 | +require_once (root.'/Loader/Autoload.php'); |
|
10 | 10 | |
11 | 11 | class App extends Ffcms\Console\App {} |
12 | 12 | |
@@ -18,5 +18,5 @@ discard block |
||
18 | 18 | // display output |
19 | 19 | echo \App::run(); |
20 | 20 | } catch (Exception $e) { |
21 | - echo $e . "\n"; |
|
21 | + echo $e."\n"; |
|
22 | 22 | } |
23 | 23 | \ No newline at end of file |
@@ -12,7 +12,7 @@ |
||
12 | 12 | // this environment is based on json response type |
13 | 13 | define('env_type', 'json'); |
14 | 14 | |
15 | -require_once(root . '/Loader/Autoload.php'); |
|
15 | +require_once(root.'/Loader/Autoload.php'); |
|
16 | 16 | |
17 | 17 | // make fast-access alias \App::$Object |
18 | 18 | // class_alias('Ffcms\Core\App', 'App'); |
@@ -8,9 +8,9 @@ |
||
8 | 8 | } |
9 | 9 | |
10 | 10 | // load composer packages |
11 | -$loader = require root . '/vendor/autoload.php'; |
|
11 | +$loader = require root.'/vendor/autoload.php'; |
|
12 | 12 | // enable autoload for general namespaces user apps |
13 | 13 | $loader->add('Apps\\', root); |
14 | -$loader->add('Apps\\', root . '/vendor/phpffcms/demo-app-package/src'); // todo: remove me |
|
14 | +$loader->add('Apps\\', root.'/vendor/phpffcms/demo-app-package/src'); // todo: remove me |
|
15 | 15 | $loader->add('Extend\\', root); |
16 | 16 | $loader->add('Widgets\\', root); |