dirList = $dirList; $this->configFilePool = $configFilePool; $this->driverPool = $driverPool; } /** * Loads the configuration file. * * @param string $fileKey The file key * @return array The configurations array * @throws FileSystemException If file can not be read * @throws \Exception If file key is not correct */ public function load($fileKey) { $path = $this->dirList->getPath(DirectoryList::CONFIG); $fileDriver = $this->driverPool->getDriver(DriverPool::FILE); $filePath = $path . '/' . $this->configFilePool->getPath($fileKey); if ($fileDriver->isExists($filePath)) { return include $filePath; } return []; } }