| Conditions | 5 |
| Paths | 4 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 36 | public function run($app) |
||
| 37 | { |
||
| 38 | foreach ($app->getApplicationModules() as $id => $module) { |
||
| 39 | $folder = $module->basePath . DIRECTORY_SEPARATOR . 'commands'; |
||
| 40 | if (file_exists($folder) && is_dir($folder)) { |
||
| 41 | foreach (FileHelper::findFiles($folder) as $file) { |
||
| 42 | $module->controllerNamespace = $module->namespace . '\commands'; |
||
| 43 | |||
| 44 | $className = '\\'.$module->getNamespace().'\\commands\\' . pathinfo($file, PATHINFO_FILENAME); |
||
| 45 | |||
| 46 | $command = str_replace('-controller', '', $module->id . '/' . Inflector::camel2id(pathinfo($file, PATHINFO_FILENAME))); |
||
| 47 | |||
| 48 | Yii::$app->controllerMap[$command] = ['class' => $className]; |
||
| 49 | } |
||
| 50 | } |
||
| 51 | } |
||
| 52 | } |
||
| 53 | } |
||
| 54 |