Skip to content

Commit

Permalink
fix problem for php lower version
Browse files Browse the repository at this point in the history
  • Loading branch information
alishahidi committed Jul 4, 2022
1 parent 24f7177 commit 47a2b9f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions system/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace System\Config;

use Symfony\Component\Finder\Finder;

class Config
{
Expand All @@ -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();
Expand Down

0 comments on commit 47a2b9f

Please sign in to comment.