Skip to content
Browse files

Refactoring PhpReader::read() to check for .php file first. Fixed err…

…or when there's a directory with the same name.
  • Loading branch information...
1 parent e47b970 commit f0d10b4d696c1d3a674d4f7a2a464674eeb2ace5 @majna majna committed
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/Cake/Configure/PhpReader.php
View
8 lib/Cake/Configure/PhpReader.php
@@ -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;

0 comments on commit f0d10b4

Please sign in to comment.
Something went wrong with that request. Please try again.