Whoops \ Exception \ ErrorException (E_WARNING)
Undefined array key 0 Whoops\Exception\ErrorException thrown with message "Undefined array key 0" Stacktrace: #6 Whoops\Exception\ErrorException in /var/www/technexus/src/Controllers/Blog.php:180 #5 Whoops\Run:handleError in /var/www/technexus/src/Controllers/Blog.php:180 #4 technexus\Controllers\Blog:home in /var/www/technexus/src/Controllers/Blog.php:58 #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 (7)
6
Whoops\Exception\ErrorException
/src/Controllers/Blog.php180
5
Whoops\Run handleError
/src/Controllers/Blog.php180
4
technexus\Controllers\Blog home
/src/Controllers/Blog.php58
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/src/Controllers/Blog.php
            'Total' => $total,
            'path' => $this->path,
            'isLoggedIn' => App::$App->is_loggedin(),
            'Sidebar' => $this->getSidebarData(),
        ];
        
        /**
         * Show "Go Back" button only if the results are >= limit
         * or
         * If query param after is present
         */
        if (($count === static::LIMIT || $total > static::LIMIT) || isset($get['after'])) {
            $data['before'] = $BlogPosts[$count-1]->Created;
        }
 
        /**
         * Show "Go Forward" button if before query param is present
         */
        if (isset($get['before'])) {
            $data['after'] = $BlogPosts[0]->Created;
        }
 
        if (isset($get['after'])) {
        }
 
        return new Response(new TwigBuilder('blog/posts.twig', $data));
    }
    
    /**
     * Displays a given year of blog posts
     *
     * @param string $year
     * @link project://views/blog/posts.twig
     * @link project://views/templates/post.twig
     */
    public function year($year): ResponseInterface
    {
        $BlogPosts = BlogPost::getAllByWhere(array_merge($this->conditions(), [
            sprintf('YEAR(`Created`)=%d', $year),
        ]), [
Arguments
  1. "Undefined array key 0"
    
/var/www/technexus/src/Controllers/Blog.php
            'Total' => $total,
            'path' => $this->path,
            'isLoggedIn' => App::$App->is_loggedin(),
            'Sidebar' => $this->getSidebarData(),
        ];
        
        /**
         * Show "Go Back" button only if the results are >= limit
         * or
         * If query param after is present
         */
        if (($count === static::LIMIT || $total > static::LIMIT) || isset($get['after'])) {
            $data['before'] = $BlogPosts[$count-1]->Created;
        }
 
        /**
         * Show "Go Forward" button if before query param is present
         */
        if (isset($get['before'])) {
            $data['after'] = $BlogPosts[0]->Created;
        }
 
        if (isset($get['after'])) {
        }
 
        return new Response(new TwigBuilder('blog/posts.twig', $data));
    }
    
    /**
     * Displays a given year of blog posts
     *
     * @param string $year
     * @link project://views/blog/posts.twig
     * @link project://views/templates/post.twig
     */
    public function year($year): ResponseInterface
    {
        $BlogPosts = BlogPost::getAllByWhere(array_merge($this->conditions(), [
            sprintf('YEAR(`Created`)=%d', $year),
        ]), [
/var/www/technexus/src/Controllers/Blog.php
    {
        $this->request = $request;
        switch ($action = $this->shiftPath()) {
            case 'admin':
                return (new Admin())->handle($request);
                
            case 'api':
                return (new API())->handle($request);
 
            case 'media':
                return (new Media())->handle($request);
                
            case 'logout':
                return $this->logout();
 
            case '.rss':
                    return (new RSS())->handle($request);
                    
            case '':
                return $this->home($request);
                break;
 
            case 'topics':
                return $this->topics();
 
            case ctype_digit($action):
                // year of posts
                if (strlen($action) == 4) {
                    $year = $action;
                }
                // 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);
/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:

Key Value
before
"1523891754"
empty
empty
empty
empty
Key Value
USER
"www-data"
HOME
"/var/www"
HTTP_USER_AGENT
"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)"
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
"46567"
REMOTE_ADDR
"3.136.18.48"
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
"/?before=1523891754"
SCRIPT_NAME
"/index.php"
CONTENT_LENGTH
""
CONTENT_TYPE
""
REQUEST_METHOD
"GET"
QUERY_STRING
"before=1523891754"
FCGI_ROLE
"RESPONDER"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1714064140.7881
REQUEST_TIME
1714064140
empty
0. Whoops\Handler\PrettyPageHandler