Twig \ Error \ RuntimeError
An exception has been thrown during the rendering of a template ("Undefined array key 1").
Previous exceptions
  • Undefined array key 1 (2)
Twig\Error\RuntimeError thrown with message "An exception has been thrown during the rendering of a template ("Undefined array key 1")." Stacktrace: #22 Twig\Error\RuntimeError in /var/www/technexus/views/blog/post.twig:11 #21 Whoops\Exception\ErrorException in /var/www/technexus/src/Models/BlogPost.php:98 #20 Whoops\Run:handleError in /var/www/technexus/src/Models/BlogPost.php:98 #19 technexus\Models\BlogPost:getShareImage in /var/www/technexus/vendor/twig/twig/src/Extension/CoreExtension.php:1637 #18 twig_get_attribute in /var/www/technexus/vendor/twig/twig/src/Environment.php:361 #17 __TwigTemplate_69cd1b2f2fee0cce6bf7110a454481cb:block_meta in /var/www/technexus/vendor/twig/twig/src/Template.php:171 #16 Twig\Template:displayBlock in /var/www/technexus/vendor/twig/twig/src/Environment.php:361 #15 __TwigTemplate_fb8f4c9117fb7a99912f7a280ff16e10:doDisplay in /var/www/technexus/vendor/twig/twig/src/Template.php:394 #14 Twig\Template:displayWithErrorHandling in /var/www/technexus/vendor/twig/twig/src/Template.php:367 #13 Twig\Template:display in /var/www/technexus/vendor/twig/twig/src/Environment.php:361 #12 __TwigTemplate_69cd1b2f2fee0cce6bf7110a454481cb:doDisplay in /var/www/technexus/vendor/twig/twig/src/Template.php:394 #11 Twig\Template:displayWithErrorHandling in /var/www/technexus/vendor/twig/twig/src/Template.php:367 #10 Twig\Template:display in /var/www/technexus/vendor/twig/twig/src/Template.php:379 #9 Twig\Template:render in /var/www/technexus/vendor/twig/twig/src/TemplateWrapper.php:40 #8 Twig\TemplateWrapper:render in /var/www/technexus/vendor/twig/twig/src/Environment.php:280 #7 Twig\Environment:render in /var/www/technexus/vendor/divergence/divergence/src/Responders/TwigBuilder.php:29 #6 Divergence\Responders\TwigBuilder:getBody in /var/www/technexus/vendor/divergence/divergence/src/Responders/Response.php:103 #5 Divergence\Responders\Response:__construct in /var/www/technexus/src/Controllers/Blog.php:268 #4 technexus\Controllers\Blog:post in /var/www/technexus/src/Controllers/Blog.php:87 #3 technexus\Controllers\Blog:handle in /var/www/technexus/src/Controllers/Main.php:47 #2 technexus\Controllers\Main:handle in /var/www/technexus/src/App.php:123 #1 technexus\App:handleRequest in /var/www/technexus/bootstrap/router.php:10 #0 require in /var/www/technexus/public/index.php:4
Stack frames (23)
22
Twig\Error\RuntimeError
/views/blog/post.twig11
21
Whoops\Exception\ErrorException
/src/Models/BlogPost.php98
20
Whoops\Run handleError
/src/Models/BlogPost.php98
19
technexus\Models\BlogPost getShareImage
/vendor/twig/twig/src/Extension/CoreExtension.php1637
18
twig_get_attribute
/vendor/twig/twig/src/Environment.php361
17
__TwigTemplate_69cd1b2f2fee0cce6bf7110a454481cb block_meta
/vendor/twig/twig/src/Template.php171
16
Twig\Template displayBlock
/vendor/twig/twig/src/Environment.php361
15
__TwigTemplate_fb8f4c9117fb7a99912f7a280ff16e10 doDisplay
/vendor/twig/twig/src/Template.php394
14
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php367
13
Twig\Template display
/vendor/twig/twig/src/Environment.php361
12
__TwigTemplate_69cd1b2f2fee0cce6bf7110a454481cb doDisplay
/vendor/twig/twig/src/Template.php394
11
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php367
10
Twig\Template display
/vendor/twig/twig/src/Template.php379
9
Twig\Template render
/vendor/twig/twig/src/TemplateWrapper.php40
8
Twig\TemplateWrapper render
/vendor/twig/twig/src/Environment.php280
7
Twig\Environment render
/vendor/divergence/divergence/src/Responders/TwigBuilder.php29
6
Divergence\Responders\TwigBuilder getBody
/vendor/divergence/divergence/src/Responders/Response.php103
5
Divergence\Responders\Response __construct
/src/Controllers/Blog.php268
4
technexus\Controllers\Blog post
/src/Controllers/Blog.php87
3
technexus\Controllers\Blog handle
/src/Controllers/Main.php47
2
technexus\Controllers\Main handle
/src/App.php123
1
technexus\App handleRequest
/bootstrap/router.php10
0
require
/public/index.php4
/var/www/technexus/views/blog/post.twig
{% extends "blog/layouts/design.twig" %}
 
