Fixed issue #1 in Configuration->__construct() where the name of an environment variable was being used instead of its value when determining the configuration file path. This incorrect handling resulted in warnings about non-existent files and hindered the proper loading of configuration files. With this fix, environment variables should now correctly guide the path to the desired configuration files, improving the flexibility and functionality of the configuration library.
This commit is contained in:
parent
7aa8c56074
commit
a3c04e1c36
2 changed files with 12 additions and 3 deletions
|
@ -55,10 +55,9 @@
|
|||
$env = getenv(sprintf("CONFIGLIB_%s", strtoupper($name)));
|
||||
if($env !== false)
|
||||
{
|
||||
$environment_config = sprintf('CONFIGLIB_%s', strtoupper($name));
|
||||
if(file_exists($environment_config))
|
||||
if(file_exists($env))
|
||||
{
|
||||
$this->path = $environment_config;
|
||||
$this->path = $env;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue