コード例 #1
0
ファイル: FileLoader.php プロジェクト: pmaxs/config
 /**
  * {@inheritdoc}
  */
 public function load($resource, $type = null)
 {
     $paths = $this->getLocator()->locate($resource, null, false);
     if (empty($paths)) {
         throw new \Exception('Config resource "' . $resource . '" not found');
     }
     $config = new Config();
     foreach ((array) $paths as $path) {
         $config->addResource(new FileResource($path));
         $this->processData($config, $this->read($path), $type);
     }
     return $config;
 }