{% block title %}{{BlogPost.Title}} | {{ parent() }}{% endblock %}
 
{% block description %}{{ BlogPost.MainContent | replace({'\n':" ",'\t':" "}) | striptags | trim | slice(0,255) }}{% endblock %}
 
{% block meta %}
<meta property="og:title" content="{{ BlogPost.Title }}" />
<meta property="og:type" content="article" />
<meta property="og:url" content="{{ BlogPost.ExternalPermaLink }}" />
<meta property="og:image" content="{{ BlogPost.ShareImage}}" />
<meta content='article' property='og:type'/>
 
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@0xAkuKun">
<meta name="twitter:creator" content="@0xAkuKun">
<meta name="twitter:title" content="{{ BlogPost.Title }}">
<meta name="twitter:description" content="{{ BlogPost.MainContent | replace({'\n':" ",'\t':" "}) | striptags | trim | slice(0,255) }}">
<meta name="twitter:image" content="{{ BlogPost.ShareImage}} ">
{% endblock %}
 
{% block content %}
    {% include 'blog/templates/post.twig' %}
{% endblock %}
Arguments
  1. "An exception has been thrown during the rendering of a template ("Undefined array key 1")."
    
/var/www/technexus/src/Models/BlogPost.php
    {
        return $this->getPermaLink();
    }
 
    public function getExternalPermaLink()
    {
        return $this->getPermaLink(true);
    }
 
    /**
     * Quick and dirty
     * TODO: Change admin to let you select this image
     *
     * @return string|false
     */
    public function getShareImage()
    {
        preg_match("/\/media\/([0-9]*)/", $this->getValue('MainContent'), $images);
        
        if (ctype_digit($images[1])) {
            return 'https://'.$_SERVER['SERVER_NAME'].'/media/thumbnail/'.$images[1].'/500x500/cropped/';
        } else {
            return false;
        }
    }
 
    public function saveTags($tags)
    {
        $SeenTags = [];
        
        foreach ($tags as $tag) {
            if (!$Tag = Tag::getByField('Tag', $tag)) {
                $Tag = Tag::create([
                    'Tag' => $tag,
                    'Slug' => strtolower($tag),
                ], true);
            }
            
            $SeenTags[] = $Tag->getPrimaryKeyValue();
            
Arguments
  1. "Undefined array key 1"
    
Exception message: Undefined array key 1
/var/www/technexus/src/Models/BlogPost.php
    {
        return $this->getPermaLink();
    }
 
    public function getExternalPermaLink()
    {
        return $this->getPermaLink(true);
    }
 
    /**
     * Quick and dirty
     * TODO: Change admin to let you select this image
     *
     * @return string|false
     */
    public function getShareImage()
    {
        preg_match("/\/media\/([0-9]*)/", $this->getValue('MainContent'), $images);
        
        if (ctype_digit($images[1])) {
            return 'https://'.$_SERVER['SERVER_NAME'].'/media/thumbnail/'.$images[1].'/500x500/cropped/';
        } else {
            return false;
        }
    }
 
    public function saveTags($tags)
    {
        $SeenTags = [];
        
        foreach ($tags as $tag) {
            if (!$Tag = Tag::getByField('Tag', $tag)) {
                $Tag = Tag::create([
                    'Tag' => $tag,
                    'Slug' => strtolower($tag),
                ], true);
            }
            
            $SeenTags[] = $Tag->getPrimaryKeyValue();
            
/var/www/technexus/vendor/twig/twig/src/Extension/CoreExtension.php
 
        if ($ignoreStrictCheck || !$env->isStrictVariables()) {
            return;
        }
 
        throw new RuntimeError(sprintf('Neither the property "%1$s" nor one of the methods "%1$s()", "get%1$s()"/"is%1$s()"/"has%1$s()" or "__call()" exist and have public access in class "%2$s".', $item, $class), $lineno, $source);
    }
 
    if ($isDefinedTest) {
        return true;
    }
 
    if ($sandboxed) {
        $env->getExtension(SandboxExtension::class)->checkMethodAllowed($object, $method, $lineno, $source);
    }
 
    // Some objects throw exceptions when they have __call, and the method we try
    // to call is not supported. If ignoreStrictCheck is true, we should return null.
    try {
        $ret = $object->$method(...$arguments);
    } catch (\BadMethodCallException $e) {
        if ($call && ($ignoreStrictCheck || !$env->isStrictVariables())) {
            return;
        }
        throw $e;
    }
 
    return $ret;
}
 
/**
 * Returns the values from a single column in the input array.
 *
 * <pre>
 *  {% set items = [{ 'fruit' : 'apple'}, {'fruit' : 'orange' }] %}
 *
 *  {% set fruits = items|column('fruit') %}
 *
 *  {# fruits now contains ['apple', 'orange'] #}
 * </pre>
/var/www/technexus/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);
                }
            }
        }
 
        $this->extensionSet->initRuntime();
 
        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
     * @param string $name     An optional name of the template to be used in error messages
/var/www/technexus/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/technexus/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);
                }
            }
        }
 
        $this->extensionSet->initRuntime();
 
        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
     * @param string $name     An optional name of the template to be used in error messages
/var/www/technexus/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/technexus/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/technexus/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);
                }
            }
        }
 
        $this->extensionSet->initRuntime();
 
        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
     * @param string $name     An optional name of the template to be used in error messages
/var/www/technexus/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/technexus/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/technexus/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/technexus/vendor/twig/twig/src/TemplateWrapper.php
    private $env;
    private $template;
 
    /**
     * This method is for internal use only and should never be called
     * directly (use Twig\Environment::load() instead).
     *
     * @internal
     */
    public function __construct(Environment $env, Template $template)
    {
        $this->env = $env;
        $this->template = $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] ?? []);
    }
 
    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] ?? []);
    }
 
    public function hasBlock(string $name, array $context = []): bool
    {
        return $this->template->hasBlock($name, $context);
    }
 
    /**
     * @return string[] An array of defined template block names
     */
    public function getBlockNames(array $context = []): array
    {
        return $this->template->getBlockNames($context);
/var/www/technexus/vendor/twig/twig/src/Environment.php
     */
    public function getTemplateClass(string $name, int $index = null): string
    {
        $key = $this->getLoader()->getCacheKey($name).$this->optionsHash;
 
        return $this->templateClassPrefix.hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', $key).(null === $index ? '' : '___'.$index);
    }
 
    /**
     * Renders a template.
     *
     * @param string|TemplateWrapper $name The template name
     *
     * @throws LoaderError  When the template cannot be found
     * @throws SyntaxError  When an error occurred during compilation
     * @throws RuntimeError When an error occurred during rendering
     */
    public function render($name, array $context = []): string
    {
        return $this->load($name)->render($context);
    }
 
    /**
     * Displays a template.
     *
     * @param string|TemplateWrapper $name The template name
     *
     * @throws LoaderError  When the template cannot be found
     * @throws SyntaxError  When an error occurred during compilation
     * @throws RuntimeError When an error occurred during rendering
     */
    public function display($name, array $context = []): void
    {
        $this->load($name)->display($context);
    }
 
    /**
     * Loads a template.
     *
     * @param string|TemplateWrapper $name The template name
/var/www/technexus/vendor/divergence/divergence/src/Responders/TwigBuilder.php
 
namespace Divergence\Responders;
 
use Divergence\App;
use Twig\Environment;
use GuzzleHttp\Psr7\Utils;
use Twig\Loader\FilesystemLoader;
use Psr\Http\Message\StreamInterface;
use Twig\Extension\StringLoaderExtension;
 
class TwigBuilder extends ResponseBuilder
{
    protected string $contentType = 'text/html; charset=utf-8';
 
    public function getBody(): StreamInterface
    {
        $loader = new FilesystemLoader([App::$App->ApplicationPath.'/views']);
        $env = new Environment($loader, ['strict_variables' => true]);
        $env->addExtension(new StringLoaderExtension());
        $output = $env->render($this->template, $this->data);
        return Utils::streamFor($output);
    }
}
 
/var/www/technexus/vendor/divergence/divergence/src/Responders/Response.php
        505 => 'HTTP Version not supported',
        506 => 'Variant Also Negotiates',
        507 => 'Insufficient Storage',
        508 => 'Loop Detected',
        510 => 'Not Extended',
        511 => 'Network Authentication Required',
    ];
 
    /** @var string */
    private $reasonPhrase;
 
    /** @var int */
    private $statusCode;
 
    public function __construct(ResponseBuilder $responseBuilder)
    {
        $this
        ->withDefaults(200, [
            'Content-Type' => $responseBuilder->getContentType(),
        ], $responseBuilder->getBody());
    }
 
    /**
     * @param int                                  $status  Status code
     * @param array<string, string|string[]>       $headers Response headers
     * @param string|resource|StreamInterface|null $body    Response body
     * @param string                               $version Protocol version
     * @param string|null                          $reason  Reason phrase (when empty a default will be used based on the status code)
     * @return static
     */
    public function withDefaults(
        int $status = 200,
        array $headers = [],
        $body = null,
        string $version = '1.1',
        string $reason = null
    ) {
        $this->assertStatusCodeRange($status);
 
        $this->statusCode = $status;
/var/www/technexus/src/Controllers/Blog.php
    /**
     * Displays a blog post
     *
     * @param string $year
     * @param string $month
     * @param string $permalink
     * @link project://views/blog/post.twig
     * @link project://views/templates/post.twig
     * @return Response
     */
    public function post($year, $month, $permalink): Response
    {
        $BlogPost = BlogPost::getByWhere(array_merge($this->conditions(), [
            sprintf('YEAR(`Created`)=%d', $year),
            sprintf('MONTH(`Created`)=%d', $month),
            "`permalink`='".DB::escape($permalink)."'",
        ]));
 
        if (!empty($BlogPost)) {
            return new Response(new TwigBuilder('blog/post.twig', [
                'BlogPost' => $BlogPost,
                'isLoggedIn' => App::$App->is_loggedin(),
                'Sidebar' => $this->getSidebarData(),
                'Limit' => static::LIMIT,
                'Total' => DB::foundRows(),
            ]));
        } else {
            return $this->notFound();
        }
        
    }
 
 
    /**
     * Shows 404 page
     *
     * @return Response
     */
    public function notFound(): Response
    {
/var/www/technexus/src/Controllers/Blog.php
                }
                // month of posts
                if (ctype_digit($this->peekPath()) && strlen($this->peekPath()) == 2) {
                    $month = $this->shiftPath();
                }
                // single post
                $permalink = $this->peekPath()?$this->shiftPath():null;
                
                // yearly digest
                if (empty($permalink) && empty($month)) {
                    return $this->year($year);
                }
                
                // monthly digest
                if (empty($permalink)) {
                    return $this->month($year, $month);
                }
                
                // specific single post
                return $this->post($year, $month, $permalink??null);
                
            default:
                return $this->notfound();
        }
    }
 
    /**
     * Gets stuff that goes into the sidebar. All Months with blog posts and tags ordered by the amount of times that tag was used.
     *
     * @link project://views/blog/sidebar.twig
     * @return array
     */
    public function getSidebarData()
    {
        return [
            'Months' => DB::AllRecords(sprintf('SELECT DISTINCT MONTHNAME(`Created`) as `MonthName`,MONTH(`Created`) as `Month`, YEAR(`Created`) as `Year` FROM `%s` ORDER BY `Created` DESC', BlogPost::$tableName)),
            'Tags' => PostTags::getAllbyQuery('SELECT *,COUNT(*) as `Count` FROM `'.PostTags::$tableName.'` GROUP BY `TagID` ORDER BY `Count` DESC'),
        ];
    }
    
