本文整理汇总了PHP中Navigation::redirect_http_to_https方法的典型用法代码示例。如果您正苦于以下问题:PHP Navigation::redirect_http_to_https方法的具体用法?PHP Navigation::redirect_http_to_https怎么用?PHP Navigation::redirect_http_to_https使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Navigation
的用法示例。
在下文中一共展示了Navigation::redirect_http_to_https方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initialize_user
<?php
// initweb.php -- HotCRP initialization for web scripts
// HotCRP is Copyright (c) 2006-2015 Eddie Kohler and Regents of the UC
// Distributed under an MIT-like license; see LICENSE
require_once "init.php";
global $Conf, $Opt;
// Check for redirect to https
if (@$Opt["redirectToHttps"]) {
Navigation::redirect_http_to_https(@$Opt["allowLocalHttp"]);
}
// Check and fix zlib output compression
global $zlib_output_compression;
$zlib_output_compression = false;
if (function_exists("zlib_get_coding_type")) {
$zlib_output_compression = zlib_get_coding_type();
}
if ($zlib_output_compression) {
header("Content-Encoding: {$zlib_output_compression}");
header("Vary: Accept-Encoding", false);
}
// Set up sessions
$Opt["globalSessionLifetime"] = ini_get("session.gc_maxlifetime");
if (!isset($Opt["sessionLifetime"])) {
$Opt["sessionLifetime"] = 86400;
}
ini_set("session.gc_maxlifetime", $Opt["sessionLifetime"]);
ensure_session();
// Initialize user
function initialize_user()
{
示例2: header
<?php
// initweb.php -- HotCRP initialization for web scripts
// HotCRP is Copyright (c) 2006-2016 Eddie Kohler and Regents of the UC
// See LICENSE for open-source distribution terms
require_once "init.php";
global $Conf, $Me, $Opt;
// Check for redirect to https
if (get($Opt, "redirectToHttps")) {
Navigation::redirect_http_to_https(get($Opt, "allowLocalHttp"));
}
// Check and fix zlib output compression
global $zlib_output_compression;
$zlib_output_compression = false;
if (function_exists("zlib_get_coding_type")) {
$zlib_output_compression = zlib_get_coding_type();
}
if ($zlib_output_compression) {
header("Content-Encoding: {$zlib_output_compression}");
header("Vary: Accept-Encoding", false);
}
// Mark as already expired to discourage caching, but allow the browser
// to cache for history buttons
header("Cache-Control: max-age=0,must-revalidate,private");
// Don't set up a session if $Me is false
if ($Me === false) {
return;
}
// Set up session
$Opt["globalSessionLifetime"] = ini_get("session.gc_maxlifetime");
if (!isset($Opt["sessionLifetime"])) {