" />
Page not found
<?php

// =============================================================================

namespace Extensions\Garlic\Cms\Handlers;

// -------------------------------------------------------------------------

use Core\Application\Handler;
use Core\Application\Request;
use Core\Application\Output;
use Core\Application\Events;
use Core\Application\Route;
use Core\Application\Exceptions\NotFoundException;

use Extensions\Garlic\Cms\Models\Page;
use Extensions\Garlic\Intl\Library\Lang;
use Extensions\Garlic\Admin\Library\Admin;

// =============================================================================

class PagesHandler extends Handler
{

    // =========================================================================

    public function defaultAction(Request $request, Output $output)
    {
        list($page, $prototype) = $this->assertPage($request);

        Events::dispatch('before_render_page', [
            'request' => $request,
            'output'  => $output,
            'page'    => $page,
        ]);

        Admin::addDialogInfoItems([
            [
                'type' => 'title',
                'text' => Lang::_("CMS / Pages"),
            ],
            [
                'type' => 'text',
                'text' => Lang::_("Page #{id}", [ 'id' => $prototype->getId() ]),
            ],
            [
                'type' => 'action',
                'text' => Lang::_("Éditer la page"),
                'url'  => Route::makeUrl('_admin_do_handler', [
                    'ctx'     => 'contributor',
                    'handler' => 'pages/edit',
                    'pageId'  => $page->getId(),
                ]),
            ],
        ]);

        $output->render('pages/default.html.twig', [
            'page' => $page,
        ]);
    }

    // -------------------------------------------------------------------------

    private function assertPage(Request $request)
    {
        if (!($page = Page::getCurrent())) {
            throw new NotFoundException('Page not found');
        }

        if ($page->getType() !== Page::TYPE_PAGE) {
            throw new NotFoundException('Slug does not refer to a page');
        }

        $prototype = $page->getPrototype();
        $status = $prototype->getStatus();

        switch ($status) {
            case Page::STATUS_DISABLED:
                throw new NotFoundException('Page disabled');
            case Page::STATUS_DRAFT:
                throw new NotFoundException('Page is a draft');
            case Page::STATUS_PUBLISHED:
                return [ $page, $prototype ];
        }

        throw new NotFoundException('Page status not managed');
    }

}
  • /home/sc2ihlu1696/public_html/vivrefm/www/system/core/Application/Errors.php (line 129)

    Function: Core\Application\Errors::process

  • /home/sc2ihlu1696/public_html/vivrefm/www/system/core/Web/Application.php (line 64)

    Function: Core\Application\Errors::processException

  • /home/sc2ihlu1696/public_html/vivrefm/www/index.php (line 38)

    Function: Core\Web\Application::run

  • /home/sc2ihlu1696/public_html/vivrefm/www/application/extensions/Garlic/Cms/src/handlers/PagesHandler.php (line 29)

    Function: Extensions\Garlic\Cms\Handlers\PagesHandler::assertPage

  • /home/sc2ihlu1696/public_html/vivrefm/www/system/core/Application/Handler.php (line 161)

    Function: Extensions\Garlic\Cms\Handlers\PagesHandler::defaultAction

  • /home/sc2ihlu1696/public_html/vivrefm/www/system/core/Application/Handler.php (line 101)

    Function: Core\Application\Handler::call

  • /home/sc2ihlu1696/public_html/vivrefm/www/system/core/Web/Application.php (line 78)

    Function: Core\Application\Handler::executeByRoute

  • /home/sc2ihlu1696/public_html/vivrefm/www/system/core/Web/Application.php (line 62)

    Function: Core\Web\Application::processRoute

  • /home/sc2ihlu1696/public_html/vivrefm/www/index.php (line 38)

    Function: Core\Web\Application::run

