code/object/config/factory.php
public function fromFile($filename, $object = true)
    {
        $pathinfo = pathinfo($filename);

        if (!isset($pathinfo['extension']))
        {
            throw new \RuntimeException(sprintf(
                'Filename "%s" is missing an extension and cannot be auto-detected', $filename
            ));
        }

        $config = $this->createFormat($pathinfo['extension'])->fromFile($filename, $object);
        return $config;
    }
public function fromFile($filename, $object = true)
    {
        $pathinfo = pathinfo($filename);

        if (!isset($pathinfo['extension']))
        {
            throw new \RuntimeException(sprintf(
                'Filename "%s" is missing an extension and cannot be auto-detected', $filename
            ));
        }

        $config = $this->createFormat($pathinfo['extension'])->fromFile($filename, $object);
        return $config;
    }
public function fromFile ( $ filename , $ object = true ) { $ pathinfo = pathinfo ( $ filename ) ; if ( ! isset ( $ pathinfo [ 'extension' ] ) ) { throw new \ RuntimeException ( sprintf ( 'Filename "%s" is missing an extension and cannot be auto-detected' , $ filename ) ) ; } $ config = $ this -> createFormat ( $ pathinfo [ 'extension' ] ) -> fromFile ( $ filename , $ object ) ; return $ config ; }
Read a config from a file.

@param  string  $filename
@param  bool    $object  If TRUE return a ConfigObject, if FALSE return an array. Default TRUE.
@throws \InvalidArgumentException
@throws \RuntimeException
@return ObjectConfigInterface|array
Read a config from a file .