mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-06 03:22:39 +00:00
The actual config file must always have .php extension.
This commit is contained in:
parent
65e63c51c8
commit
0dec093f48
3 changed files with 31 additions and 12 deletions
|
@ -66,22 +66,21 @@ class PhpReader implements ConfigReaderInterface {
|
|||
$key = substr($key, 0, -4);
|
||||
}
|
||||
list($plugin, $key) = pluginSplit($key);
|
||||
$key .= '.php';
|
||||
|
||||
if ($plugin) {
|
||||
$file = App::pluginPath($plugin) . 'Config' . DS . $key;
|
||||
} else {
|
||||
$file = $this->_path . $key;
|
||||
}
|
||||
$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)));
|
||||
}
|
||||
throw new ConfigureException(__d('cake_dev', 'Could not load configuration file: %s', $file));
|
||||
}
|
||||
|
||||
include $file;
|
||||
if (!isset($config)) {
|
||||
throw new ConfigureException(
|
||||
sprintf(__d('cake_dev', 'No variable $config found in %s.php'), $file)
|
||||
sprintf(__d('cake_dev', 'No variable $config found in %s'), $file)
|
||||
);
|
||||
}
|
||||
return $config;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue