public function load($filename, $merge_globals = true, $stack_name = null, $handler = null)
    {
        $file = new \SplFileInfo($filename);
        if ($file->isFile()) {
            if (empty($handler)) {
                $handler = $file->getExtension();
            }
            $factory = \Library\Factory::create()
                ->factoryName(__CLASS__)
                ->mustImplement(Kernel::CONFIG_FILETYPE_INTERFACE)
                ->defaultNamespace(Kernel::CONFIG_FILETYPE_DEFAULT_NAMESPACE)
                ->classNameMask(array('%s', '%s'.Kernel::CONFIG_FILETYPE_SUFFIX))
                ;
            $config = $factory->build($handler);
            $values = $config->parse($file);
            if (!empty($values)) {
                $this->set($values, $merge_globals, $stack_name);
                $this->_registerConfigFile($filename, count($values));
            } else {
                $this->_registerConfigFile($filename, 'empty content');
            }
        } else {
            throw new ErrorException(
                sprintf('Configuration file "%s" not found!', $filename)
            );
        }
        return $this;
    }
public function load($filename, $merge_globals = true, $stack_name = null, $handler = null)
    {
        $file = new \SplFileInfo($filename);
        if ($file->isFile()) {
            if (empty($handler)) {
                $handler = $file->getExtension();
            }
            $factory = \Library\Factory::create()
                ->factoryName(__CLASS__)
                ->mustImplement(Kernel::CONFIG_FILETYPE_INTERFACE)
                ->defaultNamespace(Kernel::CONFIG_FILETYPE_DEFAULT_NAMESPACE)
                ->classNameMask(array('%s', '%s'.Kernel::CONFIG_FILETYPE_SUFFIX))
                ;
            $config = $factory->build($handler);
            $values = $config->parse($file);
            if (!empty($values)) {
                $this->set($values, $merge_globals, $stack_name);
                $this->_registerConfigFile($filename, count($values));
            } else {
                $this->_registerConfigFile($filename, 'empty content');
            }
        } else {
            throw new ErrorException(
                sprintf('Configuration file "%s" not found!', $filename)
            );
        }
        return $this;
    }
public function load ( $ filename , $ merge_globals = true , $ stack_name = null , $ handler = null ) { $ file = new \ SplFileInfo ( $ filename ) ; if ( $ file -> isFile ( ) ) { if ( empty ( $ handler ) ) { $ handler = $ file -> getExtension ( ) ; } $ factory = \ Library \ Factory :: create ( ) -> factoryName ( __CLASS__ ) -> mustImplement ( Kernel :: CONFIG_FILETYPE_INTERFACE ) -> defaultNamespace ( Kernel :: CONFIG_FILETYPE_DEFAULT_NAMESPACE ) -> classNameMask ( array ( '%s' , '%s' . Kernel :: CONFIG_FILETYPE_SUFFIX ) ) ; $ config = $ factory -> build ( $ handler ) ; $ values = $ config -> parse ( $ file ) ; if ( ! empty ( $ values ) ) { $ this -> set ( $ values , $ merge_globals , $ stack_name ) ; $ this -> _registerConfigFile ( $ filename , count ( $ values ) ) ; } else { $ this -> _registerConfigFile ( $ filename , 'empty content' ) ; } } else { throw new ErrorException ( sprintf ( 'Configuration file "%s" not found!' , $ filename ) ) ; } return $ this ; }
Load and parse a configuration file

@param   string      $filename
@param   bool        $merge_globals
@param   null|string $stack_name
@param   null|string $handler    A classname to parse concerned config content
@return  self
@throws  \CarteBlanche\Exception\ErrorException if the file is not found
Load and parse a configuration file