Skip to content

Commit

Permalink
Refactoring PhpReader::read() to check for .php file first. Fixed err…
Browse files Browse the repository at this point in the history
…or when there's a directory with the same name.
  • Loading branch information
majna committed Oct 16, 2011
1 parent e47b970 commit f0d10b4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Cake/Configure/PhpReader.php
Expand Up @@ -72,10 +72,10 @@ public function read($key) {
} 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;
Expand Down

0 comments on commit f0d10b4

Please sign in to comment.