public static function load($mPath, $sNamespace = null)
    {
        # Check if $mPath is an array of path
        if (is_array($mPath) && !empty($mPath)) {
            $aFiles = $mPath;
        } elseif (strpos($mPath, '.') > 0 && !is_null(Arr::get(static::$aSettings, $mPath))) {
            $tmp = Arr::get(static::$aSettings, $mPath);
            $aFiles = glob(substr($tmp, -1) === '/' ? $tmp . '*.php' : $tmp);
        } else {
            $aFiles = glob(substr($mPath, -1) === '/' ? $mPath . '*.php' : $mPath);
        }

        foreach ($aFiles as $sFilePath) {

            $pathinfo = pathinfo($sFilePath);
            $key = !is_null($sNamespace) ? $sNamespace . '.' . $pathinfo['filename'] : $pathinfo['filename'];

            if (!is_int(array_search($sFilePath, $aFiles))) {
                $key = array_search($sFilePath, $aFiles);
            }

            if (!is_null(Arr::get(static::$aSettings, $key))) {
                static::set($key, Arr::merge(static::get($key), include $sFilePath));
            } elseif (is_file($sFilePath)) {
                static::set($key, include $sFilePath);
            }
        }

        return static::getInstance();
    }
public static function load($mPath, $sNamespace = null)
    {
        # Check if $mPath is an array of path
        if (is_array($mPath) && !empty($mPath)) {
            $aFiles = $mPath;
        } elseif (strpos($mPath, '.') > 0 && !is_null(Arr::get(static::$aSettings, $mPath))) {
            $tmp = Arr::get(static::$aSettings, $mPath);
            $aFiles = glob(substr($tmp, -1) === '/' ? $tmp . '*.php' : $tmp);
        } else {
            $aFiles = glob(substr($mPath, -1) === '/' ? $mPath . '*.php' : $mPath);
        }

        foreach ($aFiles as $sFilePath) {

            $pathinfo = pathinfo($sFilePath);
            $key = !is_null($sNamespace) ? $sNamespace . '.' . $pathinfo['filename'] : $pathinfo['filename'];

            if (!is_int(array_search($sFilePath, $aFiles))) {
                $key = array_search($sFilePath, $aFiles);
            }

            if (!is_null(Arr::get(static::$aSettings, $key))) {
                static::set($key, Arr::merge(static::get($key), include $sFilePath));
            } elseif (is_file($sFilePath)) {
                static::set($key, include $sFilePath);
            }
        }

        return static::getInstance();
    }
public static function load ( $ mPath , $ sNamespace = null ) { # Check if $mPath is an array of path if ( is_array ( $ mPath ) && ! empty ( $ mPath ) ) { $ aFiles = $ mPath ; } elseif ( strpos ( $ mPath , '.' ) > 0 && ! is_null ( Arr :: get ( static :: $ aSettings , $ mPath ) ) ) { $ tmp = Arr :: get ( static :: $ aSettings , $ mPath ) ; $ aFiles = glob ( substr ( $ tmp , - 1 ) === '/' ? $ tmp . '*.php' : $ tmp ) ; } else { $ aFiles = glob ( substr ( $ mPath , - 1 ) === '/' ? $ mPath . '*.php' : $ mPath ) ; } foreach ( $ aFiles as $ sFilePath ) { $ pathinfo = pathinfo ( $ sFilePath ) ; $ key = ! is_null ( $ sNamespace ) ? $ sNamespace . '.' . $ pathinfo [ 'filename' ] : $ pathinfo [ 'filename' ] ; if ( ! is_int ( array_search ( $ sFilePath , $ aFiles ) ) ) { $ key = array_search ( $ sFilePath , $ aFiles ) ; } if ( ! is_null ( Arr :: get ( static :: $ aSettings , $ key ) ) ) { static :: set ( $ key , Arr :: merge ( static :: get ( $ key ) , include $ sFilePath ) ) ; } elseif ( is_file ( $ sFilePath ) ) { static :: set ( $ key , include $ sFilePath ) ; } } return static :: getInstance ( ) ; }
Load single or multiple file configuration.

@param string $mPath      Array of path or string
@param string $sNamespace String used as reference (ex. Config::get('namespace.paths.classes'))

@return object

@example
Config::instance()->load('paths.adapters', 'defaults'); // dot-notated query url in configuration paths
Config::instance()->load('some/path/to/your/configuration/file.php');
Config::instance()->load('some/path/to/your/configuration/folder/');
Load single or multiple file configuration .