/var/www/technexus/src/Controllers/Main.php
     * @uses Blog::handleRequest()
     * @return void
     */
    public function handle(ServerRequestInterface $request): ResponseInterface
    {
        if (file_exists($_SERVER['DOCUMENT_ROOT'].'/site.LOCK')) {
            echo file_get_contents($_SERVER['DOCUMENT_ROOT'].'/down.html');
            exit;
        }
 
        /*
         * This is to make sure any page that loads
         * through Apache's ErrorDocument returns 200
         * instead of 404.
         */
        header('HTTP/1.0 200 OK');
        //header('X-Powered-By: PHP/' . phpversion() . ' Div Framework (http://emr.ge) Henry\'s Revision');
 
        $blog = new Blog();
        return $blog->handle($request);
    }
}
 
/var/www/technexus/src/App.php
                return true;
            }
        }
        return false;
    }
    
    /**
     * Gets difference between process start and now in microseconds.
     *
     * @return void
     */
    public function getLoadTime()
    {
        return (microtime(true)-DIVERGENCE_START);
    }
 
    public function handleRequest()
    {
        $main = new Main();
        $response = $main->handle(ServerRequest::fromGlobals());
        (new Emitter($response))->emit();
    }
}
 
/var/www/technexus/bootstrap/router.php
<?php
/**
 * This file is part of the Divergence package.
 *
 * (c) Henry Paradiz <henry.paradiz@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
$app->handleRequest();
 
/var/www/technexus/public/index.php
<?php
require(__DIR__.'/../bootstrap/autoload.php');
require(__DIR__.'/../bootstrap/app.php');
require(__DIR__.'/../bootstrap/router.php');
 
Arguments
  1. "/var/www/technexus/bootstrap/router.php"
    

Environment & details:

empty
empty
empty
empty
empty
Key Value
USER
"www-data"
HOME
"/var/www"
HTTP_USER_AGENT
"claudebot"
HTTP_ACCEPT
"*/*"
HTTP_HOST
"technex.us"
PHP_VALUE
"""
upload_max_filesize = 20M \n
 post_max_size=21M
"""
SCRIPT_FILENAME
"/var/www/technexus/public/index.php"
REDIRECT_STATUS
"200"
SERVER_NAME
"technex.us"
SERVER_PORT
"443"
SERVER_ADDR
"192.241.147.251"
REMOTE_PORT
"43776"
REMOTE_ADDR
"54.163.14.144"
SERVER_SOFTWARE
"nginx/1.18.0"
GATEWAY_INTERFACE
"CGI/1.1"
HTTPS
"on"
REQUEST_SCHEME
"https"
SERVER_PROTOCOL
"HTTP/2.0"
DOCUMENT_ROOT
"/var/www/technexus/public"
DOCUMENT_URI
"/index.php"
REQUEST_URI
"/2018/04/login_to_ssh_faster_and_with_greater_security_the_ssh_config_file/"
SCRIPT_NAME
"/index.php"
CONTENT_LENGTH
""
CONTENT_TYPE
""
REQUEST_METHOD
"GET"
QUERY_STRING
""
FCGI_ROLE
"RESPONDER"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1711638509.6423
REQUEST_TIME
1711638509
empty
0. Whoops\Handler\PrettyPageHandler