@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -return function ($step = NULL, $params = []) { |
|
| 3 | +return function($step = NULL, $params = []) { |
|
| 4 | 4 | |
| 5 | 5 | $groups = [ |
| 6 | 6 | [ |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -return function ($step = NULL, $params = []) { |
|
| 3 | +return function($step = NULL, $params = []) { |
|
| 4 | 4 | |
| 5 | 5 | $groups = [ |
| 6 | 6 | [ |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -return function ($step = NULL, $params = []) { |
|
| 3 | +return function($step = NULL, $params = []) { |
|
| 4 | 4 | |
| 5 | 5 | $groups = [ |
| 6 | 6 | [ |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -return function ($step = NULL, $params = []) { |
|
| 3 | +return function($step = NULL, $params = []) { |
|
| 4 | 4 | |
| 5 | 5 | $groups = [ |
| 6 | 6 | [ |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -return function ($step = NULL, $params = []) { |
|
| 3 | +return function($step = NULL, $params = []) { |
|
| 4 | 4 | |
| 5 | 5 | $groups = [ |
| 6 | 6 | [ |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -return function ($step = NULL, $params = []) { |
|
| 3 | +return function($step = NULL, $params = []) { |
|
| 4 | 4 | |
| 5 | 5 | $groups = [ |
| 6 | 6 | [ |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -return function ($step = NULL, $params = []) { |
|
| 3 | +return function($step = NULL, $params = []) { |
|
| 4 | 4 | |
| 5 | 5 | $groups = [ |
| 6 | 6 | [ |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -return function ($step = NULL, $params = []) { |
|
| 3 | +return function($step = NULL, $params = []) { |
|
| 4 | 4 | |
| 5 | 5 | $groups = [ |
| 6 | 6 | [ |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | * Get all posible directorys for module files |
| 82 | 82 | * |
| 83 | 83 | * @param string $moduleName |
| 84 | - * @return array |
|
| 84 | + * @return string |
|
| 85 | 85 | */ |
| 86 | 86 | public static function getModulePaths($moduleName) |
| 87 | 87 | { |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | * Get installed modules for app |
| 132 | 132 | * |
| 133 | 133 | * @param \App $app |
| 134 | - * @param boolean|\App $primary |
|
| 134 | + * @param App $primary |
|
| 135 | 135 | * @return array |
| 136 | 136 | */ |
| 137 | 137 | public static function getInstalled($app, $primary = false) |
@@ -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 | } |
@@ -159,12 +159,12 @@ discard block |
||
| 159 | 159 | foreach ($moduleDirs as $moduleDir) { |
| 160 | 160 | if (is_dir($moduleDir)) { |
| 161 | 161 | foreach (scandir($moduleDir) as $dir) { |
| 162 | - if (preg_match('!Controllers$!', $dir) && is_dir($moduleDir . '/' . $dir)) { |
|
| 163 | - $path = $moduleDir . '/' . $dir; |
|
| 162 | + if (preg_match('!Controllers$!', $dir) && is_dir($moduleDir.'/'.$dir)) { |
|
| 163 | + $path = $moduleDir.'/'.$dir; |
|
| 164 | 164 | foreach (scandir($path) as $file) { |
| 165 | - if (preg_match('!Controller\.php$!', $file) && is_file($path . '/' . $file)) { |
|
| 165 | + if (preg_match('!Controller\.php$!', $file) && is_file($path.'/'.$file)) { |
|
| 166 | 166 | $controllerName = preg_replace('!Controller\.php$!', '', $file); |
| 167 | - $controllers[preg_replace('!Controllers$!', '', $dir)][$controllerName] = $path . '/' . $file; |
|
| 167 | + $controllers[preg_replace('!Controllers$!', '', $dir)][$controllerName] = $path.'/'.$file; |
|
| 168 | 168 | } |
| 169 | 169 | } |
| 170 | 170 | } |
@@ -211,31 +211,31 @@ discard block |
||
| 211 | 211 | $paths = []; |
| 212 | 212 | if (App::$cur != App::$primary) { |
| 213 | 213 | if (!empty($this->params[0]) && strtolower($this->params[0]) != strtolower($this->moduleName)) { |
| 214 | - $paths['primaryAppAppTypePath_slice'] = App::$primary->path . '/modules/' . $this->moduleName . '/' . $this->app->type . 'Controllers/' . ucfirst($this->params[0]) . 'Controller.php'; |
|
| 214 | + $paths['primaryAppAppTypePath_slice'] = App::$primary->path.'/modules/'.$this->moduleName.'/'.$this->app->type.'Controllers/'.ucfirst($this->params[0]).'Controller.php'; |
|
| 215 | 215 | if (App::$primary->{$this->moduleName}) { |
| 216 | - $paths['primaryAppAppTypePath_slice'] = App::$primary->{$this->moduleName}->path . '/' . $this->app->type . 'Controllers/' . ucfirst($this->params[0]) . 'Controller.php'; |
|
| 216 | + $paths['primaryAppAppTypePath_slice'] = App::$primary->{$this->moduleName}->path.'/'.$this->app->type.'Controllers/'.ucfirst($this->params[0]).'Controller.php'; |
|
| 217 | 217 | } |
| 218 | 218 | } |
| 219 | - $paths['primaryAppAppAppTypePath'] = App::$primary->path . '/modules/' . $this->moduleName . '/' . $this->app->type . 'Controllers/' . $this->moduleName . 'Controller.php'; |
|
| 219 | + $paths['primaryAppAppAppTypePath'] = App::$primary->path.'/modules/'.$this->moduleName.'/'.$this->app->type.'Controllers/'.$this->moduleName.'Controller.php'; |
|
| 220 | 220 | if (App::$primary->{$this->moduleName}) { |
| 221 | - $paths['primaryAppAppTypePath'] = App::$primary->{$this->moduleName}->path . '/' . $this->app->type . 'Controllers/' . $this->moduleName . 'Controller.php'; |
|
| 221 | + $paths['primaryAppAppTypePath'] = App::$primary->{$this->moduleName}->path.'/'.$this->app->type.'Controllers/'.$this->moduleName.'Controller.php'; |
|
| 222 | 222 | } |
| 223 | - $paths['curAppAppTypePath'] = $this->app->{$this->moduleName}->path . '/' . $this->app->type . 'Controllers/' . $this->moduleName . 'Controller.php'; |
|
| 223 | + $paths['curAppAppTypePath'] = $this->app->{$this->moduleName}->path.'/'.$this->app->type.'Controllers/'.$this->moduleName.'Controller.php'; |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | if (!empty($this->params[0]) && strtolower($this->params[0]) != strtolower($this->moduleName)) { |
| 227 | - $paths['appAppTypePath_slice'] = $this->app->path . '/modules/' . $this->moduleName . '/' . $this->app->type . 'Controllers/' . ucfirst($this->params[0]) . 'Controller.php'; |
|
| 228 | - $paths['appTypePath_slice'] = $this->path . '/' . $this->app->type . 'Controllers/' . ucfirst($this->params[0]) . 'Controller.php'; |
|
| 227 | + $paths['appAppTypePath_slice'] = $this->app->path.'/modules/'.$this->moduleName.'/'.$this->app->type.'Controllers/'.ucfirst($this->params[0]).'Controller.php'; |
|
| 228 | + $paths['appTypePath_slice'] = $this->path.'/'.$this->app->type.'Controllers/'.ucfirst($this->params[0]).'Controller.php'; |
|
| 229 | 229 | } |
| 230 | - $paths['appAppTypePath'] = $this->app->path . '/modules/' . $this->moduleName . '/' . $this->app->type . 'Controllers/' . $this->moduleName . 'Controller.php'; |
|
| 231 | - $paths['appTypePath'] = $this->path . '/' . $this->app->type . 'Controllers/' . $this->moduleName . 'Controller.php'; |
|
| 230 | + $paths['appAppTypePath'] = $this->app->path.'/modules/'.$this->moduleName.'/'.$this->app->type.'Controllers/'.$this->moduleName.'Controller.php'; |
|
| 231 | + $paths['appTypePath'] = $this->path.'/'.$this->app->type.'Controllers/'.$this->moduleName.'Controller.php'; |
|
| 232 | 232 | |
| 233 | 233 | if (!empty($this->params[0]) && strtolower($this->params[0]) != strtolower($this->moduleName)) { |
| 234 | - $paths['appUniversalPath_slice'] = $this->app->path . '/modules/' . $this->moduleName . '/Controllers/' . ucfirst($this->params[0]) . 'Controller.php'; |
|
| 235 | - $paths['universalPath_slice'] = $this->path . '/Controllers/' . ucfirst($this->params[0]) . 'Controller.php'; |
|
| 234 | + $paths['appUniversalPath_slice'] = $this->app->path.'/modules/'.$this->moduleName.'/Controllers/'.ucfirst($this->params[0]).'Controller.php'; |
|
| 235 | + $paths['universalPath_slice'] = $this->path.'/Controllers/'.ucfirst($this->params[0]).'Controller.php'; |
|
| 236 | 236 | } |
| 237 | - $paths['appUniversalPath'] = $this->app->path . '/modules/' . $this->moduleName . '/Controllers/' . $this->moduleName . 'Controller.php'; |
|
| 238 | - $paths['universalPath'] = $this->path . '/Controllers/' . $this->moduleName . 'Controller.php'; |
|
| 237 | + $paths['appUniversalPath'] = $this->app->path.'/modules/'.$this->moduleName.'/Controllers/'.$this->moduleName.'Controller.php'; |
|
| 238 | + $paths['universalPath'] = $this->path.'/Controllers/'.$this->moduleName.'Controller.php'; |
|
| 239 | 239 | |
| 240 | 240 | return $paths; |
| 241 | 241 | } |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | $controllerName = $this->moduleName; |
| 259 | 259 | $params = $this->params; |
| 260 | 260 | } |
| 261 | - $fullControllerName = $controllerName . 'Controller'; |
|
| 261 | + $fullControllerName = $controllerName.'Controller'; |
|
| 262 | 262 | $controller = new $fullControllerName(); |
| 263 | 263 | $controller->params = $params; |
| 264 | 264 | $controller->module = $this; |
@@ -284,8 +284,8 @@ discard block |
||
| 284 | 284 | } |
| 285 | 285 | $paths = Module::getModulePaths($moduleName); |
| 286 | 286 | foreach ($paths as $path) { |
| 287 | - if (file_exists($path . '/info.php')) { |
|
| 288 | - return include $path . '/info.php'; |
|
| 287 | + if (file_exists($path.'/info.php')) { |
|
| 288 | + return include $path.'/info.php'; |
|
| 289 | 289 | } |
| 290 | 290 | } |
| 291 | 291 | return []; |
@@ -304,16 +304,16 @@ discard block |
||
| 304 | 304 | { |
| 305 | 305 | $moduleName = $moduleName ? $moduleName : $this->moduleName; |
| 306 | 306 | $modulePaths = Module::getModulePaths($moduleName); |
| 307 | - $modulePaths['templatePath'] = App::$cur->view->template->path . '/modules/' . ucfirst($moduleName); |
|
| 307 | + $modulePaths['templatePath'] = App::$cur->view->template->path.'/modules/'.ucfirst($moduleName); |
|
| 308 | 308 | $snippets = []; |
| 309 | 309 | foreach ($modulePaths as $path) { |
| 310 | - if (file_exists($path . $dir . '/' . $snippetsPath)) { |
|
| 311 | - $snippetsPaths = array_slice(scandir($path . $dir . '/' . $snippetsPath), 2); |
|
| 310 | + if (file_exists($path.$dir.'/'.$snippetsPath)) { |
|
| 311 | + $snippetsPaths = array_slice(scandir($path.$dir.'/'.$snippetsPath), 2); |
|
| 312 | 312 | foreach ($snippetsPaths as $snippetPath) { |
| 313 | - if (is_dir($path . $dir . '/' . $snippetsPath . '/' . $snippetPath)) { |
|
| 314 | - $snippets[$snippetPath] = include $path . $dir . '/' . $snippetsPath . '/' . $snippetPath . '/info.php'; |
|
| 313 | + if (is_dir($path.$dir.'/'.$snippetsPath.'/'.$snippetPath)) { |
|
| 314 | + $snippets[$snippetPath] = include $path.$dir.'/'.$snippetsPath.'/'.$snippetPath.'/info.php'; |
|
| 315 | 315 | } else { |
| 316 | - $snippets[pathinfo($snippetPath, PATHINFO_FILENAME)] = include $path . $dir . '/' . $snippetsPath . '/' . $snippetPath; |
|
| 316 | + $snippets[pathinfo($snippetPath, PATHINFO_FILENAME)] = include $path.$dir.'/'.$snippetsPath.'/'.$snippetPath; |
|
| 317 | 317 | } |
| 318 | 318 | } |
| 319 | 319 | } |
@@ -335,9 +335,9 @@ discard block |
||
| 335 | 335 | { |
| 336 | 336 | $extensions = []; |
| 337 | 337 | $modules = Module::getInstalled(App::$cur); |
| 338 | - $method = 'get' . ucfirst($extensionType); |
|
| 338 | + $method = 'get'.ucfirst($extensionType); |
|
| 339 | 339 | foreach ($modules as $module) { |
| 340 | - $extensions = array_merge($extensions, $this->{$method}($request, false, "/extensions/{$this->moduleName}/" . $extensionType, $module)); |
|
| 340 | + $extensions = array_merge($extensions, $this->{$method}($request, false, "/extensions/{$this->moduleName}/".$extensionType, $module)); |
|
| 341 | 341 | } |
| 342 | 342 | return $extensions; |
| 343 | 343 | } |