本文整理汇总了PHP中MWExceptionHandler::installHandler方法的典型用法代码示例。如果您正苦于以下问题:PHP MWExceptionHandler::installHandler方法的具体用法?PHP MWExceptionHandler::installHandler怎么用?PHP MWExceptionHandler::installHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MWExceptionHandler
的用法示例。
在下文中一共展示了MWExceptionHandler::installHandler方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
$headers = [];
foreach (headers_list() as $header) {
list($name, $value) = explode(':', $header, 2);
$headers[strtolower(trim($name))][] = trim($value);
}
if (isset($headers['set-cookie'])) {
$cacheControl = isset($headers['cache-control']) ? implode(', ', $headers['cache-control']) : '';
if (!preg_match('/(?:^|,)\\s*(?:private|no-cache|no-store)\\s*(?:$|,)/i', $cacheControl)) {
header('Expires: Thu, 01 Jan 1970 00:00:00 GMT');
header('Cache-Control: private, max-age=0, s-maxage=0');
MediaWiki\Logger\LoggerFactory::getInstance('cache-cookies')->warning('Cookies set on {url} with Cache-Control "{cache-control}"', ['url' => WebRequest::getGlobalRequestURL(), 'cookies' => $headers['set-cookie'], 'cache-control' => $cacheControl ?: '<not set>']);
}
}
});
}
MWExceptionHandler::installHandler();
require_once "{$IP}/includes/compat/normal/UtfNormalUtil.php";
$ps_validation = Profiler::instance()->scopedProfileIn($fname . '-validation');
// T48998: Bail out early if $wgArticlePath is non-absolute
foreach (['wgArticlePath', 'wgVariantArticlePath'] as $varName) {
if (${$varName} && !preg_match('/^(https?:\\/\\/|\\/)/', ${$varName})) {
throw new FatalError("If you use a relative URL for \${$varName}, it must start " . 'with a slash (<code>/</code>).<br><br>See ' . "<a href=\"https://www.mediawiki.org/wiki/Manual:\${$varName}\">" . "https://www.mediawiki.org/wiki/Manual:\${$varName}</a>.");
}
}
Profiler::instance()->scopedProfileOut($ps_validation);
$ps_default2 = Profiler::instance()->scopedProfileIn($fname . '-defaults2');
if ($wgCanonicalServer === false) {
$wgCanonicalServer = wfExpandUrl($wgServer, PROTO_HTTP);
}
// Set server name
$serverParts = wfParseUrl($wgCanonicalServer);