Twig \ Error \ RuntimeError
An exception has been thrown during the rendering of a template ("file_get_contents(): Filename cannot be empty").
Previous exceptions
  • file_get_contents(): Filename cannot be empty (2)
Twig\Error\RuntimeError thrown with message "An exception has been thrown during the rendering of a template ("file_get_contents(): Filename cannot be empty")." Stacktrace: #22 Twig\Error\RuntimeError in /var/www/html/public/content/themes/pbc/templates/single.twig:55 #21 Whoops\Exception\ErrorException in /var/www/html/vendor/timber/timber/lib/ImageHelper.php:387 #20 file_get_contents in /var/www/html/vendor/timber/timber/lib/ImageHelper.php:387 #19 Timber\ImageHelper:sideload_image in /var/www/html/vendor/timber/timber/lib/ImageHelper.php:586 #18 Timber\ImageHelper:_operate in /var/www/html/vendor/timber/timber/lib/ImageHelper.php:72 #17 Timber\ImageHelper:resize in /var/www/html/vendor/twig/twig/src/Environment.php:418 #16 __TwigTemplate_b6651accc96329812a0762040fbc1ff99b6e81a113ebc635abbe86a76f324087:block_content in /var/www/html/vendor/twig/twig/src/Template.php:182 #15 Twig\Template:displayBlock in /var/www/html/vendor/twig/twig/src/Environment.php:418 #14 __TwigTemplate_848e378ffe94bcf5ff867ea0191989a8be9680e8ad5fc3f1a6cc7bde47724e3d:doDisplay in /var/www/html/vendor/twig/twig/src/Template.php:405 #13 Twig\Template:displayWithErrorHandling in /var/www/html/vendor/twig/twig/src/Template.php:378 #12 Twig\Template:display in /var/www/html/vendor/twig/twig/src/Environment.php:418 #11 __TwigTemplate_b6651accc96329812a0762040fbc1ff99b6e81a113ebc635abbe86a76f324087:doDisplay in /var/www/html/vendor/twig/twig/src/Template.php:405 #10 Twig\Template:displayWithErrorHandling in /var/www/html/vendor/twig/twig/src/Template.php:378 #9 Twig\Template:display in /var/www/html/vendor/twig/twig/src/Template.php:390 #8 Twig\Template:render in /var/www/html/vendor/twig/twig/src/TemplateWrapper.php:45 #7 Twig\TemplateWrapper:render in /var/www/html/vendor/timber/timber/lib/Loader.php:79 #6 Timber\Loader:render in /var/www/html/vendor/timber/timber/lib/Timber.php:334 #5 Timber\Timber:compile in /var/www/html/vendor/timber/timber/lib/Timber.php:383 #4 Timber\Timber:fetch in /var/www/html/vendor/timber/timber/lib/Timber.php:410 #3 Timber\Timber:render in /var/www/html/public/content/themes/pbc/single.php:156 #2 include in /var/www/html/public/wordpress/wp-includes/template-loader.php:106 #1 require_once in /var/www/html/public/wordpress/wp-blog-header.php:19 #0 require in /var/www/html/public/index.php:14
22
Twig\Error\RuntimeError
/public/content/themes/pbc/templates/single.twig55
21
Whoops\Exception\ErrorException
/vendor/timber/timber/lib/ImageHelper.php387
20
file_get_contents
/vendor/timber/timber/lib/ImageHelper.php387
19
Timber\ImageHelper sideload_image
/vendor/timber/timber/lib/ImageHelper.php586
18
Timber\ImageHelper _operate
/vendor/timber/timber/lib/ImageHelper.php72
17
Timber\ImageHelper resize
/vendor/twig/twig/src/Environment.php418
16
__TwigTemplate_b6651accc96329812a0762040fbc1ff99b6e81a113ebc635abbe86a76f324087 block_content
/vendor/twig/twig/src/Template.php182
15
Twig\Template displayBlock
/vendor/twig/twig/src/Environment.php418
14
__TwigTemplate_848e378ffe94bcf5ff867ea0191989a8be9680e8ad5fc3f1a6cc7bde47724e3d doDisplay
/vendor/twig/twig/src/Template.php405
13
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php378
12
Twig\Template display
/vendor/twig/twig/src/Environment.php418
11
__TwigTemplate_b6651accc96329812a0762040fbc1ff99b6e81a113ebc635abbe86a76f324087 doDisplay
/vendor/twig/twig/src/Template.php405
10
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php378
9
Twig\Template display
/vendor/twig/twig/src/Template.php390
8
Twig\Template render
/vendor/twig/twig/src/TemplateWrapper.php45
7
Twig\TemplateWrapper render
/vendor/timber/timber/lib/Loader.php79
6
Timber\Loader render
/vendor/timber/timber/lib/Timber.php334
5
Timber\Timber compile
/vendor/timber/timber/lib/Timber.php383
4
Timber\Timber fetch
/vendor/timber/timber/lib/Timber.php410
3
Timber\Timber render
/public/content/themes/pbc/single.php156
2
include
/public/wordpress/wp-includes/template-loader.php106
1
require_once
/public/wordpress/wp-blog-header.php19
0
require
/public/index.php14
/var/www/html/public/content/themes/pbc/templates/single.twig
                    {% if post.thumbnail and not long and post.category != 'Cartoons' and post.category != 'Endgames' %}
                        <div class="blog__thumbnail">
                            <img src="{{post.thumbnail.src}}" alt="{{post.thumbnail.alt}}"/>
                            <p id="caption-attachment-{{post.thumbnail.id}}" class="wp-caption-text"><strong>{{post.thumbnail.caption}}</strong></p>
                        </div>
 
                    {% endif %}
 
                    {% if post.category == 'Endgames' %}
                        <div class="puzzle-section">
                            {% if puzzle_embed %}
                                <iframe src="{{puzzle_embed}}" style="width:100%; height:1000px;" frameborder="0"></iframe>
                            {% else %}
                                {% include '@atoms/image.twig' with {item: post.custom.download_file} %}
                            {% endif %}
                            <a href="{{puzzle_embed}}" class="button puzzle--button button--offer" download>Download the puzzles here</a>
                        </div>
                    {% endif %}
 
                    {% if post.sponsored  and post.sponsor_name %}<div class="blog-header__info-box"><p>This article was produced in association with {{post.sponsor_name}}</p>{% if post.sponsors_logo %}<img src="{{post.sponsors_logo.guid | resize(200)}}" class="blog-header__info-box__image" />{% endif %}</div> {% endif %}
 
 
                    <div class="blog__main{% if post.thumbnail and long %} blog__main--longtext{% endif %}">
                        {{ post.content }}
                    </div>
 
                    {% include 'components/blog-letters.twig' %}
                    {% for author in post.get_authors %}
                        {% include 'components/blog-byline.twig' with {author: author} %}
                    {% endfor %}
 
                </div>
                <aside class="blog__sidebar{% if long %} blog__sidebar--longread{% endif %}">
                    {{sidebar}}
                </aside>
            </div>
        </div>
    </section>
{% endblock %}
{% block pre_footer %}
/var/www/html/vendor/timber/timber/lib/ImageHelper.php
        $loc = self::get_sideloaded_file_loc($file);
        if ( file_exists($loc) ) {
            return URLHelper::file_system_to_url($loc);
        }
        // Download file to temp location
        if ( !function_exists('download_url') ) {
            require_once ABSPATH.'/wp-admin/includes/file.php';
        }
        $tmp = download_url($file);
        preg_match('/[^\?]+\.(jpe?g|jpe|gif|png)\b/i', $file, $matches);
        $file_array = array();
        $file_array['name'] = PathHelper::basename($matches[0]);
        $file_array['tmp_name'] = $tmp;
        // If error storing temporarily, do not use
        if ( is_wp_error($tmp) ) {
            $file_array['tmp_name'] = '';
        }
        // do the validation and storage stuff
        $locinfo = PathHelper::pathinfo($loc);
        $file = wp_upload_bits($locinfo['basename'], null, file_get_contents($file_array['tmp_name']));
        // delete tmp file
        @unlink($file_array['tmp_name']);
        return $file['url'];
    }
 
    /**
     * Takes in an URL and breaks it into components,
     * that will then be used in the different steps of image processing.
     * The image is expected to be either part of a theme, plugin, or an upload.
     *
     * @param  string $url an URL (absolute or relative) pointing to an image
     * @return array       an array (see keys in code below)
     */
    public static function analyze_url( $url ) {
        $result = array(
            'url' => $url, // the initial url
            'absolute' => URLHelper::is_absolute($url), // is the url absolute or relative (to home_url)
            'base' => 0, // is the image in uploads dir, or in content dir (theme or plugin)
            'subdir' => '', // the path between base (uploads or content) and file
            'filename' => '', // the filename, without extension
Exception message: file_get_contents(): Filename cannot be empty
/var/www/html/vendor/timber/timber/lib/ImageHelper.php
        $loc = self::get_sideloaded_file_loc($file);
        if ( file_exists($loc) ) {
            return URLHelper::file_system_to_url($loc);
        }
        // Download file to temp location
        if ( !function_exists('download_url') ) {
            require_once ABSPATH.'/wp-admin/includes/file.php';
        }
        $tmp = download_url($file);
        preg_match('/[^\?]+\.(jpe?g|jpe|gif|png)\b/i', $file, $matches);
        $file_array = array();
        $file_array['name'] = PathHelper::basename($matches[0]);
        $file_array['tmp_name'] = $tmp;
        // If error storing temporarily, do not use
        if ( is_wp_error($tmp) ) {
            $file_array['tmp_name'] = '';
        }
        // do the validation and storage stuff
        $locinfo = PathHelper::pathinfo($loc);
        $file = wp_upload_bits($locinfo['basename'], null, file_get_contents($file_array['tmp_name']));
        // delete tmp file
        @unlink($file_array['tmp_name']);
        return $file['url'];
    }
 
    /**
     * Takes in an URL and breaks it into components,
     * that will then be used in the different steps of image processing.
     * The image is expected to be either part of a theme, plugin, or an upload.
     *
     * @param  string $url an URL (absolute or relative) pointing to an image
     * @return array       an array (see keys in code below)
     */
    public static function analyze_url( $url ) {
        $result = array(
            'url' => $url, // the initial url
            'absolute' => URLHelper::is_absolute($url), // is the url absolute or relative (to home_url)
            'base' => 0, // is the image in uploads dir, or in content dir (theme or plugin)
            'subdir' => '', // the path between base (uploads or content) and file
            'filename' => '', // the filename, without extension
/var/www/html/vendor/timber/timber/lib/ImageHelper.php
     * @param  object  $op    object of class TimberImageOperation
     * @param  boolean $force if true, remove any already existing result file and forces file generation
     * @return string         URL to the new image - or the source one if error
     *
     */
    private static function _operate( $src, $op, $force = false ) {
        if ( empty($src) ) {
            return '';
        }
 
        $allow_fs_write = apply_filters('timber/allow_fs_write', true);
 
        if ( $allow_fs_write === false ) {
            return $src;
        }
        
        $external = false;
        // if external image, load it first
        if ( URLHelper::is_external_content($src) ) {
            $src = self::sideload_image($src);
            $external = true;
        }
 
        // break down URL into components
        $au = self::analyze_url($src);
 
        // build URL and filenames
        $new_url = self::_get_file_url(
            $au['base'],
            $au['subdir'],
            $op->filename($au['filename'], $au['extension']),
            $au['absolute']
        );
        $destination_path = self::_get_file_path(
            $au['base'],
            $au['subdir'],
            $op->filename($au['filename'], $au['extension'])
        );
        $source_path = self::_get_file_path(
            $au['base'],
/var/www/html/vendor/timber/timber/lib/ImageHelper.php
     * @example
     * ```twig
     * <img src="{{ image.src | resize(300, 200, 'top') }}" />
     * ```
     * ```html
     * <img src="http://example.org/wp-content/uploads/pic-300x200-c-top.jpg" />
     * ```
     * @return string (ex: )
     */
    public static function resize( $src, $w, $h = 0, $crop = 'default', $force = false ) {
        if ( !is_numeric($w) && is_string($w) ) {
            if ( $sizes = self::find_wp_dimensions($w) ) {
                $w = $sizes['w'];
                $h = $sizes['h'];
            } else {
                return $src;
            }
        }
        $op = new Image\Operation\Resize($w, $h, $crop);
        return self::_operate($src, $op, $force);
    }
 
    /**
     * Find the sizes of an image based on a defined image size
     * @param  string $size the image size to search for
     *                      can be WordPress-defined ("medium")
     *                      or user-defined ("my-awesome-size")
     * @return false|array {
     *     @type int w
     *     @type int h
     * }
     */
    private static function find_wp_dimensions( $size ) {
        global $_wp_additional_image_sizes;
        if ( isset($_wp_additional_image_sizes[$size]) ) {
            $w = $_wp_additional_image_sizes[$size]['width'];
            $h = $_wp_additional_image_sizes[$size]['height'];
        } else if ( in_array($size, array('thumbnail', 'medium', 'large')) ) {
            $w = get_option($size.'_size_w');
            $h = get_option($size.'_size_h');
/var/www/html/vendor/twig/twig/src/Environment.php
            $key = $this->cache->generateKey($name, $mainCls);
 
            if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
                $this->cache->load($key);
            }
 
            $source = null;
            if (!class_exists($cls, false)) {
                $source = $this->getLoader()->getSourceContext($name);
                $content = $this->compileSource($source);
                $this->cache->write($key, $content);
                $this->cache->load($key);
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
 
                if (!class_exists($cls, false)) {
                    throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
                }
            }
        }
 
        // to be removed in 3.0
        $this->extensionSet->initRuntime($this);
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
     * @param string $template The template source
/var/www/html/vendor/twig/twig/src/Template.php
    {
        if ($useBlocks && isset($blocks[$name])) {
            $template = $blocks[$name][0];
            $block = $blocks[$name][1];
        } elseif (isset($this->blocks[$name])) {
            $template = $this->blocks[$name][0];
            $block = $this->blocks[$name][1];
        } else {
            $template = null;
            $block = null;
        }
 
        // avoid RCEs when sandbox is enabled
        if (null !== $template && !$template instanceof self) {
            throw new \LogicException('A block must be a method on a \Twig\Template instance.');
        }
 
        if (null !== $template) {
            try {
                $template->$block($context, $blocks);
            } catch (Error $e) {
                if (!$e->getSourceContext()) {
                    $e->setSourceContext($template->getSourceContext());
                }
 
                // this is mostly useful for \Twig\Error\LoaderError exceptions
                // see \Twig\Error\LoaderError
                if (-1 === $e->getTemplateLine()) {
                    $e->guess();
                }
 
                throw $e;
            } catch (\Exception $e) {
                $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $template->getSourceContext(), $e);
                $e->guess();
 
                throw $e;
            }
        } elseif (false !== $parent = $this->getParent($context)) {
            $parent->displayBlock($name, $context, array_merge($this->blocks, $blocks), false, $templateContext ?? $this);
/var/www/html/vendor/twig/twig/src/Environment.php
            $key = $this->cache->generateKey($name, $mainCls);
 
            if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
                $this->cache->load($key);
            }
 
            $source = null;
            if (!class_exists($cls, false)) {
                $source = $this->getLoader()->getSourceContext($name);
                $content = $this->compileSource($source);
                $this->cache->write($key, $content);
                $this->cache->load($key);
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
 
                if (!class_exists($cls, false)) {
                    throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
                }
            }
        }
 
        // to be removed in 3.0
        $this->extensionSet->initRuntime($this);
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
     * @param string $template The template source
/var/www/html/vendor/twig/twig/src/Template.php
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
/var/www/html/vendor/twig/twig/src/Template.php
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
/var/www/html/vendor/twig/twig/src/Environment.php
            $key = $this->cache->generateKey($name, $mainCls);
 
            if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
                $this->cache->load($key);
            }
 
            $source = null;
            if (!class_exists($cls, false)) {
                $source = $this->getLoader()->getSourceContext($name);
                $content = $this->compileSource($source);
                $this->cache->write($key, $content);
                $this->cache->load($key);
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
 
                if (!class_exists($cls, false)) {
                    throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
                }
            }
        }
 
        // to be removed in 3.0
        $this->extensionSet->initRuntime($this);
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
     * @param string $template The template source
/var/www/html/vendor/twig/twig/src/Template.php
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
/var/www/html/vendor/twig/twig/src/Template.php
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
/var/www/html/vendor/twig/twig/src/Template.php
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
/var/www/html/vendor/twig/twig/src/TemplateWrapper.php
     * directly (use Twig\Environment::load() instead).
     *
     * @internal
     */
    public function __construct(Environment $env, Template $template)
    {
        $this->env = $env;
        $this->template = $template;
    }
 
    /**
     * Renders the template.
     *
     * @param array $context An array of parameters to pass to the template
     */
    public function render(array $context = []): string
    {
        // using func_get_args() allows to not expose the blocks argument
        // as it should only be used by internal code
        return $this->template->render($context, \func_get_args()[1] ?? []);
    }
 
    /**
     * Displays the template.
     *
     * @param array $context An array of parameters to pass to the template
     */
    public function display(array $context = [])
    {
        // using func_get_args() allows to not expose the blocks argument
        // as it should only be used by internal code
        $this->template->display($context, \func_get_args()[1] ?? []);
    }
 
    /**
     * Checks if a block is defined.
     *
     * @param string $name    The block name
     * @param array  $context An array of parameters to pass to the template
     */
/var/www/html/vendor/timber/timber/lib/Loader.php
 
        $key = null;
        $output = false;
        if ( false !== $expires ) {
            ksort($data);
            $key = md5($file.json_encode($data));
            $output = $this->get_cache($key, self::CACHEGROUP, $cache_mode);
        }
 
        if ( false === $output || null === $output ) {
            $twig = $this->get_twig();
            if ( strlen($file) ) {
                $loader = $this->get_loader();
                $result = $loader->getCacheKey($file);
                do_action('timber_loader_render_file', $result);
            }
            $data = apply_filters('timber_loader_render_data', $data);
            $data = apply_filters('timber/loader/render_data', $data, $file);
            $template = $twig->load($file);
            $output = $template->render($data);
        }
 
        if ( false !== $output && false !== $expires && null !== $key ) {
            $this->delete_cache();
            $this->set_cache($key, $output, self::CACHEGROUP, $expires, $cache_mode);
        }
        $output = apply_filters('timber_output', $output);
        return apply_filters('timber/output', $output, $data, $file);
    }
 
    protected function delete_cache() {
        Cleaner::delete_transients();
    }
 
    /**
     * Get first existing template.
     *
     * @param array|string $templates  Name(s) of the Twig template(s) to choose from.
     * @return string|bool             Name of chosen template, otherwise false.
     */
/var/www/html/vendor/timber/timber/lib/Timber.php
        if ( $via_render ) {
            $file = apply_filters('timber_render_file', $file);
        } else {
            $file = apply_filters('timber_compile_file', $file);
        }
 
        $output = false;
 
        if ($file !== false) {
            if ( is_null($data) ) {
                $data = array();
            }
 
            if ( $via_render ) {
                $data = apply_filters('timber_render_data', $data);
            } else {
                $data = apply_filters('timber_compile_data', $data);
            }
 
            $output = $loader->render($file, $data, $expires, $cache_mode);
        } else {
            if ( is_array($filenames) ) {
                $filenames = implode(", ", $filenames);
            }
            Helper::error_log( 'Error loading your template files: '.$filenames.'. Make sure one of these files exists.' );
        }
 
        do_action('timber_compile_done');
        return $output;
    }
 
    /**
     * Compile a string.
     *
     * @api
     * @example
     * ```php
     * $data = array(
     *     'username' => 'Jane Doe',
     * );
/var/www/html/vendor/timber/timber/lib/Timber.php
        $twig = $dummy_loader->get_twig();
        $template = $twig->createTemplate($string);
        return $template->render($data);
    }
 
    /**
     * Fetch function.
     *
     * @api
     * @param array|string $filenames  Name of the Twig file to render. If this is an array of files, Timber will
     *                                 render the first file that exists.
     * @param array        $data       Optional. An array of data to use in Twig template.
     * @param bool|int     $expires    Optional. In seconds. Use false to disable cache altogether. When passed an
     *                                 array, the first value is used for non-logged in visitors, the second for users.
     *                                 Default false.
     * @param string       $cache_mode Optional. Any of the cache mode constants defined in TimberLoader.
     * @return bool|string The returned output.
     */
    public static function fetch( $filenames, $data = array(), $expires = false, $cache_mode = Loader::CACHE_USE_DEFAULT ) {
        $output = self::compile($filenames, $data, $expires, $cache_mode, true);
        $output = apply_filters('timber_compile_result', $output);
        return $output;
    }
 
    /**
     * Render function.
     *
     * Passes data to a Twig file and echoes the output.
     *
     * @api
     * @example
     * ```php
     * $context = Timber::context();
     *
     * Timber::render( 'index.twig', $context );
     * ```
     * @param array|string $filenames  Name of the Twig file to render. If this is an array of files, Timber will
     *                                 render the first file that exists.
     * @param array        $data       Optional. An array of data to use in Twig template.
     * @param bool|int     $expires    Optional. In seconds. Use false to disable cache altogether. When passed an
/var/www/html/vendor/timber/timber/lib/Timber.php
     * Passes data to a Twig file and echoes the output.
     *
     * @api
     * @example
     * ```php
     * $context = Timber::context();
     *
     * Timber::render( 'index.twig', $context );
     * ```
     * @param array|string $filenames  Name of the Twig file to render. If this is an array of files, Timber will
     *                                 render the first file that exists.
     * @param array        $data       Optional. An array of data to use in Twig template.
     * @param bool|int     $expires    Optional. In seconds. Use false to disable cache altogether. When passed an
     *                                 array, the first value is used for non-logged in visitors, the second for users.
     *                                 Default false.
     * @param string       $cache_mode Optional. Any of the cache mode constants defined in TimberLoader.
     * @return bool|string The echoed output.
     */
    public static function render( $filenames, $data = array(), $expires = false, $cache_mode = Loader::CACHE_USE_DEFAULT ) {
        $output = self::fetch($filenames, $data, $expires, $cache_mode);
        echo $output;
        return $output;
    }
 
    /**
     * Render a string with Twig variables.
     *
     * @api
     * @example
     * ```php
     * $data = array(
     *     'username' => 'Jane Doe',
     * );
     *
     * Timber::render_string( 'Hi {{ username }}, I’m a string with a custom Twig variable', $data );
     * ```
     * @param string $string A string with Twig variables.
     * @param array  $data   An array of data to use in Twig template.
     * @return bool|string
     */
