From cb03c7ab0dfd47921ab8e29cdfdfe70b89ff914a Mon Sep 17 00:00:00 2001 From: Jan Chren Date: Sat, 6 Sep 2014 00:46:59 +0200 Subject: [PATCH 1/2] Revert "reverted back to file-only checks, changed to file_exists()" This reverts commit d234b8e2128356a5d7c76e7d7048c21a26bd49c2. --- system/src/Grav/Common/Config.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/system/src/Grav/Common/Config.php b/system/src/Grav/Common/Config.php index 876b13f40..484ed1763 100644 --- a/system/src/Grav/Common/Config.php +++ b/system/src/Grav/Common/Config.php @@ -232,9 +232,10 @@ class Config extends Data /** @var \DirectoryIterator $plugin */ foreach ($iterator as $plugin) { $name = $plugin->getBasename(); - $file = $plugin->getPathname() . DS . $name . YAML_EXT; + $dir = $plugin->getPathname() ; + $file = $dir . DS . $name . YAML_EXT; - if (!file_exists($file)) { + if (!(is_dir($dir) && is_file($file))) { continue; } From 393c8cab2a47d27caad05ea102ff4c46366533dd Mon Sep 17 00:00:00 2001 From: Jan Chren Date: Sat, 6 Sep 2014 03:09:07 +0200 Subject: [PATCH 2/2] final workaround for PHP bug 52065 --- system/src/Grav/Common/Config.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/system/src/Grav/Common/Config.php b/system/src/Grav/Common/Config.php index 484ed1763..b8a646fe1 100644 --- a/system/src/Grav/Common/Config.php +++ b/system/src/Grav/Common/Config.php @@ -231,13 +231,12 @@ class Config extends Data /** @var \DirectoryIterator $plugin */ foreach ($iterator as $plugin) { - $name = $plugin->getBasename(); - $dir = $plugin->getPathname() ; - $file = $dir . DS . $name . YAML_EXT; + if ($iterator->isFile() || $iterator->isDot()) continue; - if (!(is_dir($dir) && is_file($file))) { - continue; - } + $name = $plugin->getBasename(); + $file = $plugin->getPathname() . DS . $name . YAML_EXT; + + if (!file_exists($file)) continue; $modified = filemtime($file); $plugins["plugins/{$name}"] = $modified;