Add support for CONFIGLIB_PATH environment variable
This commit is contained in:
parent
489df9f79a
commit
579813315b
1 changed files with 46 additions and 38 deletions
|
@ -65,6 +65,13 @@
|
|||
}
|
||||
|
||||
if ($this->path === null)
|
||||
{
|
||||
// If the CONFIGLIB_PATH environment variable is set, use it as the configuration path
|
||||
if(getenv('CONFIGLIB_PATH'))
|
||||
{
|
||||
$configDir = getenv('CONFIGLIB_PATH');
|
||||
}
|
||||
else
|
||||
{
|
||||
$filePath = $name . '.conf';
|
||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
|
||||
|
@ -116,6 +123,7 @@
|
|||
$configDir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'configlib';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure the directory exists
|
||||
if (!file_exists($configDir))
|
||||
|
|
Loading…
Add table
Reference in a new issue