Handle previously renamed CONFIG_PATH gracefully
This commit is contained in:
parent
d5d13fa831
commit
7d9ec9509b
|
@ -107,7 +107,8 @@ class Configuration
|
||||||
$configFile = $basePath . 'conf.php';
|
$configFile = $basePath . 'conf.php';
|
||||||
|
|
||||||
if (getenv('CONFIG_PATH') !== false) {
|
if (getenv('CONFIG_PATH') !== false) {
|
||||||
$configFile = getenv('CONFIG_PATH');
|
$configFile = getenv('CONFIG_PATH');
|
||||||
|
$configFilePhp = substr($configFile, 0, -3) . 'php';
|
||||||
|
|
||||||
// Rename INI files to avoid configuration leakage
|
// Rename INI files to avoid configuration leakage
|
||||||
if (
|
if (
|
||||||
|
@ -115,9 +116,12 @@ class Configuration
|
||||||
is_readable($configFile) &&
|
is_readable($configFile) &&
|
||||||
is_writable(dirname($configFile))
|
is_writable(dirname($configFile))
|
||||||
) {
|
) {
|
||||||
$oldConfigFile = $configFile;
|
DataStore::prependRename($configFile, $configFilePhp, ';');
|
||||||
$configFile = substr($configFile, 0, -3) . 'php';
|
}
|
||||||
DataStore::prependRename($oldConfigFile, $configFile, ';');
|
|
||||||
|
// Rename successful? Already renamed? use that file
|
||||||
|
if (is_readable($configFilePhp)) {
|
||||||
|
$configFile = $configFilePhp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue