Whoops \ Exception \ ErrorException (E_WARNING)
Invalid argument supplied for foreach() Whoops\Exception\ErrorException thrown with message "Invalid argument supplied for foreach()" Stacktrace: #7 Whoops\Exception\ErrorException in /var/www/html/fbsp.org.br/mercuriohg/modules/34bienal/src/App/Model/LabelModel.php:64 #6 Whoops\Run:handleError in /var/www/html/fbsp.org.br/mercuriohg/modules/34bienal/src/App/Model/LabelModel.php:64 #5 App\Model\LabelModel:getLabelsDetail in /var/www/html/fbsp.org.br/mercuriohg/modules/34bienal/src/App/Model/LabelModel.php:236 #4 App\Model\LabelModel:getLabelsByContentId in /var/www/html/fbsp.org.br/mercuriohg/modules/34bienal/src/App/Model/PostModel.php:74 #3 App\Model\PostModel:getPost in /var/www/html/fbsp.org.br/mercuriohg/modules/34bienal/src/App/Handler/PostHandler.php:34 #2 App\Handler\PostHandler:handle in /var/www/html/fbsp.org.br/mercuriohg/modules/34bienal/src/Routes/Routes.php:101 #1 Routes\Routes:run in /var/www/html/fbsp.org.br/mercuriohg/modules/34bienal/config/config.routes.php:58 #0 require in /var/www/html/fbsp.org.br/mercuriohg/modules/34bienal/index.php:13
Stack frames (8)
7
Whoops
\
Exception
\
ErrorException
/
src
/
App
/
Model
/
LabelModel.php
64
6
Whoops
\
Run
handleError
/
src
/
App
/
Model
/
LabelModel.php
64
5
App
\
Model
\
LabelModel
getLabelsDetail
/
src
/
App
/
Model
/
LabelModel.php
236
4
App
\
Model
\
LabelModel
getLabelsByContentId
/
src
/
App
/
Model
/
PostModel.php
74
3
App
\
Model
\
PostModel
getPost
/
src
/
App
/
Handler
/
PostHandler.php
34
2
App
\
Handler
\
PostHandler
handle
/
src
/
Routes
/
Routes.php
101
1
Routes
\
Routes
run
/
config
/
config.routes.php
58
0
require
/
index.php
13
/
var
/
www
/
html
/
fbsp.org.br
/
mercuriohg
/
modules
/
34bienal
/
src
/
App
/
Model
/
LabelModel.php
 
        $carouselTemplate = ContentService::getPartialContent(self::TEMPLATE);
        $carouselTemplateItem = ContentService::getPartialContent(self::TEMPLATE_ITEM);
 
        $labelsList = self::getLabelsDetail($labelsId, $carouselTemplateItem);
 
        $carousel = str_replace('[#carousel-list#]', $labelsList, $carouselTemplate);
 
        $content = str_replace('[#tags-carousel#]', $carousel, $content);
 
        return $content;
    }
 
    public static function getLabelsDetail($labels, $template)
    {
        global $hg;
 
        $listHtml = '';
 
        foreach ($labels as $labelId) {
            $labelVertex = new Vertex($labelId, 'Label', $hg);
            $labelVertex = $labelVertex->expose();
 
            $label = [
                'label' => $labelVertex['displayName'],
                'link' => '/relacoes/' . $labelVertex['id'],
                'description' => $labelVertex['description']
            ];
 
            $listHtml .= ContentService::fillData($label, $template);
        }
 
        return $listHtml;
    }
 
    public static function getRelatedContent($id)
    {
        global $hg;
 
        $contentsId = $hg->getLinkedVertices(
/
var
/
www
/
html
/
fbsp.org.br
/
mercuriohg
/
modules
/
34bienal
/
src
/
App
/
Model
/
LabelModel.php
 
        $carouselTemplate = ContentService::getPartialContent(self::TEMPLATE);
        $carouselTemplateItem = ContentService::getPartialContent(self::TEMPLATE_ITEM);
 
        $labelsList = self::getLabelsDetail($labelsId, $carouselTemplateItem);
 
        $carousel = str_replace('[#carousel-list#]', $labelsList, $carouselTemplate);
 
        $content = str_replace('[#tags-carousel#]', $carousel, $content);
 
        return $content;
    }
 
    public static function getLabelsDetail($labels, $template)
    {
        global $hg;
 
        $listHtml = '';
 
        foreach ($labels as $labelId) {
            $labelVertex = new Vertex($labelId, 'Label', $hg);
            $labelVertex = $labelVertex->expose();
 
            $label = [
                'label' => $labelVertex['displayName'],
                'link' => '/relacoes/' . $labelVertex['id'],
                'description' => $labelVertex['description']
            ];
 
            $listHtml .= ContentService::fillData($label, $template);
        }
 
        return $listHtml;
    }
 
    public static function getRelatedContent($id)
    {
        global $hg;
 
        $contentsId = $hg->getLinkedVertices(
/
var
/
www
/
html
/
fbsp.org.br
/
mercuriohg
/
modules
/
34bienal
/
src
/
App
/
Model
/
LabelModel.php
    public static function getLabelsByContentId($id)
    {
        global $hg;
 
        $labelsId = $hg->getLinkedVertices(
            [LANGUAGE, SITE, $id],
            [
                'fromSCHEMATail' => '*',
                'SCHEMAEdge'     => '*',
                'toSCHEMATail'   => '*',
                'toSCHEMAVertex' => 'Label',
                'match'          => '*',
                'order'          => 'id',
                'offset'         => 0,
                'rowcount'       => 100000
            ]
        );
 
        $template = '<a href="[#link#]">[#label#]</a>, ';
        $labelsList = self::getLabelsDetail($labelsId, $template);
 
        return rtrim($labelsList, ', ');
    }
}
 
/
var
/
www
/
html
/
fbsp.org.br
/
mercuriohg
/
modules
/
34bienal
/
src
/
App
/
Model
/
PostModel.php
    public static function getAboutList($posts)
    {
        $postTemplate = ContentService::getPartialContent('template/sobre-item.html');

        return self::getList($posts, $postTemplate);
    }

    public static function getVisitList($posts)
    {
        $postTemplate = ContentService::getPartialContent('template/planeje-sua-visita-item.html');

        return self::getList($posts, $postTemplate);
    }

    public static function getPost($postId, $content)
    {
        global $hg;
        $postVertex = new Vertex($postId, 'Post', $hg);
        $post = $postVertex->expose();
        $tags = LabelModel::getLabelsByContentId($postId);

        $img = '<div class="no-img no-img--full"></div>';

        if ($post["coverImageURL"]) {
            $img = '<figure>
                        <img src="' . $post["coverImageURL"] . '" alt="">
                        <figcaption>' . $post["coverImageLabel"] . '</figcaption>
                    </figure>';
        }
        $title = $post["title"];
        $summary = $post["summary"];
        $link = 'post/' . $postId;

        $publishDate = '';
        if ($post["publishDate"] && $post['layout'] && $post['layout'] != 'artigo') {
            $publishDate = new DateTime($post["publishDate"]);
            $publishDate = $publishDate->format('d M Y');
        }
        $description = $post['content'];

/
var
/
www
/
html
/
fbsp.org.br
/
mercuriohg
/
modules
/
34bienal
/
src
/
App
/
Handler
/
PostHandler.php
 */
 
class PostHandler
{
    const TEMPLATE = 'template/post-interna.html';
 
    private $hg;
 
    private $vertex;
 
    public function __construct()
    {
        global $hg;
        $this->hg = $hg;
    }
 
    public function handle($routes, $id)
    {
        $content = ContentService::getContent($this::TEMPLATE, $routes);
        $content = PostModel::getPost($id, $content);
 
        $relateds = LabelModel::getRelatedContentByContentId($id);
        $content = str_replace('[#related#]', $relateds, $content);
 
        http_response_code(200);
        echo $content;
        
    }
}
 
/
var
/
www
/
html
/
fbsp.org.br
/
mercuriohg
/
modules
/
34bienal
/
src
/
Routes
/
Routes.php
        }
 
        if (array_key_exists($path, $this->routes[$this->method])) {
            $handler = new $this->routes[$this->method][$path];
            $language = $this->variables[$this->method][$path]["language"];
            setlocale(LC_TIME, $language . '.utf-8');
            define('LANGUAGE', constant($language));
            $handler->handle($this);
            return;
        }
 
        foreach ($this->regex[$this->method] as $key => $regex) {
            preg_match_all($regex, $path, $matches, PREG_SET_ORDER, 0);
            if ($matches) {
                $this->path = $key;
                $handler = new $this->routes[$this->method][$key];
                $language = $this->variables[$this->method][$key]["language"];
                setlocale(LC_TIME, $language . '.utf-8');
                define('LANGUAGE', constant($language));
                $handler->handle($this, $matches[0][2]);
                return;
            }
        }
 
        $this->show404();
    }
 
 
    private function show404()
    {
        http_response_code(404);
        echo ContentService::getContent('template/404.html');
        die();
    }
}
 
/
var
/
www
/
html
/
fbsp.org.br
/
mercuriohg
/
modules
/
34bienal
/
config
/
config.routes.php
$routes->addRoute('/en/agenda', 'App\Handler\ScheduleHandler', 'GET', ['language' => 'en_US']);
$routes->addRoute('/en/agenda/[name]', 'App\Handler\EventHandler', 'GET', ['language' => 'en_US']);
$routes->addRoute('/en/artistas', 'App\Handler\ArtistsHandler', 'GET', ['language' => 'en_US']);
$routes->addRoute('/en/artistas/[name]', 'App\Handler\ArtistHandler', 'GET', ['language' => 'en_US']);
$routes->addRoute('/en/enunciados', 'App\Handler\EnunciadosHandler', 'GET', ['language' => 'en_US']);
$routes->addRoute('/en/enunciados/[name]', 'App\Handler\EnunciadoHandler', 'GET', ['language' => 'en_US']);
$routes->addRoute('/en/exposicoes', 'App\Handler\ExhibitionHandler', 'GET', ['language' => 'en_US']);
$routes->addRoute('/en/exposicoes/[name]', 'App\Handler\EventHandler', 'GET', ['language' => 'en_US']);
$routes->addRoute('/en/multimidia', 'App\Handler\MultimediaHandler', 'GET', ['language' => 'en_US']);
$routes->addRoute('/en/planeje-sua-visita', 'App\Handler\VisitHandler', 'GET', ['language' => 'en_US']);
$routes->addRoute('/en/post/[name]', 'App\Handler\PostHandler', 'GET', ['language' => 'en_US']);
$routes->addRoute('/en/educacao', 'App\Handler\EducationProjectHandler', 'GET', ['language' => 'en_US']);
$routes->addRoute('/en/publicacoes', 'App\Handler\PublicationsHandler', 'GET', ['language' => 'en_US']);
$routes->addRoute('/en/relacoes', 'App\Handler\LabelsHandler', 'GET', ['language' => 'en_US']);
$routes->addRoute('/en/relacoes/[name]', 'App\Handler\LabelHandler', 'GET', ['language' => 'en_US']);
$routes->addRoute('/en/sobrea34', 'App\Handler\AboutHandler', 'GET', ['language' => 'en_US']);
 
