src/Bootstrap.php
public static function initByPath(
        $path, array $options = [
            'registry' => Recursive::ALL_INCLUSIVE,
        ]
    )
    {
        if (!file_exists($path) || !is_readable($path)) {
            throw new RuntimeException(
                sprintf("Cannot open config file \"%s\"", $path),
                self::EX_CANNOT_OPEN_CONFIG
            );
        }
        $config = \donbidon\Lib\Config\Ini::parse(
            file_get_contents($path), true
        );
        if (!is_array($config)) {
            throw new RuntimeException(
                sprintf("Cannot parse config file \"%s\"", $path),
                self::EX_CANNOT_PARSE_CONFIG
            );
        }
        $registry = static::initByArray($config, $options);

        return $registry;
    }
public static function initByPath(
        $path, array $options = [
            'registry' => Recursive::ALL_INCLUSIVE,
        ]
    )
    {
        if (!file_exists($path) || !is_readable($path)) {
            throw new RuntimeException(
                sprintf("Cannot open config file \"%s\"", $path),
                self::EX_CANNOT_OPEN_CONFIG
            );
        }
        $config = \donbidon\Lib\Config\Ini::parse(
            file_get_contents($path), true
        );
        if (!is_array($config)) {
            throw new RuntimeException(
                sprintf("Cannot parse config file \"%s\"", $path),
                self::EX_CANNOT_PARSE_CONFIG
            );
        }
        $registry = static::initByArray($config, $options);

        return $registry;
    }
public static function initByPath ( $ path , array $ options = [ 'registry' => Recursive :: ALL_INCLUSIVE , ] ) { if ( ! file_exists ( $ path ) || ! is_readable ( $ path ) ) { throw new RuntimeException ( sprintf ( "Cannot open config file \"%s\"" , $ path ) , self :: EX_CANNOT_OPEN_CONFIG ) ; } $ config = \ donbidon \ Lib \ Config \ Ini :: parse ( file_get_contents ( $ path ) , true ) ; if ( ! is_array ( $ config ) ) { throw new RuntimeException ( sprintf ( "Cannot parse config file \"%s\"" , $ path ) , self :: EX_CANNOT_PARSE_CONFIG ) ; } $ registry = static :: initByArray ( $ config , $ options ) ; return $ registry ; }
Initializes environment by config file path.

@param  string $path
@param  array $options  Array of options:
- (int)registry - see Recursive::__construct().
@return I_Registry
@throws RuntimeException If passed file doesn't exist or cannot be read.
@throws RuntimeException If cannot parse config file.
Initializes environment by config file path .