private function loadFromFile($filename, $overwrite = false)
    {
        try {
            $yamlDatas = Yaml::parse(file_get_contents($filename));

            if (is_array($yamlDatas)) {
                if (true === $this->debug) {
                    $this->debug_data[$filename] = $yamlDatas;
                }

                if (self::CONFIG_FILE.'.'.self::EXTENSION === basename($filename) ||
                    self::CONFIG_FILE.'.'.$this->environment.'.'.self::EXTENSION === basename($filename)) {
                    foreach ($yamlDatas as $component => $config) {
                        if (!is_array($config)) {
                            $this->container->get('logger')->error('Bad configuration, array expected, given : '.$config);
                        }
                        $this->setSection($component, $config, $overwrite);
                    }
                } else {
                    $this->setSection(basename($filename, '.'.self::EXTENSION), $yamlDatas, $overwrite);
                }
            }
        } catch (ParseException $e) {
            throw new InvalidConfigException($e->getMessage(), null, $e, $e->getParsedFile(), $e->getParsedLine());
        }
    }
private function loadFromFile($filename, $overwrite = false)
    {
        try {
            $yamlDatas = Yaml::parse(file_get_contents($filename));

            if (is_array($yamlDatas)) {
                if (true === $this->debug) {
                    $this->debug_data[$filename] = $yamlDatas;
                }

                if (self::CONFIG_FILE.'.'.self::EXTENSION === basename($filename) ||
                    self::CONFIG_FILE.'.'.$this->environment.'.'.self::EXTENSION === basename($filename)) {
                    foreach ($yamlDatas as $component => $config) {
                        if (!is_array($config)) {
                            $this->container->get('logger')->error('Bad configuration, array expected, given : '.$config);
                        }
                        $this->setSection($component, $config, $overwrite);
                    }
                } else {
                    $this->setSection(basename($filename, '.'.self::EXTENSION), $yamlDatas, $overwrite);
                }
            }
        } catch (ParseException $e) {
            throw new InvalidConfigException($e->getMessage(), null, $e, $e->getParsedFile(), $e->getParsedLine());
        }
    }
private function loadFromFile ( $ filename , $ overwrite = false ) { try { $ yamlDatas = Yaml :: parse ( file_get_contents ( $ filename ) ) ; if ( is_array ( $ yamlDatas ) ) { if ( true === $ this -> debug ) { $ this -> debug_data [ $ filename ] = $ yamlDatas ; } if ( self :: CONFIG_FILE . '.' . self :: EXTENSION === basename ( $ filename ) || self :: CONFIG_FILE . '.' . $ this -> environment . '.' . self :: EXTENSION === basename ( $ filename ) ) { foreach ( $ yamlDatas as $ component => $ config ) { if ( ! is_array ( $ config ) ) { $ this -> container -> get ( 'logger' ) -> error ( 'Bad configuration, array expected, given : ' . $ config ) ; } $ this -> setSection ( $ component , $ config , $ overwrite ) ; } } else { $ this -> setSection ( basename ( $ filename , '.' . self :: EXTENSION ) , $ yamlDatas , $ overwrite ) ; } } } catch ( ParseException $ e ) { throw new InvalidConfigException ( $ e -> getMessage ( ) , null , $ e , $ e -> getParsedFile ( ) , $ e -> getParsedLine ( ) ) ; } }
Try to parse a yaml config file.

@param string $filename

@throws \BackBee\Config\Exception\InvalidConfigException Occurs when the file can't be parsed
Try to parse a yaml config file .