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:
Netkas 2023-07-11 22:25:53 -04:00
parent 7aa8c56074
commit a3c04e1c36
No known key found for this signature in database
GPG key ID: 5DAF58535614062B
2 changed files with 12 additions and 3 deletions

View file

@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.0.2] - 2023-07-11
### Fixed
* Fixed issue [#1](https://git.n64.cc/nosial/libs/config/-/issues/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.
## [1.0.1] - 2023-07-11
### Changed

View file

@ -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
{