Key Value
FAST_DEBUG_KEY string(32) "pun1biNee0aithahthooCathah1zacoo"
HANDLE_ERRORS bool(true)
CACHE_CONFIG bool(true)
PROFILER_ENABLED bool(false)
XHPROF_ENABLED bool(false)
MEMORY_LIMIT string(5) "1024M"
CORE_DEBUG bool(false)
SHOW_CORE_DEBUG bool(false)
EMAIL_ERRORS string(20) "nerd@barbichette.net"
EMAIL_DEBUG string(20) "nerd@barbichette.net"
IS_FAST_DEBUG bool(false)
DS string(1) "/"
ROOT_DIR string(41) "/home/sc2ihlu1696/public_html/vivrefm/www"
APP_DIR string(53) "/home/sc2ihlu1696/public_html/vivrefm/www/application"
APP_SRC_DIR string(57) "/home/sc2ihlu1696/public_html/vivrefm/www/application/src"
APP_DOC_DIR string(57) "/home/sc2ihlu1696/public_html/vivrefm/www/application/doc"
APP_CONSOLE_DIR string(65) "/home/sc2ihlu1696/public_html/vivrefm/www/application/src/console"
APP_HANDLERS_DIR string(66) "/home/sc2ihlu1696/public_html/vivrefm/www/application/src/handlers"
APP_MIGRATIONS_DIR string(68) "/home/sc2ihlu1696/public_html/vivrefm/www/application/src/migrations"
APP_MODELS_DIR string(64) "/home/sc2ihlu1696/public_html/vivrefm/www/application/src/models"
APP_THEMES_DIR string(64) "/home/sc2ihlu1696/public_html/vivrefm/www/application/src/themes"
APP_CONFIG_DIR string(60) "/home/sc2ihlu1696/public_html/vivrefm/www/application/config"
APP_EXTENSIONS_DIR string(64) "/home/sc2ihlu1696/public_html/vivrefm/www/application/extensions"
APP_PUBLIC_DIR string(60) "/home/sc2ihlu1696/public_html/vivrefm/www/application/public"
APP_VENDOR_DIR string(60) "/home/sc2ihlu1696/public_html/vivrefm/www/application/vendor"
SYSTEM_DIR string(48) "/home/sc2ihlu1696/public_html/vivrefm/www/system"
SYSTEM_CONSOLE_DIR string(56) "/home/sc2ihlu1696/public_html/vivrefm/www/system/console"
SYSTEM_CORE_DIR string(53) "/home/sc2ihlu1696/public_html/vivrefm/www/system/core"
SYSTEM_VENDOR_DIR string(55) "/home/sc2ihlu1696/public_html/vivrefm/www/system/vendor"
SYSTEM_EXTRA_DIR string(54) "/home/sc2ihlu1696/public_html/vivrefm/www/system/extra"
SYSTEM_DATA_DIR string(53) "/home/sc2ihlu1696/public_html/vivrefm/www/system/data"
SYSTEM_CACHE_DIR string(59) "/home/sc2ihlu1696/public_html/vivrefm/www/system/data/cache"
SYSTEM_SETTINGS_DIR string(62) "/home/sc2ihlu1696/public_html/vivrefm/www/system/data/settings"
SYSTEM_TPL_DIR string(63) "/home/sc2ihlu1696/public_html/vivrefm/www/system/data/templates"
SYSTEM_LOG_DIR string(57) "/home/sc2ihlu1696/public_html/vivrefm/www/system/data/log"
SYSTEM_QUEUE_DIR string(59) "/home/sc2ihlu1696/public_html/vivrefm/www/system/data/queue"
TMP_DIR string(57) "/home/sc2ihlu1696/public_html/vivrefm/www/system/data/tmp"
DOMAIN_NAME string(8) "vivre.fm"
TOP_LEVEL_DOMAIN_NAME string(8) "vivre.fm"
BASE_URL string(0) ""
REQUEST_URL string(8) "/experts"
REQUEST_SCHEME string(5) "https"
FULL_REQUEST_URL string(24) "https://vivre.fm/experts"
RELATIVE_URL string(8) "/experts"
HTTP_METHOD string(3) "GET"
HOST_IP string(15) "109.234.162.130"
CLIENT_IP string(11) "18.97.9.175"
ENV string(4) "prod"
DEBUG bool(true)
Key Value
PATH string(28) "/usr/local/bin:/usr/bin:/bin"
TEMP string(4) "/tmp"
TMP string(4) "/tmp"
TMPDIR string(4) "/tmp"
PWD string(1) "/"
HTTP_ACCEPT string(63) "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
HTTP_ACCEPT_LANGUAGE string(14) "en-US,en;q=0.5"
CONTENT_LENGTH string(1) "0"
HTTP_HOST string(8) "vivre.fm"
HTTP_USER_AGENT string(40) "CCBot/2.0 (https://commoncrawl.org/faq/)"
HTTP_X_COUNTRY_CODE string(2) "US"
HTTP_X_AUTONOMOUS_SYSTEM string(5) "14618"
HTTP_X_REAL_IP string(11) "18.97.9.175"
HTTP_X_FORWARDED_PROTO string(5) "https"
HTTP_X_FORWARDED_PORT string(3) "443"
HTTP_X_SSL string(3) "yes"
HTTP_X_HTTPS string(1) "1"
REDIRECT_UNIQUE_ID string(27) "aWgaS6OwztJQJwjYYjWDUQAAAY4"
REDIRECT_SCRIPT_URL string(8) "/experts"
REDIRECT_SCRIPT_URI string(24) "https://vivre.fm/experts"
REDIRECT_HTTPS string(2) "on"
REDIRECT_SSL_TLS_SNI string(8) "vivre.fm"
REDIRECT_STATUS string(3) "200"
UNIQUE_ID string(27) "aWgaS6OwztJQJwjYYjWDUQAAAY4"
SCRIPT_URL string(8) "/experts"
SCRIPT_URI string(24) "https://vivre.fm/experts"
HTTPS string(2) "on"
SSL_TLS_SNI string(8) "vivre.fm"
SERVER_SIGNATURE string(0) ""
SERVER_SOFTWARE string(6) "Apache"
SERVER_NAME string(8) "vivre.fm"
SERVER_ADDR string(15) "109.234.162.130"
SERVER_PORT string(3) "443"
REMOTE_ADDR string(11) "18.97.9.175"
DOCUMENT_ROOT string(41) "/home/sc2ihlu1696/public_html/vivrefm/www"
REQUEST_SCHEME string(5) "https"
CONTEXT_PREFIX string(0) ""
CONTEXT_DOCUMENT_ROOT string(41) "/home/sc2ihlu1696/public_html/vivrefm/www"
SERVER_ADMIN string(42) "webmaster@vivre.fm.sc2ihlu1696.universe.wf"
SCRIPT_FILENAME string(51) "/home/sc2ihlu1696/public_html/vivrefm/www/index.php"
REMOTE_PORT string(5) "32858"
REDIRECT_URL string(8) "/experts"
SERVER_PROTOCOL string(8) "HTTP/1.1"
REQUEST_METHOD string(3) "GET"
QUERY_STRING string(0) ""
REQUEST_URI string(8) "/experts"
SCRIPT_NAME string(10) "/index.php"
PHP_SELF string(10) "/index.php"
REQUEST_TIME_FLOAT float(1768430155.3494)
REQUEST_TIME int(1768430155)