32 private $configFilePool;
62 $this->configFilePool = $configFilePool;
63 $this->driverPool = $driverPool;
65 if (!preg_match(
'/^[a-z\d\.\-]+\.php$/i', $file)) {
66 throw new \InvalidArgumentException(
"Invalid file name: {$file}");
68 $this->files = [$file];
70 $this->files = $this->configFilePool->getPaths();
96 public function load($fileKey =
null)
102 $filePath =
$path .
'/' . $this->configFilePool->getPath($fileKey);
103 if ($fileDriver->isExists($filePath)) {
110 $configFiles = $this->configFilePool->getPaths();
113 foreach (array_keys($configFiles) as $fileKey) {
114 $configFile =
$path .
'/' . $this->configFilePool->getPath($fileKey);
115 if ($fileDriver->isExists($configFile)) {
116 $fileData = include $configFile;
117 if (!is_array($fileData)) {
123 $allFilesData[$configFile] = $fileData;
142 public function loadConfigFile($fileKey, $pathConfig, $ignoreInitialConfigFiles =
false)
144 return $this->
load($fileKey);
if(!file_exists($installConfigFile)) $dirList
loadConfigFile($fileKey, $pathConfig, $ignoreInitialConfigFiles=false)
__construct(DirectoryList $dirList, DriverPool $driverPool, ConfigFilePool $configFilePool, $file=null)