config = $config; $this->fileManager = $fileManager; $this->namespaceLoader = new NamespaceLoader($config, $fileManager); } public function register(array $autoloadList) { /* load "psr-4", "psr-0", "classmap" */ $this->namespaceLoader->register($autoloadList); /* load "autoloadFileList" */ $this->registerAutoloadFileList($autoloadList); /* load "files" */ $this->registerFiles($autoloadList); } protected function registerAutoloadFileList(array $autoloadList) { $keyName = 'autoloadFileList'; if (!isset($autoloadList[$keyName])) return; foreach ($autoloadList[$keyName] as $filePath) { if (file_exists($filePath)) { require_once($filePath); } } } protected function registerFiles(array $autoloadList) { $keyName = 'files'; if (!isset($autoloadList[$keyName])) return; foreach ($autoloadList[$keyName] as $id => $filePath) { if (file_exists($filePath)) { require_once($filePath); } } } }