/var/www/html/public/content/themes/pbc/single.php
 
if (!empty($issues)){
    $context['issue'] = $issues[0];
}else{
    $met = get_post_meta($post->ID,'_custom_post_type_onomies_relationship',true);
    if($met){
        $issues = Timber::get_posts([
            "post_type" => "issues",
            "post_status" => "publish",
            "posts_per_page" => 1,
            "post__in" => [$met]
        ]);
        if (!empty($issues)) $context['issue'] = $issues[0];
    }
}
 
if ( post_password_required( $post->ID ) ) {
    Timber::render( 'single-password.twig', $context );
} else {
    Timber::render( array( 'single-' . $post->ID . '.twig', 'single-' . $post->post_type . '.twig', 'single.twig' ), $context );
}
 
/var/www/html/public/wordpress/wp-includes/template-loader.php
            }
 
            break;
        }
    }
 
    if ( ! $template ) {
        $template = get_index_template();
    }
 
    /**
     * 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 ) {
        include $template;
    } elseif ( current_user_can( 'switch_themes' ) ) {
        $theme = wp_get_theme();
        if ( $theme->errors() ) {
            wp_die( $theme->errors() );
        }
    }
    return;
}
 
/var/www/html/public/wordpress/wp-blog-header.php
<?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';
 
}
 
/var/www/html/public/index.php
<?php
 
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
 
// WordPress view bootstrapper
define( 'WP_USE_THEMES', true );
 
// composer auto loader, symlinks all colliding, this should resolve the relative include paths correctly
//chdir( dirname ( realpath ( __FILE__ ) ) );
 
//require( '../vendor/autoload.php' );
require( './wordpress/wp-blog-header.php');

Environment & details:

empty
empty
empty
empty
Key Value
signup-auth 492197514607ceee189b800.72537585
Key Value
SERVER_SOFTWARE nginx/1.18.0
REQUEST_URI /sponsored/a-time-for-tech
USER nobody
HOME *
HTTP_ACCEPT_ENCODING br,gzip
HTTP_ACCEPT_LANGUAGE en-US,en;q=0.5
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_USER_AGENT CCBot/2.0 (https://commoncrawl.org/faq/)
HTTP_X_AMZN_TRACE_ID Root=1-607ceee1-6ee0d8a7515721cd629410c0
HTTP_HOST www.prospectmagazine.co.uk
HTTP_X_FORWARDED_PORT 443
HTTP_X_FORWARDED_PROTO https
HTTP_X_FORWARDED_FOR 18.207.129.82
REDIRECT_STATUS 200
SERVER_NAME _
SERVER_PORT 443
SERVER_ADDR 172.17.0.2
REMOTE_PORT 34854
REMOTE_ADDR 172.31.26.235
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT ********************
DOCUMENT_URI /index.php
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING
SCRIPT_FILENAME ******************************
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1618800353.3918
REQUEST_TIME 1618800353
COMPOSER_ALLOW_SUPERUSER *
DB_HOST *******************************************************************************
DB_HOST_RO prospect-live-new-cluster.cluster-ro-confjboupptb.eu-west-1.rds.amazonaws.com:3306
DB_NAME *************
DB_PASSWORD ******************
DB_USER ***************
FILE_SYSTEM_ID fs-89b1acbc
GOOGLE_AD_MANAGER_ACTIVE true
GOOGLE_AD_MANAGER_ID 21688349148
HOSTNAME ************
MAGICK_HOME ****
MOUNT_DIRECTORY /efs
PATH ************************************************************
PHP_INI_DIR *********
PWD *************
SESSION_SAVE_HANDLER redis
SHLVL *
WP_ENV **********
WP_HOME **********************************
WP_REDIS_HOST prospect-redis-cache.eui3wf.0001.euw1.cache.amazonaws.com
WP_SITEURL ********************************************
Key Value
COMPOSER_ALLOW_SUPERUSER *
DB_HOST *******************************************************************************
DB_HOST_RO prospect-live-new-cluster.cluster-ro-confjboupptb.eu-west-1.rds.amazonaws.com:3306
DB_NAME *************
DB_PASSWORD ******************
DB_USER ***************
FILE_SYSTEM_ID fs-89b1acbc
GOOGLE_AD_MANAGER_ACTIVE true
GOOGLE_AD_MANAGER_ID 21688349148
HOSTNAME ************
MAGICK_HOME ****
MOUNT_DIRECTORY /efs
PATH ************************************************************
PHP_INI_DIR *********
PWD *************
SESSION_SAVE_HANDLER redis
SHLVL *
WP_ENV **********
WP_HOME **********************************
WP_REDIS_HOST prospect-redis-cache.eui3wf.0001.euw1.cache.amazonaws.com
WP_SITEURL ********************************************
0. Whoops\Handler\PrettyPageHandler