From f0d10b4d696c1d3a674d4f7a2a464674eeb2ace5 Mon Sep 17 00:00:00 2001 From: Majna Date: Sun, 16 Oct 2011 22:21:01 +0200 Subject: [PATCH] Refactoring PhpReader::read() to check for .php file first. Fixed error when there's a directory with the same name. --- lib/Cake/Configure/PhpReader.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Cake/Configure/PhpReader.php b/lib/Cake/Configure/PhpReader.php index f81cd067a..b6682d910 100644 --- a/lib/Cake/Configure/PhpReader.php +++ b/lib/Cake/Configure/PhpReader.php @@ -72,10 +72,10 @@ class PhpReader implements ConfigReaderInterface { } else { $file = $this->_path . $key; } - if (!file_exists($file)) { - $file .= '.php'; - if (!file_exists($file)) { - throw new ConfigureException(__d('cake_dev', 'Could not load configuration files: %s or %s', substr($file, 0, -4), $file)); + $file .= '.php'; + if (!is_file($file)) { + if (!is_file(substr($file, 0, -4))) { + throw new ConfigureException(__d('cake_dev', 'Could not load configuration files: %s or %s', $file, substr($file, 0, -4))); } } include $file;