From 47a2b9f0f3ce5af8c638d0cf4edf203622bf9edf Mon Sep 17 00:00:00 2001 From: Ali Shahidi Date: Mon, 4 Jul 2022 15:33:35 +0430 Subject: [PATCH] fix problem for php lower version --- system/Config/Config.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/system/Config/Config.php b/system/Config/Config.php index e72e949..fcfd103 100755 --- a/system/Config/Config.php +++ b/system/Config/Config.php @@ -2,7 +2,6 @@ namespace System\Config; -use Symfony\Component\Finder\Finder; class Config { @@ -19,11 +18,9 @@ private function initialConfigArray() { $dirSep = DIRECTORY_SEPARATOR; $configPath = dirname(dirname(__DIR__)) . "{$dirSep}config{$dirSep}"; - $finder = new Finder(); - $finder->files()->in($configPath); - foreach ($finder as $file) { - $config = require $file->getRealPath(); - $key = str_replace([$configPath, ".php"], "", $file->getRealPath()); + foreach (glob($configPath . "*.php") as $fileName) { + $config = require $fileName; + $key = str_replace([$configPath, ".php"], "", $fileName); $this->config_nested_array[$key] = $config; } $this->initialDefaultValues();