private function load($file, $dir = '')
    {
        $path = config_path().'/'.$dir;
        $handle = opendir($path);
        $ignore = ['.', '..'];
        while ($f = readdir($handle)) {
            if (!in_array($f, $ignore)) {
                if (is_dir($path.$f)) {
                    if (file_exists($path.$f.'/'.$file.'.php')) {
                        return $this->load($file, $f);
                    }
                } else {
                    $filename = explode('.', $f)[0];
                    if ($filename == $file) {
                        return require $path.'/'.$f;
                    }
                }
            }
        }
        closedir($handle);

        return false;
    }
private function load($file, $dir = '')
    {
        $path = config_path().'/'.$dir;
        $handle = opendir($path);
        $ignore = ['.', '..'];
        while ($f = readdir($handle)) {
            if (!in_array($f, $ignore)) {
                if (is_dir($path.$f)) {
                    if (file_exists($path.$f.'/'.$file.'.php')) {
                        return $this->load($file, $f);
                    }
                } else {
                    $filename = explode('.', $f)[0];
                    if ($filename == $file) {
                        return require $path.'/'.$f;
                    }
                }
            }
        }
        closedir($handle);

        return false;
    }
private function load ( $ file , $ dir = '' ) { $ path = config_path ( ) . '/' . $ dir ; $ handle = opendir ( $ path ) ; $ ignore = [ '.' , '..' ] ; while ( $ f = readdir ( $ handle ) ) { if ( ! in_array ( $ f , $ ignore ) ) { if ( is_dir ( $ path . $ f ) ) { if ( file_exists ( $ path . $ f . '/' . $ file . '.php' ) ) { return $ this -> load ( $ file , $ f ) ; } } else { $ filename = explode ( '.' , $ f ) [ 0 ] ; if ( $ filename == $ file ) { return require $ path . '/' . $ f ; } } } } closedir ( $ handle ) ; return false ; }
Loads a configuration script.

@param string $file - The name of the config file to load
@param string $dir  - The sub directory to load into

@return mixed
Loads a configuration script .