Make HelpController check to make sure module controller path exists before scanning it

This commit is contained in:
Jacob Morrison
2014-01-17 12:07:15 -08:00
parent 462c50031a
commit 5c19cc84f4
2 changed files with 8 additions and 4 deletions

View File

@@ -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));
}
}
}