=') && version_compare(phpversion(), '5.5.0', '<'))) { die('PHP 5.3.x - 5.4.x required (Your version ' . phpversion() . ').'); } require_once '_lib/_sys/init.php'; // SiteMap $page = Qs_SiteMap::getPage(CURRENT_PAGE); if (isset($page['redirect']) && isset($page['redirectType']) && 'y' == $page['redirect']) { if ('page' == $page['redirectType']) { if (false === ($fullAlias = Qs_SiteMap::find(['id' => $page['redirectPageId']], null, null, 'fullAlias'))) { $fullAlias = ''; } $redirectUrl = BASE_URL_LANGUAGE . '/' . $fullAlias; } else { $redirectUrl = str_replace('{BASE_URL}', BASE_URL_LANGUAGE, $page['redirectAlias']); } Qs_Http::redirect($redirectUrl, $page['redirectStatus']); } if ($page == Qs_SiteMap::ENDS_WITH_SLASH) { $url = Qs_Constant::get('BASE_URL') . '/' . substr(CURRENT_PAGE, 0, -1); if (!empty($_SERVER['QUERY_STRING'])) { $url .= '?' . $_SERVER['QUERY_STRING']; } Qs_Http::redirect($url, 301); } elseif ($page == Qs_SiteMap::NOT_FOUND) { $page = Qs_SiteMap::get404Page(); } if (isset($page['isRoot']) && 'y' == $page['isRoot'] && '' != CURRENT_PAGE) { Qs_Http::redirect(BASE_URL_LANGUAGE, 301); } if (Qs_SiteMap::isSecurePage($page) && !(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on')) { if ($_SERVER['REQUEST_METHOD'] == 'GET') { $url = str_replace('http://', 'https://', Qs_Request::getUrl()); Qs_Http::redirect($url); } else { header('HTTP/1.0 405 Method Not Allowed'); exit; } } define('CURRENT_PAGE_FINAL', (isset($page['fullAlias'])) ? $page['fullAlias'] : CURRENT_PAGE); $parts = explode('/', CURRENT_PAGE_FINAL); array_pop($parts); $parentPageFinal = implode('/', $parts); define('PARENT_PAGE_FINAL', $parentPageFinal); unset($siteMap); $items = (array) $page['items']; unset($page['items']); $handlerClass = 'App_Doc_' . ucfirst($page['handler']); /** @var $doc Qs_Doc */ $doc = new $handlerClass($page); if (Qs_Request::isMobile()) { $doc->setStylesheetRenderType(Qs_Doc::CSS_INLINE); } Zend_Registry::set('doc', $doc); $doc->renderPageItems($items); $html = $doc->__toString(); $doc->sendHeaders(); if (Qs_Constant::get('COMPRESS_HTML')) { $html = Qs_Packer_Html::compressHtml($html, false); } $debugHtml = include('_lib/_sys/log.php'); if ($debugHtml) { $html = str_replace('', $debugHtml . '', $html); } if (Qs_Constant::get('LOG_SCRIPT_DURATION')) { logScriptDuration(); } echo $html;