@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | $objectTemplate = null; |
30 | 30 | |
31 | 31 | if ($singleName) { |
32 | - $objectDirPath = root . '/Apps/' . $type . '/'; |
|
33 | - $objectNamespace = 'Apps\\' . $type; |
|
32 | + $objectDirPath = root.'/Apps/'.$type.'/'; |
|
33 | + $objectNamespace = 'Apps\\'.$type; |
|
34 | 34 | $objectName = ucfirst($name); |
35 | 35 | } else { |
36 | 36 | $split = explode('/', $name); |
@@ -47,46 +47,46 @@ discard block |
||
47 | 47 | } |
48 | 48 | |
49 | 49 | if ($type === 'Widget') { |
50 | - $objectDirPath = root . '/Widgets/' . $workground; |
|
51 | - $objectNamespace = 'Widgets\\' . $workground; |
|
50 | + $objectDirPath = root.'/Widgets/'.$workground; |
|
51 | + $objectNamespace = 'Widgets\\'.$workground; |
|
52 | 52 | } else { |
53 | - $objectDirPath = root . '/Apps/' . $type . '/' . $workground; |
|
54 | - $objectNamespace = 'Apps\\' . $type . '\\' . $workground; |
|
53 | + $objectDirPath = root.'/Apps/'.$type.'/'.$workground; |
|
54 | + $objectNamespace = 'Apps\\'.$type.'\\'.$workground; |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | if (false !== $subName) { |
58 | - $objectDirPath .= '/' . implode('/', $subName); |
|
59 | - $objectNamespace .= '\\' . implode('\\', $subName); |
|
58 | + $objectDirPath .= '/'.implode('/', $subName); |
|
59 | + $objectNamespace .= '\\'.implode('\\', $subName); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | |
63 | 63 | // try to find workground-based controller |
64 | - if (File::exist('/Private/Carcase/' . $workground . '/' . $type . '.tphp')) { |
|
65 | - $objectTemplate = File::read('/Private/Carcase/' . $workground . '/' . $type . '.tphp'); |
|
64 | + if (File::exist('/Private/Carcase/'.$workground.'/'.$type.'.tphp')) { |
|
65 | + $objectTemplate = File::read('/Private/Carcase/'.$workground.'/'.$type.'.tphp'); |
|
66 | 66 | } |
67 | 67 | } |
68 | 68 | |
69 | 69 | if (!Directory::exist($objectDirPath) && !Directory::create($objectDirPath)) { |
70 | - $this->message = 'Directory could not be created: ' . $objectDirPath; |
|
70 | + $this->message = 'Directory could not be created: '.$objectDirPath; |
|
71 | 71 | return false; |
72 | 72 | } |
73 | 73 | |
74 | 74 | if ($objectTemplate === null) { |
75 | - $objectTemplate = File::read('/Private/Carcase/' . $type . '.tphp'); |
|
75 | + $objectTemplate = File::read('/Private/Carcase/'.$type.'.tphp'); |
|
76 | 76 | if (false === $objectTemplate) { |
77 | - $this->message = 'Php template file is not founded: /Private/Carcase/' . $type . '.tphp'; |
|
77 | + $this->message = 'Php template file is not founded: /Private/Carcase/'.$type.'.tphp'; |
|
78 | 78 | return false; |
79 | 79 | } |
80 | 80 | } |
81 | 81 | |
82 | 82 | $objectContent = Str::replace(['%namespace%', '%name%'], [$objectNamespace, $objectName], $objectTemplate); |
83 | - $objectFullPath = $objectDirPath . '/' . $objectName . '.php'; |
|
83 | + $objectFullPath = $objectDirPath.'/'.$objectName.'.php'; |
|
84 | 84 | if (File::exist($objectFullPath)) { |
85 | - $this->message = $type . ' is always exist: ' . $objectFullPath; |
|
85 | + $this->message = $type.' is always exist: '.$objectFullPath; |
|
86 | 86 | return false; |
87 | 87 | } |
88 | 88 | File::write($objectFullPath, $objectContent); |
89 | - $this->message = $type . ' template was created: [' . $objectName . '] in path: ' . Str::replace(root, '', $objectDirPath); |
|
89 | + $this->message = $type.' template was created: ['.$objectName.'] in path: '.Str::replace(root, '', $objectDirPath); |
|
90 | 90 | return true; |
91 | 91 | } |
92 | 92 | } |
93 | 93 | \ No newline at end of file |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $this->beginTime = time(); |
34 | 34 | |
35 | 35 | $this->signatures = new \DOMDocument(); |
36 | - $this->signatures->load(root . '/Private/Antivirus/Signatures.xml'); |
|
36 | + $this->signatures->load(root.'/Private/Antivirus/Signatures.xml'); |
|
37 | 37 | |
38 | 38 | // list of files is not prepared, 1st iteration |
39 | 39 | if (!File::exist('/Private/Antivirus/ScanFiles.json')) { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | $this->scanFiles = json_decode(File::read('/Private/Antivirus/ScanFiles.json')); |
48 | 48 | if (File::exist('/Private/Antivirus/Infected.json')) { |
49 | - $this->infected = (array)json_decode(File::read('/Private/Antivirus/Infected.json')); |
|
49 | + $this->infected = (array) json_decode(File::read('/Private/Antivirus/Infected.json')); |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
@@ -108,13 +108,13 @@ discard block |
||
108 | 108 | |
109 | 109 | switch ($attrFormat) { |
110 | 110 | case 're': |
111 | - if ((preg_match('#(' . $sigContent . ')#smi', $content, $found, PREG_OFFSET_CAPTURE)) || |
|
112 | - (preg_match('#(' . $sigContent . ')#smi', $normalized, $found, PREG_OFFSET_CAPTURE)) |
|
111 | + if ((preg_match('#('.$sigContent.')#smi', $content, $found, PREG_OFFSET_CAPTURE)) || |
|
112 | + (preg_match('#('.$sigContent.')#smi', $normalized, $found, PREG_OFFSET_CAPTURE)) |
|
113 | 113 | ) { |
114 | 114 | $detected = true; |
115 | 115 | $pos = $found[0][1]; |
116 | 116 | $this->infected[$path][] = [ |
117 | - 'pos' => (int)$pos, |
|
117 | + 'pos' => (int) $pos, |
|
118 | 118 | 'sigId' => $attrId, |
119 | 119 | 'sigRule' => $sigContent, |
120 | 120 | 'sever' => $attrSever, |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | (($pos = strpos($normalized, $sigContent)) !== false) |
129 | 129 | ) { |
130 | 130 | $this->infected[$path][] = [ |
131 | - 'pos' => (int)$pos, |
|
131 | + 'pos' => (int) $pos, |
|
132 | 132 | 'sigId' => $attrId, |
133 | 133 | 'sigRule' => $sigContent, |
134 | 134 | 'sever' => $attrSever, |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | */ |
149 | 149 | private function prepareScanlist() |
150 | 150 | { |
151 | - $files = (object)File::listFiles(root, $this->affectedExt); |
|
151 | + $files = (object) File::listFiles(root, $this->affectedExt); |
|
152 | 152 | File::write('/Private/Antivirus/ScanFiles.json', json_encode($files)); |
153 | 153 | } |
154 | 154 |
@@ -71,14 +71,14 @@ |
||
71 | 71 | $cfg['database'] = $this->db; |
72 | 72 | $cfg['adminEmail'] = $this->email; |
73 | 73 | $cfg['singleLanguage'] = $this->singleLanguage; |
74 | - $cfg['multiLanguage'] = (bool)$this->multiLanguage; |
|
75 | - $cfg['passwordSalt'] = '$2a$07$' . Str::randomLatinNumeric(mt_rand(21, 30)) . '$'; |
|
76 | - $cfg['debug']['cookie']['key'] = 'fdebug_' . Str::randomLatinNumeric(mt_rand(4, 16)); |
|
74 | + $cfg['multiLanguage'] = (bool) $this->multiLanguage; |
|
75 | + $cfg['passwordSalt'] = '$2a$07$'.Str::randomLatinNumeric(mt_rand(21, 30)).'$'; |
|
76 | + $cfg['debug']['cookie']['key'] = 'fdebug_'.Str::randomLatinNumeric(mt_rand(4, 16)); |
|
77 | 77 | $cfg['debug']['cookie']['value'] = Str::randomLatinNumeric(mt_rand(32, 128)); |
78 | 78 | |
79 | 79 | // import database tables |
80 | 80 | $connectName = 'install'; |
81 | - include(root . '/Private/Database/install.php'); |
|
81 | + include(root.'/Private/Database/install.php'); |
|
82 | 82 | |
83 | 83 | // insert admin user |
84 | 84 | $user = new User(); |
@@ -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 |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | // check in cache |
49 | - if (MainApp::$Memory->get('profile.object.cache.' . $user_id) !== null) { |
|
50 | - return MainApp::$Memory->get('profile.object.cache.' . $user_id); |
|
49 | + if (MainApp::$Memory->get('profile.object.cache.'.$user_id) !== null) { |
|
50 | + return MainApp::$Memory->get('profile.object.cache.'.$user_id); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | // find row |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | $object = $profile->first(); |
62 | 62 | |
63 | - MainApp::$Memory->set('profile.object.cache.' . $user_id, $object); |
|
63 | + MainApp::$Memory->set('profile.object.cache.'.$user_id, $object); |
|
64 | 64 | return $object; |
65 | 65 | } |
66 | 66 | |
@@ -71,17 +71,17 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function getAvatarUrl($type = 'small') |
73 | 73 | { |
74 | - $default = '/upload/user/avatar/' . $type . '/default.jpg'; |
|
74 | + $default = '/upload/user/avatar/'.$type.'/default.jpg'; |
|
75 | 75 | if (!Arr::in($type, ['small', 'big', 'medium'])) { |
76 | - return MainApp::$Alias->scriptUrl . $default; |
|
76 | + return MainApp::$Alias->scriptUrl.$default; |
|
77 | 77 | } |
78 | 78 | |
79 | - $route = '/upload/user/avatar/' . $type . '/' . $this->user_id . '.jpg'; |
|
79 | + $route = '/upload/user/avatar/'.$type.'/'.$this->user_id.'.jpg'; |
|
80 | 80 | if (File::exist($route)) { |
81 | - return MainApp::$Alias->scriptUrl . $route . '?mtime=' . File::mTime($route); |
|
81 | + return MainApp::$Alias->scriptUrl.$route.'?mtime='.File::mTime($route); |
|
82 | 82 | } |
83 | 83 | |
84 | - return MainApp::$Alias->scriptUrl . $default; |
|
84 | + return MainApp::$Alias->scriptUrl.$default; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | { |
93 | 93 | $userNick = $this->nick; |
94 | 94 | if ($userNick === null || Str::likeEmpty($userNick)) { |
95 | - $userNick = 'id' . $this->id; |
|
95 | + $userNick = 'id'.$this->id; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | return $userNick; |
@@ -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; |
@@ -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 |
@@ -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'); |