protected function readYml() { if (file_exists($this->getFileName())) { $yaml = new Parser(); $yamlArr = $yaml->parse(file_get_contents($this->getFileName())); if ($yamlArr === NULL) { $yamlArr = []; } } else { throw new \Exception(sprintf("File %s not exists!", $this->getFileName())); } return $this->repairApostrophes($yamlArr); }
protected function readYml($configFullPath) { try { if (file_exists($configFullPath)) { $yaml = new Parser(); $yamlArr = $yaml->parse(file_get_contents($configFullPath)); if ($yamlArr === NULL) { $yamlArr = []; } } else { $yamlArr = []; } return $yamlArr; } catch (\Exception $e) { throw new \Exception('Error reading yml file.'); } }
protected function readYml() { if (file_exists($this->getFileName())) { $yaml = new Parser(); $yamlArr = $yaml->parse(file_get_contents($this->getFileName())); if ($yamlArr === NULL) { $yamlArr = ['parameters' => [], 'services' => []]; } } else { $yamlArr = ['parameters' => [], 'services' => []]; } return $this->repairApostrophes($yamlArr); }
protected function readYml($configFullPath) { try { if (file_exists($configFullPath)) { $yaml = new Parser(); $this->yamlArr = $yaml->parse(file_get_contents($configFullPath)); if ($this->yamlArr === NULL) { $this->yamlArr = ['core_class_mapper' => ['languages' => []]]; foreach ($this->languages as $language) { $this->yamlArr['core_class_mapper']['languages'][] = [$language]; } } } else { $this->yamlArr = ['core_class_mapper' => ['languages' => []]]; foreach ($this->languages as $language) { $this->yamlArr['core_class_mapper']['languages'][] = [$language]; } } return $this->yamlArr; } catch (\Exception $e) { throw new \Exception('Error reading yml file.'); } }