public function config($key = null)
    {
        $args = func_get_args(); // In PHP7, func_get_args() are changed by the time we use them, so we call it now
        if (is_null($this->config)) {
            $file = $this->folder.'config.yml';
            $this->config = (is_file($file)) ? (array) Yaml::parse(file_get_contents($file)) : array();
            $current = true;
            foreach (array(
                'blog' => array(
                    'name' => 'Another { BootPress } Site',
                    'image' => '',
                    'listings' => '',
                    'breadcrumb' => 'Blog',
                    'theme' => 'default',
                ),
            ) as $name => $config) {
                foreach ($config as $key => $val) {
                    if (!isset($this->config[$name][$key]) || !is_string($this->config[$name][$key]) || (empty($this->config[$name][$key]) && !empty($val))) {
                        $this->config[$name][$key] = $val;
                        $current = false;
                    }
                }
            }
            $page = Page::html();
            foreach (array('authors', 'categories', 'tags') as $param) {
                if (!isset($this->config[$param]) || !is_array($this->config[$param])) {
                    $this->config[$param] = array();
                    $current = false;
                }
                foreach ($this->config[$param] as $key => $val) {
                    if (is_string($val)) {
                        $this->config[$param][$key] = array('name' => $val);
                    }
                }
            }
            if (!$current) {
                file_put_contents($file, Yaml::dump($this->config, 3));
            }
        }
        $value = $this->config;
        foreach ($args as $key) {
            if (isset($value[$key])) {
                $value = $value[$key];
            } else {
                return;
            }
        }

        return $value;
    }
public function config($key = null)
    {
        $args = func_get_args(); // In PHP7, func_get_args() are changed by the time we use them, so we call it now
        if (is_null($this->config)) {
            $file = $this->folder.'config.yml';
            $this->config = (is_file($file)) ? (array) Yaml::parse(file_get_contents($file)) : array();
            $current = true;
            foreach (array(
                'blog' => array(
                    'name' => 'Another { BootPress } Site',
                    'image' => '',
                    'listings' => '',
                    'breadcrumb' => 'Blog',
                    'theme' => 'default',
                ),
            ) as $name => $config) {
                foreach ($config as $key => $val) {
                    if (!isset($this->config[$name][$key]) || !is_string($this->config[$name][$key]) || (empty($this->config[$name][$key]) && !empty($val))) {
                        $this->config[$name][$key] = $val;
                        $current = false;
                    }
                }
            }
            $page = Page::html();
            foreach (array('authors', 'categories', 'tags') as $param) {
                if (!isset($this->config[$param]) || !is_array($this->config[$param])) {
                    $this->config[$param] = array();
                    $current = false;
                }
                foreach ($this->config[$param] as $key => $val) {
                    if (is_string($val)) {
                        $this->config[$param][$key] = array('name' => $val);
                    }
                }
            }
            if (!$current) {
                file_put_contents($file, Yaml::dump($this->config, 3));
            }
        }
        $value = $this->config;
        foreach ($args as $key) {
            if (isset($value[$key])) {
                $value = $value[$key];
            } else {
                return;
            }
        }

        return $value;
    }
public function config ( $ key = null ) { $ args = func_get_args ( ) ; // In PHP7, func_get_args() are changed by the time we use them, so we call it now if ( is_null ( $ this -> config ) ) { $ file = $ this -> folder . 'config.yml' ; $ this -> config = ( is_file ( $ file ) ) ? ( array ) Yaml :: parse ( file_get_contents ( $ file ) ) : array ( ) ; $ current = true ; foreach ( array ( 'blog' => array ( 'name' => 'Another { BootPress } Site' , 'image' => '' , 'listings' => '' , 'breadcrumb' => 'Blog' , 'theme' => 'default' , ) , ) as $ name => $ config ) { foreach ( $ config as $ key => $ val ) { if ( ! isset ( $ this -> config [ $ name ] [ $ key ] ) || ! is_string ( $ this -> config [ $ name ] [ $ key ] ) || ( empty ( $ this -> config [ $ name ] [ $ key ] ) && ! empty ( $ val ) ) ) { $ this -> config [ $ name ] [ $ key ] = $ val ; $ current = false ; } } } $ page = Page :: html ( ) ; foreach ( array ( 'authors' , 'categories' , 'tags' ) as $ param ) { if ( ! isset ( $ this -> config [ $ param ] ) || ! is_array ( $ this -> config [ $ param ] ) ) { $ this -> config [ $ param ] = array ( ) ; $ current = false ; } foreach ( $ this -> config [ $ param ] as $ key => $ val ) { if ( is_string ( $ val ) ) { $ this -> config [ $ param ] [ $ key ] = array ( 'name' => $ val ) ; } } } if ( ! $ current ) { file_put_contents ( $ file , Yaml :: dump ( $ this -> config , 3 ) ) ; } } $ value = $ this -> config ; foreach ( $ args as $ key ) { if ( isset ( $ value [ $ key ] ) ) { $ value = $ value [ $ key ] ; } else { return ; } } return $ value ; }
Retrieves any config value found in the Blog's config.yml file.

@param string $key The config array key whose value you would like to retrieve.  For every arg you include we will keep working our way up the config array to find just what you are looking for.

@return mixed The config key(s) value, or null if not found.
Retrieves any config value found in the Blog s config . yml file .