public static function init_config($theme_root = null)
    {
        if (static::$setup === false) {
            $config = new Config();

            if ($theme_root === null) {
                $config_cache_path = \get_stylesheet_directory() . '/cache/config/' . \sha1(NONCE_SALT . 'theme');

                if (WP_DEBUG === false && \file_exists($config_cache_path)) {
                    $config->load_from_cache(\file_get_contents($config_cache_path));
                } else {
                    $config->add_path(\get_template_directory() . '/config');

                    if (\is_child_theme()) {
                        $config->add_path(\get_stylesheet_directory() . '/config');
                    }
                }
            }

            if ($theme_root !== null) {
                $config->add_path($theme_root . '/config');
            }

            static::$container->add_instance($config);
            static::$container->alias(Config::class, 'config');
        }
    }
public static function init_config($theme_root = null)
    {
        if (static::$setup === false) {
            $config = new Config();

            if ($theme_root === null) {
                $config_cache_path = \get_stylesheet_directory() . '/cache/config/' . \sha1(NONCE_SALT . 'theme');

                if (WP_DEBUG === false && \file_exists($config_cache_path)) {
                    $config->load_from_cache(\file_get_contents($config_cache_path));
                } else {
                    $config->add_path(\get_template_directory() . '/config');

                    if (\is_child_theme()) {
                        $config->add_path(\get_stylesheet_directory() . '/config');
                    }
                }
            }

            if ($theme_root !== null) {
                $config->add_path($theme_root . '/config');
            }

            static::$container->add_instance($config);
            static::$container->alias(Config::class, 'config');
        }
    }
public static function init_config ( $ theme_root = null ) { if ( static :: $ setup === false ) { $ config = new Config ( ) ; if ( $ theme_root === null ) { $ config_cache_path = \ get_stylesheet_directory ( ) . '/cache/config/' . \ sha1 ( NONCE_SALT . 'theme' ) ; if ( WP_DEBUG === false && \ file_exists ( $ config_cache_path ) ) { $ config -> load_from_cache ( \ file_get_contents ( $ config_cache_path ) ) ; } else { $ config -> add_path ( \ get_template_directory ( ) . '/config' ) ; if ( \ is_child_theme ( ) ) { $ config -> add_path ( \ get_stylesheet_directory ( ) . '/config' ) ; } } } if ( $ theme_root !== null ) { $ config -> add_path ( $ theme_root . '/config' ) ; } static :: $ container -> add_instance ( $ config ) ; static :: $ container -> alias ( Config :: class , 'config' ) ; } }
Create a config instance, provide config directories, and add to the container.

@since 1.0.0

@param string $theme_root Used by the publish command when not the current active theme.

@throws \Hodl\Exceptions\ContainerException
Create a config instance provide config directories and add to the container .