private function loadFromFile($filename)
 {
     $currentFile = new File($this->yamlarh->getFilename());
     $file = new File($filename);
     if (!$file->isFile()) {
         $file->setFolder($currentFile->getFolder() . $file->getFolder());
     }
     if (!$file->isFile()) {
         throw new SphringException("Property file '%s' cannot be found.", $file->getName());
     }
     $properties = FileLoader::loadFile($file);
     if ($properties === null && in_array($file->getExtension(), self::$extIni)) {
         $ini = new \Zend_Config_Ini($file->absolute());
         $properties = $ini->toArray();
     } elseif ($properties === null) {
         return;
     }
     $this->injectInYamlarh($properties);
 }
示例#2
0
 /**
  * @param File $file
  */
 private function parseFile(File $file)
 {
     $parsedYml = FileLoader::loadFile($file);
     if (empty($parsedYml)) {
         return;
     }
     $this->arrayToReturn = $this->arrayMergeRecursiveDistinct($this->arrayToReturn, $parsedYml);
     foreach ($this->arrayToReturn as $key => $value) {
         if ($key != $this->paramaterKey . Yamlarh::IMPORT_KEY) {
             continue;
         }
         unset($this->arrayToReturn[$key]);
         if (!is_array($value)) {
             $this->getFromImport($value, $file);
         } else {
             foreach ($value as $fileName) {
                 $this->getFromImport($fileName, $file);
             }
         }
     }
     foreach ($this->nodes as $node) {
         $this->arrayToReturn = $node->run();
     }
 }