mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-06 23:39:02 +01:00
Make HelpController check to make sure module controller path exists before scanning it
This commit is contained in:
@@ -123,10 +123,13 @@ class HelpController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
$files = scandir($module->getControllerPath());
|
||||
foreach ($files as $file) {
|
||||
if (strcmp(substr($file, -14), 'Controller.php') === 0) {
|
||||
$commands[] = $prefix . Inflector::camel2id(substr(basename($file), 0, -14));
|
||||
$controllerPath = $module->getControllerPath();
|
||||
if (is_dir($controllerPath)) {
|
||||
$files = scandir($controllerPath);
|
||||
foreach ($files as $file) {
|
||||
if (strcmp(substr($file, -14), 'Controller.php') === 0) {
|
||||
$commands[] = $prefix . Inflector::camel2id(substr(basename($file), 0, -14));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user