$https = empty($_SERVER["HTTPS"]) ? '' : $_SERVER["HTTPS"] == "on" ? "s" : ""; $protocol = "http" . $https; $port = $_SERVER["SERVER_PORT"] == "80" ? "" : ":" . $_SERVER["SERVER_PORT"]; header("X-XHR-Current-Location: " . $protocol . "://" . $_SERVER['SERVER_NAME'] . $port . $_SERVER['REQUEST_URI']); if (isset(Koken::$site['settings_flat'])) { foreach (Koken::$site['settings_flat'] as $key => $obj) { $val = isset($obj['type']) && $obj['type'] === 'boolean' && is_bool($obj['value']) ? (bool) $obj['value'] : $obj['value']; if (!$stylesheet && isset($obj['scope']) && !in_array($final_path, $obj['scope'])) { $val = isset($obj['out_of_scope_value']) ? $obj['out_of_scope_value'] : false; } Koken::$settings[$key] = $val; } } if (isset(Koken::$site['language']) && isset(Koken::$settings['language'])) { $lang = Koken::$settings['language']; Koken::$language = Koken::$site['language'][$lang]; } Koken::$rss = preg_match('/\\.rss$/', $final_path); $final_path .= '.lens'; if ($final_path === 'error.lens') { $httpErrorCodes = array(); $httpErrorCodes['400'] = 'Bad Request'; $httpErrorCodes['401'] = 'Unauthorized'; $httpErrorCodes['403'] = 'Forbidden'; $httpErrorCodes['404'] = 'Not Found'; $httpErrorCodes['405'] = 'Method Not Allowed'; $httpErrorCodes['406'] = 'Not Acceptable'; $httpErrorCodes['407'] = 'Proxy Authentication Required'; $httpErrorCodes['408'] = 'Request Timeout'; $httpErrorCodes['409'] = 'Conflict'; $httpErrorCodes['410'] = 'Gone';