@@ -13,8 +13,8 @@ discard block |
||
13 | 13 | define('INJI_DOMAIN_NAME', $_SERVER['SERVER_NAME']); |
14 | 14 | |
15 | 15 | spl_autoload_register(function($class_name) { |
16 | - if (file_exists(INJI_SYSTEM_DIR . '/Inji/' . $class_name . '.php')) { |
|
17 | - include_once INJI_SYSTEM_DIR . '/Inji/' . $class_name . '.php'; |
|
16 | + if (file_exists(INJI_SYSTEM_DIR.'/Inji/'.$class_name.'.php')) { |
|
17 | + include_once INJI_SYSTEM_DIR.'/Inji/'.$class_name.'.php'; |
|
18 | 18 | } |
19 | 19 | }); |
20 | 20 | |
@@ -49,39 +49,39 @@ discard block |
||
49 | 49 | $params = Tools::uriParse($_SERVER['REQUEST_URI']); |
50 | 50 | |
51 | 51 | App::$cur->type = 'app'; |
52 | -App::$cur->path = INJI_PROGRAM_DIR . '/' . App::$cur->dir; |
|
52 | +App::$cur->path = INJI_PROGRAM_DIR.'/'.App::$cur->dir; |
|
53 | 53 | App::$cur->params = $params; |
54 | 54 | App::$cur->config = Config::app(App::$cur); |
55 | 55 | App::$primary = App::$cur; |
56 | 56 | |
57 | -if (!empty($params[0]) && file_exists(INJI_SYSTEM_DIR . '/program/' . $params[0] . '/')) { |
|
57 | +if (!empty($params[0]) && file_exists(INJI_SYSTEM_DIR.'/program/'.$params[0].'/')) { |
|
58 | 58 | |
59 | 59 | App::$primary->params = []; |
60 | 60 | |
61 | 61 | App::$cur = new App(); |
62 | 62 | App::$cur->name = $params[0]; |
63 | 63 | App::$cur->system = true; |
64 | - App::$cur->staticPath = "/" . App::$cur->name . "/static"; |
|
65 | - App::$cur->templatesPath = "/" . App::$cur->name . "/static/templates"; |
|
66 | - App::$cur->path = INJI_SYSTEM_DIR . '/program/' . App::$cur->name; |
|
67 | - App::$cur->type = 'app' . ucfirst(strtolower(App::$cur->name)); |
|
64 | + App::$cur->staticPath = "/".App::$cur->name."/static"; |
|
65 | + App::$cur->templatesPath = "/".App::$cur->name."/static/templates"; |
|
66 | + App::$cur->path = INJI_SYSTEM_DIR.'/program/'.App::$cur->name; |
|
67 | + App::$cur->type = 'app'.ucfirst(strtolower(App::$cur->name)); |
|
68 | 68 | App::$cur->installed = true; |
69 | 69 | App::$cur->params = array_slice($params, 1); |
70 | 70 | App::$cur->config = Config::app(App::$cur); |
71 | 71 | |
72 | - Inji::$inst->listen('Config-change-app-' . App::$primary->name, 'primaryAppConfig', function($event) { |
|
72 | + Inji::$inst->listen('Config-change-app-'.App::$primary->name, 'primaryAppConfig', function($event) { |
|
73 | 73 | App::$primary->config = $event['eventObject']; |
74 | 74 | }); |
75 | 75 | } |
76 | -Inji::$inst->listen('Config-change-app-' . App::$cur->name, 'curAppConfig', function($event) { |
|
76 | +Inji::$inst->listen('Config-change-app-'.App::$cur->name, 'curAppConfig', function($event) { |
|
77 | 77 | App::$cur->config = $event['eventObject']; |
78 | 78 | }); |
79 | 79 | $shareConfig = Config::share(); |
80 | 80 | if (empty($shareConfig['installed']) && App::$cur->name != 'setup' && (empty(App::$cur->params[0]) || App::$cur->params[0] != 'static')) { |
81 | 81 | Tools::redirect('/setup'); |
82 | 82 | } |
83 | -putenv('COMPOSER_HOME=' . getcwd()); |
|
84 | -putenv('COMPOSER_CACHE_DIR=' . getcwd() . DIRECTORY_SEPARATOR . 'composerCache'); |
|
83 | +putenv('COMPOSER_HOME='.getcwd()); |
|
84 | +putenv('COMPOSER_CACHE_DIR='.getcwd().DIRECTORY_SEPARATOR.'composerCache'); |
|
85 | 85 | ComposerCmd::check(); |
86 | 86 | if (!function_exists('idn_to_utf8')) { |
87 | 87 | ComposerCmd::requirePackage("mabrahamde/idna-converter", "dev-master", './'); |
@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | if (file_exists('vendor/autoload.php')) { |
98 | 98 | include_once 'vendor/autoload.php'; |
99 | 99 | } |
100 | -if (file_exists(App::$primary->path . '/vendor/autoload.php')) { |
|
101 | - include_once App::$primary->path . '/vendor/autoload.php'; |
|
100 | +if (file_exists(App::$primary->path.'/vendor/autoload.php')) { |
|
101 | + include_once App::$primary->path.'/vendor/autoload.php'; |
|
102 | 102 | } |
103 | 103 | Module::$cur = Module::resolveModule(App::$cur); |
104 | 104 |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | ; |
20 | 20 | self::initComposer('./'); |
21 | 21 | } |
22 | - if (!file_exists(App::$primary->path . '/vendor/autoload.php')) { |
|
22 | + if (!file_exists(App::$primary->path.'/vendor/autoload.php')) { |
|
23 | 23 | self::initComposer(); |
24 | 24 | } |
25 | 25 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | if (!file_exists('composer/composer.phar')) { |
32 | 32 | file_put_contents('composer/composerInstall.php', file_get_contents('https://getcomposer.org/installer')); |
33 | 33 | $argv = ['install', '--install-dir', 'composer/']; |
34 | - header("Location: " . filter_input(INPUT_SERVER, 'REQUEST_URI')); |
|
34 | + header("Location: ".filter_input(INPUT_SERVER, 'REQUEST_URI')); |
|
35 | 35 | include_once 'composer/composerInstall.php'; |
36 | 36 | } |
37 | 37 | $composer = new Phar('composer/composer.phar'); |
@@ -42,18 +42,18 @@ discard block |
||
42 | 42 | public static function initComposer($path = '') |
43 | 43 | { |
44 | 44 | if (!$path) { |
45 | - $path = App::$primary->path . '/'; |
|
45 | + $path = App::$primary->path.'/'; |
|
46 | 46 | } |
47 | - if (!file_exists($path . 'composer.json')) { |
|
47 | + if (!file_exists($path.'composer.json')) { |
|
48 | 48 | $json = [ |
49 | - "name" => get_current_user() . "/" . App::$primary->name, |
|
49 | + "name" => get_current_user()."/".App::$primary->name, |
|
50 | 50 | "config" => [ |
51 | 51 | "cache-dir" => "./composerCache/" |
52 | 52 | ], |
53 | 53 | "authors" => [ |
54 | 54 | [ |
55 | 55 | "name" => get_current_user(), |
56 | - "email" => get_current_user() . "@" . INJI_DOMAIN_NAME |
|
56 | + "email" => get_current_user()."@".INJI_DOMAIN_NAME |
|
57 | 57 | ] |
58 | 58 | ], |
59 | 59 | "require" => [ |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | ] |
62 | 62 | ]; |
63 | 63 | Tools::createDir($path); |
64 | - file_put_contents($path . 'composer.json', json_encode($json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); |
|
64 | + file_put_contents($path.'composer.json', json_encode($json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); |
|
65 | 65 | } |
66 | 66 | self::command('install', false, $path); |
67 | 67 | } |
@@ -74,8 +74,8 @@ discard block |
||
74 | 74 | } else { |
75 | 75 | $output = null; |
76 | 76 | } |
77 | - $path = str_replace('\\', '/', $path === null ? App::$primary->path . '/' : $path); |
|
78 | - $input = new Symfony\Component\Console\Input\StringInput($command . ' -d ' . $path); |
|
77 | + $path = str_replace('\\', '/', $path === null ? App::$primary->path.'/' : $path); |
|
78 | + $input = new Symfony\Component\Console\Input\StringInput($command.' -d '.$path); |
|
79 | 79 | $app = new Composer\Console\Application(); |
80 | 80 | $app->setAutoExit(false); |
81 | 81 | $dir = getcwd(); |
@@ -86,10 +86,10 @@ discard block |
||
86 | 86 | public static function requirePackage($packageName, $version = '', $path = '') |
87 | 87 | { |
88 | 88 | if (!$path) { |
89 | - $path = App::$primary->path . '/'; |
|
89 | + $path = App::$primary->path.'/'; |
|
90 | 90 | } |
91 | - if (file_exists($path . 'composer.lock')) { |
|
92 | - $lockFile = json_decode(file_get_contents($path . 'composer.lock'), true); |
|
91 | + if (file_exists($path.'composer.lock')) { |
|
92 | + $lockFile = json_decode(file_get_contents($path.'composer.lock'), true); |
|
93 | 93 | } |
94 | 94 | if (!empty($lockFile['packages'])) { |
95 | 95 | foreach ($lockFile['packages'] as $package) { |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | } |
100 | 100 | } |
101 | 101 | |
102 | - ComposerCmd::command('require ' . $packageName . ($version ? ':' . $version : ''), false, $path); |
|
102 | + ComposerCmd::command('require '.$packageName.($version ? ':'.$version : ''), false, $path); |
|
103 | 103 | return true; |
104 | 104 | } |
105 | 105 |
@@ -39,7 +39,7 @@ |
||
39 | 39 | $options['pos'] = $resizePos; |
40 | 40 | $path = Cache::file($absolutePath, $options); |
41 | 41 | $path = $convet ? mb_convert_encoding($path, 'UTF-8', 'Windows-1251') : $path; |
42 | - return '/' . $path; |
|
42 | + return '/'.$path; |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 |
@@ -49,11 +49,11 @@ discard block |
||
49 | 49 | $classPath = implode('/', array_slice($classPath, 1)); |
50 | 50 | if (App::$cur) { |
51 | 51 | if (App::$cur !== App::$primary) { |
52 | - $folders['appModule'] = ['folder' => App::$primary->path . '/modules/' . $moduleName, 'classPath' => $classPath]; |
|
52 | + $folders['appModule'] = ['folder' => App::$primary->path.'/modules/'.$moduleName, 'classPath' => $classPath]; |
|
53 | 53 | } |
54 | - $folders['primaryAppModule'] = ['folder' => App::$cur->path . '/modules/' . $moduleName, 'classPath' => $classPath]; |
|
54 | + $folders['primaryAppModule'] = ['folder' => App::$cur->path.'/modules/'.$moduleName, 'classPath' => $classPath]; |
|
55 | 55 | } |
56 | - $folders['systemModule'] = ['folder' => INJI_SYSTEM_DIR . '/modules/' . $moduleName, 'classPath' => $classPath]; |
|
56 | + $folders['systemModule'] = ['folder' => INJI_SYSTEM_DIR.'/modules/'.$moduleName, 'classPath' => $classPath]; |
|
57 | 57 | } |
58 | 58 | } |
59 | 59 | $classPath = str_replace('\\', '/', $className); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | if (file_exists($path)) { |
74 | 74 | include_once $path; |
75 | 75 | if (in_array('Model', class_parents($className, false)) && \App::$primary) { |
76 | - $filename = Cache::getDir('system') . '/classData.php'; |
|
76 | + $filename = Cache::getDir('system').'/classData.php'; |
|
77 | 77 | $classData = Config::custom($filename); |
78 | 78 | if (empty($classData['Model'][$className]['tableCreated'])) { |
79 | 79 | $classData['Model'][$className]['tableCreated'] = $className::createTable(); |
@@ -98,18 +98,18 @@ discard block |
||
98 | 98 | { |
99 | 99 | $paths = []; |
100 | 100 | if (strpos($classPath, '/') === false) { |
101 | - $paths[$code . '_Object'] = $folder . '/objects/' . $classPath . '.php'; |
|
102 | - $paths[$code . '_ObjectDir'] = $folder . '/objects/' . $classPath . '/' . $classPath . '.php'; |
|
103 | - $paths[$code . '_Model'] = $folder . '/models/' . $classPath . '.php'; |
|
104 | - $paths[$code . '_ModelDir'] = $folder . '/models/' . $classPath . '/' . $classPath . '.php'; |
|
101 | + $paths[$code.'_Object'] = $folder.'/objects/'.$classPath.'.php'; |
|
102 | + $paths[$code.'_ObjectDir'] = $folder.'/objects/'.$classPath.'/'.$classPath.'.php'; |
|
103 | + $paths[$code.'_Model'] = $folder.'/models/'.$classPath.'.php'; |
|
104 | + $paths[$code.'_ModelDir'] = $folder.'/models/'.$classPath.'/'.$classPath.'.php'; |
|
105 | 105 | } else { |
106 | 106 | $classFile = substr($classPath, strrpos($classPath, '/') + 1); |
107 | 107 | $classPathWithotClass = substr($classPath, 0, strrpos($classPath, '/')); |
108 | 108 | |
109 | - $paths[$code . '_Object'] = $folder . '/objects/' . $classPathWithotClass . '/' . $classFile . '.php'; |
|
110 | - $paths[$code . '_ObjectDir'] = $folder . '/objects/' . $classPath . '/' . $classFile . '.php'; |
|
111 | - $paths[$code . '_Model'] = $folder . '/models/' . $classPathWithotClass . '/' . $classFile . '.php'; |
|
112 | - $paths[$code . '_ModelDir'] = $folder . '/models/' . $classPath . '/' . $classFile . '.php'; |
|
109 | + $paths[$code.'_Object'] = $folder.'/objects/'.$classPathWithotClass.'/'.$classFile.'.php'; |
|
110 | + $paths[$code.'_ObjectDir'] = $folder.'/objects/'.$classPath.'/'.$classFile.'.php'; |
|
111 | + $paths[$code.'_Model'] = $folder.'/models/'.$classPathWithotClass.'/'.$classFile.'.php'; |
|
112 | + $paths[$code.'_ModelDir'] = $folder.'/models/'.$classPath.'/'.$classFile.'.php'; |
|
113 | 113 | } |
114 | 114 | return $paths; |
115 | 115 | } |
@@ -64,17 +64,17 @@ |
||
64 | 64 | */ |
65 | 65 | public function run() |
66 | 66 | { |
67 | - if (!empty($this->params[0]) && method_exists($this, $this->params[0] . 'Action')) { |
|
67 | + if (!empty($this->params[0]) && method_exists($this, $this->params[0].'Action')) { |
|
68 | 68 | $this->method = $this->params[0]; |
69 | 69 | $this->params = array_slice($this->params, 1); |
70 | - } elseif (!method_exists($this, $this->method . 'Action')) { |
|
70 | + } elseif (!method_exists($this, $this->method.'Action')) { |
|
71 | 71 | INJI_SYSTEM_ERROR('method not found', true); |
72 | 72 | } |
73 | 73 | if (!$this->checkAccess()) { |
74 | 74 | Tools::redirect($this->access->getDeniedRedirect(), 'У вас нет прав доступа'); |
75 | 75 | } |
76 | 76 | $this->run = true; |
77 | - call_user_func_array([$this, $this->method . 'Action'], $this->params); |
|
77 | + call_user_func_array([$this, $this->method.'Action'], $this->params); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | /** |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $this->info = $this->getInfo(); |
73 | 73 | $this->config = Config::module($this->moduleName, !empty($this->info['systemConfig'])); |
74 | 74 | $that = $this; |
75 | - Inji::$inst->listen('Config-change-module-' . $this->app->name . '-' . $this->moduleName, $this->app->name . '-' . $this->moduleName . 'config', function($event) use ($that) { |
|
75 | + Inji::$inst->listen('Config-change-module-'.$this->app->name.'-'.$this->moduleName, $this->app->name.'-'.$this->moduleName.'config', function($event) use ($that) { |
|
76 | 76 | $that->config = $event['eventObject']; |
77 | 77 | }); |
78 | 78 | } |
@@ -88,10 +88,10 @@ discard block |
||
88 | 88 | $moduleName = ucfirst($moduleName); |
89 | 89 | $paths = []; |
90 | 90 | if (App::$cur !== App::$primary) { |
91 | - $paths['primaryAppPath'] = App::$primary->path . '/modules/' . $moduleName; |
|
91 | + $paths['primaryAppPath'] = App::$primary->path.'/modules/'.$moduleName; |
|
92 | 92 | } |
93 | - $paths['curAppPath'] = App::$cur->path . '/modules/' . $moduleName; |
|
94 | - $paths['systemPath'] = INJI_SYSTEM_DIR . '/modules/' . $moduleName; |
|
93 | + $paths['curAppPath'] = App::$cur->path.'/modules/'.$moduleName; |
|
94 | + $paths['systemPath'] = INJI_SYSTEM_DIR.'/modules/'.$moduleName; |
|
95 | 95 | return $paths; |
96 | 96 | } |
97 | 97 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $moduleName = ucfirst($moduleName); |
107 | 107 | $paths = Module::getModulePaths($moduleName); |
108 | 108 | foreach ($paths as $path) { |
109 | - if (file_exists($path . '/' . $moduleName . '.php')) { |
|
109 | + if (file_exists($path.'/'.$moduleName.'.php')) { |
|
110 | 110 | return $path; |
111 | 111 | } |
112 | 112 | } |
@@ -183,31 +183,31 @@ discard block |
||
183 | 183 | $paths = []; |
184 | 184 | if (App::$cur != App::$primary) { |
185 | 185 | if (!empty($this->params[0]) && strtolower($this->params[0]) != strtolower($this->moduleName)) { |
186 | - $paths['primaryAppAppTypePath_slice'] = App::$primary->path . '/modules/' . $this->moduleName . '/' . $this->app->type . 'Controllers/' . ucfirst($this->params[0]) . 'Controller.php'; |
|
186 | + $paths['primaryAppAppTypePath_slice'] = App::$primary->path.'/modules/'.$this->moduleName.'/'.$this->app->type.'Controllers/'.ucfirst($this->params[0]).'Controller.php'; |
|
187 | 187 | if (App::$primary->{$this->moduleName}) { |
188 | - $paths['primaryAppAppTypePath_slice'] = App::$primary->{$this->moduleName}->path . '/' . $this->app->type . 'Controllers/' . ucfirst($this->params[0]) . 'Controller.php'; |
|
188 | + $paths['primaryAppAppTypePath_slice'] = App::$primary->{$this->moduleName}->path.'/'.$this->app->type.'Controllers/'.ucfirst($this->params[0]).'Controller.php'; |
|
189 | 189 | } |
190 | 190 | } |
191 | - $paths['primaryAppAppAppTypePath'] = App::$primary->path . '/modules/' . $this->moduleName . '/' . $this->app->type . 'Controllers/' . $this->moduleName . 'Controller.php'; |
|
191 | + $paths['primaryAppAppAppTypePath'] = App::$primary->path.'/modules/'.$this->moduleName.'/'.$this->app->type.'Controllers/'.$this->moduleName.'Controller.php'; |
|
192 | 192 | if (App::$primary->{$this->moduleName}) { |
193 | - $paths['primaryAppAppTypePath'] = App::$primary->{$this->moduleName}->path . '/' . $this->app->type . 'Controllers/' . $this->moduleName . 'Controller.php'; |
|
193 | + $paths['primaryAppAppTypePath'] = App::$primary->{$this->moduleName}->path.'/'.$this->app->type.'Controllers/'.$this->moduleName.'Controller.php'; |
|
194 | 194 | } |
195 | - $paths['curAppAppTypePath'] = $this->app->{$this->moduleName}->path . '/' . $this->app->type . 'Controllers/' . $this->moduleName . 'Controller.php'; |
|
195 | + $paths['curAppAppTypePath'] = $this->app->{$this->moduleName}->path.'/'.$this->app->type.'Controllers/'.$this->moduleName.'Controller.php'; |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | if (!empty($this->params[0]) && strtolower($this->params[0]) != strtolower($this->moduleName)) { |
199 | - $paths['appAppTypePath_slice'] = $this->app->path . '/modules/' . $this->moduleName . '/' . $this->app->type . 'Controllers/' . ucfirst($this->params[0]) . 'Controller.php'; |
|
200 | - $paths['appTypePath_slice'] = $this->path . '/' . $this->app->type . 'Controllers/' . ucfirst($this->params[0]) . 'Controller.php'; |
|
199 | + $paths['appAppTypePath_slice'] = $this->app->path.'/modules/'.$this->moduleName.'/'.$this->app->type.'Controllers/'.ucfirst($this->params[0]).'Controller.php'; |
|
200 | + $paths['appTypePath_slice'] = $this->path.'/'.$this->app->type.'Controllers/'.ucfirst($this->params[0]).'Controller.php'; |
|
201 | 201 | } |
202 | - $paths['appAppTypePath'] = $this->app->path . '/modules/' . $this->moduleName . '/' . $this->app->type . 'Controllers/' . $this->moduleName . 'Controller.php'; |
|
203 | - $paths['appTypePath'] = $this->path . '/' . $this->app->type . 'Controllers/' . $this->moduleName . 'Controller.php'; |
|
202 | + $paths['appAppTypePath'] = $this->app->path.'/modules/'.$this->moduleName.'/'.$this->app->type.'Controllers/'.$this->moduleName.'Controller.php'; |
|
203 | + $paths['appTypePath'] = $this->path.'/'.$this->app->type.'Controllers/'.$this->moduleName.'Controller.php'; |
|
204 | 204 | |
205 | 205 | if (!empty($this->params[0]) && strtolower($this->params[0]) != strtolower($this->moduleName)) { |
206 | - $paths['appUniversalPath_slice'] = $this->app->path . '/modules/' . $this->moduleName . '/Controllers/' . ucfirst($this->params[0]) . 'Controller.php'; |
|
207 | - $paths['universalPath_slice'] = $this->path . '/Controllers/' . ucfirst($this->params[0]) . 'Controller.php'; |
|
206 | + $paths['appUniversalPath_slice'] = $this->app->path.'/modules/'.$this->moduleName.'/Controllers/'.ucfirst($this->params[0]).'Controller.php'; |
|
207 | + $paths['universalPath_slice'] = $this->path.'/Controllers/'.ucfirst($this->params[0]).'Controller.php'; |
|
208 | 208 | } |
209 | - $paths['appUniversalPath'] = $this->app->path . '/modules/' . $this->moduleName . '/Controllers/' . $this->moduleName . 'Controller.php'; |
|
210 | - $paths['universalPath'] = $this->path . '/Controllers/' . $this->moduleName . 'Controller.php'; |
|
209 | + $paths['appUniversalPath'] = $this->app->path.'/modules/'.$this->moduleName.'/Controllers/'.$this->moduleName.'Controller.php'; |
|
210 | + $paths['universalPath'] = $this->path.'/Controllers/'.$this->moduleName.'Controller.php'; |
|
211 | 211 | |
212 | 212 | return $paths; |
213 | 213 | } |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | $controllerName = $this->moduleName; |
231 | 231 | $params = $this->params; |
232 | 232 | } |
233 | - $fullControllerName = $controllerName . 'Controller'; |
|
233 | + $fullControllerName = $controllerName.'Controller'; |
|
234 | 234 | $controller = new $fullControllerName(); |
235 | 235 | $controller->params = $params; |
236 | 236 | $controller->module = $this; |
@@ -256,8 +256,8 @@ discard block |
||
256 | 256 | } |
257 | 257 | $paths = Module::getModulePaths($moduleName); |
258 | 258 | foreach ($paths as $path) { |
259 | - if (file_exists($path . '/info.php')) { |
|
260 | - return include $path . '/info.php'; |
|
259 | + if (file_exists($path.'/info.php')) { |
|
260 | + return include $path.'/info.php'; |
|
261 | 261 | } |
262 | 262 | } |
263 | 263 | return []; |
@@ -276,16 +276,16 @@ discard block |
||
276 | 276 | { |
277 | 277 | $moduleName = $moduleName ? $moduleName : $this->moduleName; |
278 | 278 | $modulePaths = Module::getModulePaths($moduleName); |
279 | - $modulePaths['templatePath'] = App::$cur->view->template->path . '/modules/' . ucfirst($moduleName); |
|
279 | + $modulePaths['templatePath'] = App::$cur->view->template->path.'/modules/'.ucfirst($moduleName); |
|
280 | 280 | $snippets = []; |
281 | 281 | foreach ($modulePaths as $path) { |
282 | - if (file_exists($path . $dir . '/' . $snippetsPath)) { |
|
283 | - $snippetsPaths = array_slice(scandir($path . $dir . '/' . $snippetsPath), 2); |
|
282 | + if (file_exists($path.$dir.'/'.$snippetsPath)) { |
|
283 | + $snippetsPaths = array_slice(scandir($path.$dir.'/'.$snippetsPath), 2); |
|
284 | 284 | foreach ($snippetsPaths as $snippetPath) { |
285 | - if (is_dir($path . $dir . '/' . $snippetsPath . '/' . $snippetPath)) { |
|
286 | - $snippets[$snippetPath] = include $path . $dir . '/' . $snippetsPath . '/' . $snippetPath . '/info.php'; |
|
285 | + if (is_dir($path.$dir.'/'.$snippetsPath.'/'.$snippetPath)) { |
|
286 | + $snippets[$snippetPath] = include $path.$dir.'/'.$snippetsPath.'/'.$snippetPath.'/info.php'; |
|
287 | 287 | } else { |
288 | - $snippets[pathinfo($snippetPath, PATHINFO_FILENAME)] = include $path . $dir . '/' . $snippetsPath . '/' . $snippetPath; |
|
288 | + $snippets[pathinfo($snippetPath, PATHINFO_FILENAME)] = include $path.$dir.'/'.$snippetsPath.'/'.$snippetPath; |
|
289 | 289 | } |
290 | 290 | } |
291 | 291 | } |
@@ -307,9 +307,9 @@ discard block |
||
307 | 307 | { |
308 | 308 | $extensions = []; |
309 | 309 | $modules = Module::getInstalled(App::$cur); |
310 | - $method = 'get' . ucfirst($extensionType); |
|
310 | + $method = 'get'.ucfirst($extensionType); |
|
311 | 311 | foreach ($modules as $module) { |
312 | - $extensions = array_merge($extensions, $this->{$method}($request, false, "/extensions/{$this->moduleName}/" . $extensionType, $module)); |
|
312 | + $extensions = array_merge($extensions, $this->{$method}($request, false, "/extensions/{$this->moduleName}/".$extensionType, $module)); |
|
313 | 313 | } |
314 | 314 | return $extensions; |
315 | 315 | } |
@@ -83,22 +83,22 @@ |
||
83 | 83 | $log['end'] = microtime(true); |
84 | 84 | if (empty($log['start'])) |
85 | 85 | $log['start'] = microtime(true); |
86 | - echo "<tr><td>{$log['name']}</td><td" . (round(($log['end'] - $log['start']), 5) > 0.1 ? ' class ="danger"' : '') . ">" . round(($log['end'] - $log['start']), 5) . "</td></tr>"; |
|
86 | + echo "<tr><td>{$log['name']}</td><td".(round(($log['end'] - $log['start']), 5) > 0.1 ? ' class ="danger"' : '').">".round(($log['end'] - $log['start']), 5)."</td></tr>"; |
|
87 | 87 | } |
88 | 88 | } |
89 | - echo '<tr><th>Summary</th><th>' . round(( microtime(true) - $this->startTime), 5) . '</th></tr>'; |
|
90 | - echo '<tr><th>Memory</th><th>' . $this->convertSize(memory_get_peak_usage()) . ' of ' . ini_get('memory_limit') . '</th></tr></table></div>'; |
|
89 | + echo '<tr><th>Summary</th><th>'.round((microtime(true) - $this->startTime), 5).'</th></tr>'; |
|
90 | + echo '<tr><th>Memory</th><th>'.$this->convertSize(memory_get_peak_usage()).' of '.ini_get('memory_limit').'</th></tr></table></div>'; |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | public function convertSize($size) |
94 | 94 | { |
95 | 95 | |
96 | 96 | if ($size < 1024) |
97 | - return $size . "B"; |
|
97 | + return $size."B"; |
|
98 | 98 | elseif ($size < 1048576) |
99 | - return round($size / 1024, 2) . "KB"; |
|
99 | + return round($size / 1024, 2)."KB"; |
|
100 | 100 | else |
101 | - return round($size / 1048576, 2) . "MB"; |
|
101 | + return round($size / 1048576, 2)."MB"; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | public function __destruct() |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | } |
65 | 65 | return false; |
66 | 66 | } |
67 | - $val = @self::$server->get($name . serialize($params)); |
|
67 | + $val = @self::$server->get($name.serialize($params)); |
|
68 | 68 | if ($val !== false) { |
69 | 69 | return $val; |
70 | 70 | } else { |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | self::connect(); |
93 | 93 | } |
94 | 94 | if (self::$connected) { |
95 | - return @self::$server->set($name . serialize($params), $val, false, $lifeTime); |
|
95 | + return @self::$server->set($name.serialize($params), $val, false, $lifeTime); |
|
96 | 96 | } |
97 | 97 | return false; |
98 | 98 | } |
@@ -112,12 +112,12 @@ discard block |
||
112 | 112 | $crop = !empty($options['crop']) ? $options['crop'] : ''; |
113 | 113 | $pos = !empty($options['pos']) ? $options['pos'] : 'center'; |
114 | 114 | $fileinfo = pathinfo($file); |
115 | - $fileCheckSum = md5($fileinfo['dirname'] . filemtime($file)); |
|
116 | - $path = static::getDir('static') . '/' . $fileCheckSum . '_' . $fileinfo['filename']; |
|
115 | + $fileCheckSum = md5($fileinfo['dirname'].filemtime($file)); |
|
116 | + $path = static::getDir('static').'/'.$fileCheckSum.'_'.$fileinfo['filename']; |
|
117 | 117 | if ($sizes) { |
118 | - $path .= '.' . $sizes['x'] . 'x' . $sizes['y'] . $crop . $pos; |
|
118 | + $path .= '.'.$sizes['x'].'x'.$sizes['y'].$crop.$pos; |
|
119 | 119 | } |
120 | - $path .= '.' . $fileinfo['extension']; |
|
120 | + $path .= '.'.$fileinfo['extension']; |
|
121 | 121 | if (!file_exists($path)) { |
122 | 122 | copy($file, $path); |
123 | 123 | if ($sizes) { |
@@ -71,8 +71,8 @@ |
||
71 | 71 | { |
72 | 72 | $paths = Module::getModulePaths($moduleName); |
73 | 73 | foreach ($paths as $path) { |
74 | - if (file_exists($path . '/' . $moduleName . '.php')) { |
|
75 | - include_once $path . '/' . $moduleName . '.php'; |
|
74 | + if (file_exists($path.'/'.$moduleName.'.php')) { |
|
75 | + include_once $path.'/'.$moduleName.'.php'; |
|
76 | 76 | return $moduleName; |
77 | 77 | } |
78 | 78 | } |