From 87fac4d19cc0882c3ccba3f22f3c53569eadfb7d Mon Sep 17 00:00:00 2001 From: Netkas Date: Tue, 11 Jul 2023 14:15:38 -0400 Subject: [PATCH] Merged str_replace functions --- CHANGELOG.md | 4 ++-- src/ConfigLib/Configuration.php | 11 +---------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70c44d0..f6e1ba8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,8 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 is set, and if so, load that file instead of going through the default process of loading the default configuration file. If the file is not found, it will resort to its default behavior. You can either load an original json configuration file which is usually located at `\var\ncc\data\net.nosial.configlib` as one of the .conf files, or you can load a yml - which is the same one you usually use to import or edit configurations. But the file extension must be either `.json`, - `.yml` or `.yaml`. If you want to load a file from a different location. + which is the same one you usually use to import or edit configurations. But the file extension must be either `.yml` + or `.yaml` if you want ConfigLib to load it as a yml file, otherwise by default it assumes it is a json file. ## [1.0.0] - 2023-02-23 diff --git a/src/ConfigLib/Configuration.php b/src/ConfigLib/Configuration.php index cf9fd7a..97587ae 100644 --- a/src/ConfigLib/Configuration.php +++ b/src/ConfigLib/Configuration.php @@ -42,11 +42,6 @@ */ private $Modified; - /** - * @var bool - */ - private $FromEnvironment; - /** * Public Constructor * @@ -56,10 +51,7 @@ { // Sanitize $name for file path $name = strtolower($name); - $name = str_replace('/', '_', $name); - $name = str_replace('\\', '_', $name); - $name = str_replace('.', '_', $name); - $this->FromEnvironment = false; + $name = str_replace(array('/', '\\', '.'), '_', $name); if(!getenv(sprintf("CONFIGLIB_%s", strtoupper($name)))) { @@ -67,7 +59,6 @@ if(file_exists($environment_config)) { $this->Path = $environment_config; - $this->FromEnvironment = true; } else {