Exception handling when plugins/ dir missing

This commit is contained in:
Sam Georges 2014-09-19 17:22:11 +10:00
parent 23710dbbc3
commit 5cd9f30ea2
1 changed files with 4 additions and 1 deletions

View File

@ -297,11 +297,14 @@ class PluginManager
$plugins = [];
$dirPath = $this->getPath();
if (!File::isDirectory($dirPath))
return $plugins;
$it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dirPath));
$it->setMaxDepth(2);
$it->rewind();
while($it->valid()) {
while ($it->valid()) {
if (($it->getDepth() > 1) && $it->isFile() && (strtolower($it->getFilename()) == "plugin.php")) {
$filePath = dirname($it->getPathname());
$pluginName = basename($filePath);