From 97abf70237a446e2560e4bebe69bac7909bc5f08 Mon Sep 17 00:00:00 2001 From: vibbow Date: Tue, 16 Apr 2019 19:00:51 +0800 Subject: [PATCH] Fix BaseConfig didn't load Registrar files properly --- system/Config/BaseConfig.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/system/Config/BaseConfig.php b/system/Config/BaseConfig.php index 9b1b0be94940..0442e45bb55a 100644 --- a/system/Config/BaseConfig.php +++ b/system/Config/BaseConfig.php @@ -181,8 +181,15 @@ protected function registerProperties() if (! static::$didDiscovery) { - $locator = \Config\Services::locator(); - static::$registrars = $locator->search('Config/Registrar.php'); + $locator = \Config\Services::locator(); + $registrarsFiles = $locator->search('Config/Registrar.php'); + + foreach ($registrarsFiles as $file) + { + $className = $locator->getClassname($file); + static::$registrars[] = new $className(); + } + static::$didDiscovery = true; }