=') && version_compare(phpversion(), '5.3.0', '<'))) { die('PHP 5.3 not supported. PHP 5.2.4 or higher 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(array('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 = 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']); $configSection = Qs_Constant::get($handlerClass . '::CONFIG_SECTION'); if (isset($config->doc) && isset($config->doc->$configSection)) { $docConfig = $config->doc->$configSection->toArray(); } else { $docConfig = $config->doc->default->toArray(); } $page = array_merge($page, $docConfig); $doc = new $handlerClass($page); $registry->set('doc', $doc); $doc->renderPageItems($items); $html = $doc->__toString(); $doc->sendHeaders(); $debugHtml = include('_lib/_sys/log.php'); if ($debugHtml) { $html = str_replace('', $debugHtml . '', $html); } if (Qs_Constant::get('COMPRESS_HTML')) { $html = Qs_Packer_Html::compressHtml($html, false); if (false !== strpos(Qs_Request::getHeader('ACCEPT-ENCODING'), 'gzip')) { header('Content-Encoding: gzip'); $html = gzencode($html, 9); } } if (LOG_SCRIPT_DURATION) { logScriptDuration(); } echo $html;