$routes->addRoute('/search', 'App\Handler\SearchHandler', 'POST', ['language' => 'pt_BR']);
 
$routes->run();
 
/
var
/
www
/
html
/
fbsp.org.br
/
mercuriohg
/
modules
/
34bienal
/
index.php
<?php

ob_start('ob_gzhandler');

// Set Cache-Control header
header("Cache-Control: private, max-age=186400");


require __DIR__ . '/vendor/autoload.php';
require __DIR__ . '/config/config.development.php';
require __DIR__ . '/config/config.php';
require __DIR__ . '/config/config.mercurio.php';
require __DIR__ . '/config/config.routes.php';


ob_end_flush();

Environment & details:

empty
empty
empty
empty
empty
Key Value
REDIRECT_REDIRECT_REDIRECT_UNIQUE_ID ZgUxYi4ID21EML7xUo0urgAAAAs
REDIRECT_REDIRECT_REDIRECT_SCRIPT_URL /en/post/Unipar
REDIRECT_REDIRECT_REDIRECT_SCRIPT_URI http://34bienal.org.br/en/post/Unipar
REDIRECT_REDIRECT_REDIRECT_STATUS 200
REDIRECT_REDIRECT_UNIQUE_ID ZgUxYi4ID21EML7xUo0urgAAAAs
REDIRECT_REDIRECT_SCRIPT_URL /en/post/Unipar
REDIRECT_REDIRECT_SCRIPT_URI http://34bienal.org.br/en/post/Unipar
REDIRECT_REDIRECT_STATUS 200
REDIRECT_UNIQUE_ID ZgUxYi4ID21EML7xUo0urgAAAAs
REDIRECT_SCRIPT_URL /en/post/Unipar
REDIRECT_SCRIPT_URI http://34bienal.org.br/en/post/Unipar
REDIRECT_STATUS 200
UNIQUE_ID ZgUxYi4ID21EML7xUo0urgAAAAs
SCRIPT_URL /en/post/Unipar
SCRIPT_URI http://34bienal.org.br/en/post/Unipar
HTTP_ACCEPT */*
HTTP_USER_AGENT claudebot
HTTP_HOST 34bienal.org.br
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
SERVER_SIGNATURE
SERVER_SOFTWARE Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips
SERVER_NAME 34bienal.org.br
SERVER_ADDR 10.16.64.5
SERVER_PORT 80
REMOTE_ADDR 44.200.101.170
DOCUMENT_ROOT /var/www/html/fbsp.org.br
REQUEST_SCHEME http
CONTEXT_PREFIX
CONTEXT_DOCUMENT_ROOT /var/www/html/fbsp.org.br
SERVER_ADMIN root@localhost
SCRIPT_FILENAME /var/www/html/fbsp.org.br/mercuriohg/modules/34bienal/index.php
REMOTE_PORT 58262
REDIRECT_URL /index.php
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.1
REQUEST_METHOD GET
QUERY_STRING
REQUEST_URI /en/post/Unipar
SCRIPT_NAME /mercuriohg/modules/34bienal/index.php
PHP_SELF /mercuriohg/modules/34bienal/index.php
REQUEST_TIME_FLOAT 1711616354.3
REQUEST_TIME 1711616354
empty
0. Whoops\Handler\PrettyPageHandler