LogicException
Cache can only be a string, false, or a \Twig\Cache\CacheInterface implementation. LogicException thrown with message "Cache can only be a string, false, or a \Twig\Cache\CacheInterface implementation." Stacktrace: #8 LogicException in /home1/nrcqrtmy/public_html/wp-content/plugins/gantry5/vendor/twig/twig/src/Environment.php:274 #7 Twig\Environment:setCache in /home1/nrcqrtmy/public_html/wp-content/plugins/gantry5/vendor/twig/twig/src/Environment.php:125 #6 Twig\Environment:__construct in /home1/nrcqrtmy/public_html/wp-content/plugins/gantry5/src/classes/Gantry/Component/Theme/AbstractTheme.php:152 #5 Gantry\Component\Theme\AbstractTheme:renderer in /home1/nrcqrtmy/public_html/wp-content/plugins/gantry5/src/classes/Gantry/Framework/Theme.php:125 #4 Gantry\Framework\Theme:renderer in /home1/nrcqrtmy/public_html/wp-content/plugins/gantry5/src/classes/Gantry/Framework/Theme.php:155 #3 Gantry\Framework\Theme:render in /home1/nrcqrtmy/public_html/wp-content/themes/g5_helium/page.php:41 #2 include in /home1/nrcqrtmy/public_html/wp-includes/template-loader.php:125 #1 require_once in /home1/nrcqrtmy/public_html/wp-blog-header.php:19 #0 require in /home1/nrcqrtmy/public_html/index.php:17
Stack frames (9)
8
LogicException
/vendor/twig/twig/src/Environment.php274
7
Twig\Environment setCache
/vendor/twig/twig/src/Environment.php125
6
Twig\Environment __construct
/src/classes/Gantry/Component/Theme/AbstractTheme.php152
5
Gantry\Component\Theme\AbstractTheme renderer
/src/classes/Gantry/Framework/Theme.php125
4
Gantry\Framework\Theme renderer
/src/classes/Gantry/Framework/Theme.php155
3
Gantry\Framework\Theme render
/home1/nrcqrtmy/public_html/wp-content/themes/g5_helium/page.php41
2
include
/home1/nrcqrtmy/public_html/wp-includes/template-loader.php125
1
require_once
/home1/nrcqrtmy/public_html/wp-blog-header.php19
0
require
/home1/nrcqrtmy/public_html/index.php17
 
    /**
     * Sets the current cache implementation.
     *
     * @param CacheInterface|string|false $cache A Twig\Cache\CacheInterface implementation,
     *                                           an absolute path to the compiled templates,
     *                                           or false to disable cache
     */
    public function setCache($cache)
    {
        if (\is_string($cache)) {
            $this->originalCache = $cache;
            $this->cache = new FilesystemCache($cache, $this->autoReload ? FilesystemCache::FORCE_BYTECODE_INVALIDATION : 0);
        } elseif (false === $cache) {
            $this->originalCache = $cache;
            $this->cache = new NullCache();
        } elseif ($cache instanceof CacheInterface) {
            $this->originalCache = $this->cache = $cache;
        } else {
            throw new \LogicException('Cache can only be a string, false, or a \Twig\Cache\CacheInterface implementation.');
        }
    }
 
    /**
     * Gets the template class associated with the given string.
     *
     * The generated template class is based on the following parameters:
     *
     *  * The cache key for the given template;
     *  * The currently enabled extensions;
     *  * Whether the Twig C extension is available or not;
     *  * PHP version;
     *  * Twig version;
     *  * Options with what environment was created.
     *
     * @param string   $name  The name for which to calculate the template class name
     * @param int|null $index The index if it is an embedded template
     *
     * @return string The template class name
     *
        $options = array_merge([
            'debug' => false,
            'charset' => 'UTF-8',
            'base_template_class' => Template::class,
            'strict_variables' => false,
            'autoescape' => 'html',
            'cache' => false,
            'auto_reload' => null,
            'optimizations' => -1,
        ], $options);
 
        $this->debug = (bool) $options['debug'];
        $this->setCharset($options['charset']);
        $this->baseTemplateClass = '\\'.ltrim($options['base_template_class'], '\\');
        if ('\\'.Template::class !== $this->baseTemplateClass && '\Twig_Template' !== $this->baseTemplateClass) {
            @trigger_error('The "base_template_class" option on '.__CLASS__.' is deprecated since Twig 2.7.0.', \E_USER_DEPRECATED);
        }
        $this->autoReload = null === $options['auto_reload'] ? $this->debug : (bool) $options['auto_reload'];
        $this->strictVariables = (bool) $options['strict_variables'];
        $this->setCache($options['cache']);
        $this->extensionSet = new ExtensionSet();
 
        $this->addExtension(new CoreExtension());
        $this->addExtension(new EscaperExtension($options['autoescape']));
        $this->addExtension(new OptimizerExtension($options['optimizations']));
    }
 
    /**
     * Gets the base template class for compiled templates.
     *
     * @return string The base template class name
     */
    public function getBaseTemplateClass()
    {
        if (1 > \func_num_args() || \func_get_arg(0)) {
            @trigger_error('The '.__METHOD__.' is deprecated since Twig 2.7.0.', \E_USER_DEPRECATED);
        }
 
        return $this->baseTemplateClass;
    }
                    // Twig 3 support.
                    $cache = new FilesystemCache($cachePath, FilesystemCache::FORCE_BYTECODE_INVALIDATION);
                /** @phpstan-ignore-next-line */
                } else {
                    $cache = new TwigCacheFilesystem($cachePath, FilesystemCache::FORCE_BYTECODE_INVALIDATION);
                }
            } else {
                $cache = null;
            }
            $debug = $gantry->debug();
            $production = (bool) $global->get('production', 1);
            $loader = new FilesystemLoader();
            $params = [
                'cache' => $cache,
                'debug' => $debug,
                'auto_reload' => !$production,
                'autoescape' => 'html'
            ];
 
            $twig = new Environment($loader, $params);
 
            $this->setTwigLoaderPaths($loader);
 
            if ($debug) {
                $twig->addExtension(new DebugExtension());
            }
 
            $this->renderer = $this->extendTwig($twig, $loader);
        }
 
        return $this->renderer;
    }
 
    /**
     * Render a template file by using given context.
     *
     * @param string $file
     * @param array $context
     * @return string
     */
     * Convert all stream uris into proper links.
     */
    public function postProcessOutput($html)
    {
        $gantry = Gantry::instance();
 
        /** @var Document $document */
        $document = $gantry['document'];
 
        // Only filter our streams. If there's an error (bad UTF8), fallback with original output.
        return $document::urlFilter($html, false, 0, true) ?: $html;
    }
 
    /**
     * @see AbstractTheme::renderer()
     */
    public function renderer()
    {
        if (!$this->renderer) {
            $twig = parent::renderer();
            $twig = \apply_filters('twig_apply_filters', $twig);
            $twig = \apply_filters('timber/twig/filters', $twig);
            $twig = \apply_filters('timber/twig/functions', $twig);
            $twig = \apply_filters('timber/twig/escapers', $twig);
            $twig = \apply_filters('timber/loader/twig', $twig);
            $this->renderer = $twig;
        }
 
        return $this->renderer;
    }
 
    /**
     * @see AbstractTheme::render()
     *
     * @param string $file
     * @param array $context
     * @return string
     */
    public function render($file, array $context = [])
    {
 
    /**
     * @see AbstractTheme::render()
     *
     * @param string $file
     * @param array $context
     * @return string
     */
    public function render($file, array $context = [])
    {
        static $timberContext;
 
        if (!isset($timberContext)) {
            $timberContext = Timber::get_context();
        }
 
        // Include Gantry specific things to the context.
        $context = array_replace($timberContext, $context);
 
        return $this->renderer()->render($file, $context);
    }
 
    public function set_template_layout()
    {
        $assignments = new Assignments();
        $selected = $assignments->select();
 
        if (\GANTRY_DEBUGGER) {
            Debugger::addMessage('Selecting outline (rules, matches, scores):', 'debug');
            Debugger::addMessage($assignments->getPage(), 'debug');
            Debugger::addMessage($assignments->matches(), 'debug');
            Debugger::addMessage($assignments->scores(), 'debug');
        }
 
        $this->setLayout($selected);
    }
 
    public function widgets_init()
    {
        $gantry = Gantry::instance();
 * Please note that this is the WordPress construct of pages
 * and that other 'pages' on your WordPress site will use a
 * different template.
 *
 * To generate specific templates for your pages you can use:
 * /mytheme/views/page-mypage.html.twig
 * (which will still route through this PHP file)
 * OR
 * /mytheme/page-mypage.php
 * (in which case you'll want to duplicate this file and save to the above path)
 */
 
$gantry = Gantry::instance();
 
/** @var Theme $theme */
$theme  = $gantry['theme'];
 
// We need to render contents of <head> before plugin content gets added.
$context              = Timber::get_context();
$context['page_head'] = $theme->render('partials/page_head.html.twig', $context);
 
$post            = Timber::query_post();
$context['post'] = $post;
 
Timber::render(['page-' . $post->post_name . '.html.twig', 'page.html.twig'], $context);
 
 
    /**
     * Filters the path of the current template before including it.
     *
     * @since 3.0.0
     *
     * @param string $template The path of the template to include.
     */
    $template = apply_filters( 'template_include', $template );
    if ( $template ) {
        /**
         * Fires immediately before including the template.
         *
         * @since 6.9.0
         *
         * @param string $template The path of the template about to be included.
         */
        do_action( 'wp_before_include_template', $template );
 
        include $template;
    } elseif ( current_user_can( 'switch_themes' ) ) {
        $theme = wp_get_theme();
        if ( $theme->errors() ) {
            wp_die( $theme->errors() );
        }
    }
    return;
}
 
<?php
/**
 * Loads the WordPress environment and template.
 *
 * @package WordPress
 */
 
if ( ! isset( $wp_did_header ) ) {
 
    $wp_did_header = true;
 
    // Load the WordPress library.
    require_once __DIR__ . '/wp-load.php';
 
    // Set up the WordPress query.
    wp();
 
    // Load the theme template.
    require_once ABSPATH . WPINC . '/template-loader.php';
 
}
 
<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */
 
/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define( 'WP_USE_THEMES', true );
 
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';
 

Environment & details:

empty
empty
empty
Key Value
_cfuvid ew0tMhUA2_4mZdBlr2J_OMtEg9jQlfZ3xXXCo1XAy.E-1772844985646-0.0.1.1-604800000
__cf_bm xMkAuDddOzMzfX6E0QsB54wDzC.gKO6AlTlCXWGsmdk-1772844985-1.0.1.1-DW1hLxow0d3dCu.roRCEi8DyKLh7w_bkFlUy1A0DHDB6UhR5nHiVNcDcm8YzA4bqNl9qvaSYf0UvsYMniL8jUaPUhA1RiYPgNHWdcSpK.jA
empty
Key Value
SERVER_SOFTWARE Apache
REQUEST_URI /
LSPHP_ENABLE_USER_INI on
PATH /usr/local/bin:/usr/bin:/bin
TEMP /tmp
TMP /tmp
TMPDIR /tmp
PWD /
HTTP_ACCEPT */*
HTTP_ACCEPT_ENCODING gzip, br
HTTP_CONNECTION
CONTENT_LENGTH 0
HTTP_COOKIE _cfuvid=ew0tMhUA2_4mZdBlr2J_OMtEg9jQlfZ3xXXCo1XAy.E-1772844985646-0.0.1.1-604800000; __cf_bm=xMkAuDddOzMzfX6E0QsB54wDzC.gKO6AlTlCXWGsmdk-1772844985-1.0.1.1-DW1hLxow0d3dCu.roRCEi8DyKLh7w_bkFlUy1A0DHDB6UhR5nHiVNcDcm8YzA4bqNl9qvaSYf0UvsYMniL8jUaPUhA1RiYPgNHWdcSpK.jA
HTTP_HOST gunflintwild.com
HTTP_USER_AGENT Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected])
HTTP_X_FORWARDED_FOR 216.73.216.34
HTTP_CF_RAY 9d85a3e85e2ba151-LAX
HTTP_CF_IPCOUNTRY US
HTTP_CF_CONNECTING_IP 216.73.216.34
HTTP_CF_DEVICE_TYPE desktop
HTTP_X_FORWARDED_PROTO https
HTTP_CDN_LOOP cloudflare; loops=1
HTTP_CF_VISITOR {\"scheme\":\"https\"}
HTTP_X_REAL_IP 216.73.216.34
HTTP_X_EIG_ORIGIN 162.241.217.105
HTTP_X_HTTPS 1
UNIQUE_ID aat3uUlrpegtDz1DUNoxPQAAMCg
QS_ConnectionId 1772844985734079281033505
no-proxy 1
SCRIPT_URL /
SCRIPT_URI https://gunflintwild.com/
HTTP_AUTHORIZATION
CF_OPT 1
HTTPS on
SSL_TLS_SNI gunflintwild.com
HTTP2 on
H2PUSH off
H2_PUSH off
H2_PUSHED
H2_PUSHED_ON
H2_STREAM_ID 1
H2_STREAM_TAG 1033505-1438-1
SERVER_SIGNATURE
SERVER_NAME gunflintwild.com
SERVER_ADDR 10.36.226.156
SERVER_PORT 443
REMOTE_ADDR 216.73.216.34
DOCUMENT_ROOT /home1/nrcqrtmy/public_html
REQUEST_SCHEME https
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT /home1/nrcqrtmy/public_html
SERVER_ADMIN [email protected]
SCRIPT_FILENAME /home1/nrcqrtmy/public_html/index.php
REMOTE_PORT 59778
SERVER_PROTOCOL HTTP/2.0
REQUEST_METHOD GET
QUERY_STRING
SCRIPT_NAME /index.php
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1772844985.7482
REQUEST_TIME 1772844985
argv Array ( )
argc 0
empty
0. Whoops\Handler\PrettyPageHandler