本文整理汇总了PHP中CHTTP::GetLastStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP CHTTP::GetLastStatus方法的具体用法?PHP CHTTP::GetLastStatus怎么用?PHP CHTTP::GetLastStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CHTTP
的用法示例。
在下文中一共展示了CHTTP::GetLastStatus方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _Check404Error
function _Check404Error(){
if(defined('ERROR_404') && ERROR_404=='Y' || CHTTP::GetLastStatus() == "404 Not Found"){
global $APPLICATION;
$APPLICATION->RestartBuffer();
require ($_SERVER['DOCUMENT_ROOT'].SITE_TEMPLATE_PATH.'/header.php');
require $_SERVER['DOCUMENT_ROOT'].'/404.php';
require ($_SERVER['DOCUMENT_ROOT'].SITE_TEMPLATE_PATH.'/footer.php');
}
}
示例2: f
if (w.opera == "[object Opera]") {
d.addEventListener("DOMContentLoaded", f, false);
} else { f(); }
})(document, window, "yandex_metrika_callbacks");
</script>
<noscript><div><img src="https://mc.yandex.ru/watch/29322070" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<!-- /Yandex.Metrika counter -->
</body>
</html>
<?php
if (!strlen(trim($APPLICATION->GetProperty('H1')))) {
$APPLICATION->SetPageProperty('H1', $APPLICATION->GetTitle());
}
if ($APPLICATION->GetProperty('SHOW_H1') != 'N') {
$APPLICATION->SetPageProperty('_h1', '<h1 class="title_page">' . $APPLICATION->GetProperty('h1') . '</h1>');
}
if (strlen(trim($APPLICATION->GetProperty('ARTICLE_CLASS'))) == 0) {
$APPLICATION->SetPageProperty('ARTICLE_CLASS', $APPLICATION->GetProperty('ARTICLE_CLASS') . " b_dop_content");
}
$page = $APPLICATION->GetCurPage();
if (CHTTP::GetLastStatus() == "404 Not Found" && $page != "/404.php") {
if (preg_match("/\\/(.*?)[^\\/]\$/i", $page, $arRes)) {
LocalRedirect($arRes[0] . "/");
die;
}
$APPLICATION->RestartBuffer();
echo file_get_contents("http://" . $_SERVER["SERVER_NAME"] . "/404.php?404=N");
die;
}
示例3: isCacheable
/**
* Returns true if file exists
* with predefined path (current request uri)
*
* @return bool
*/
public function isCacheable()
{
if ($this->cacheFile) {
if (isset($_SESSION["SESS_SHOW_TIME_EXEC"]) && $_SESSION["SESS_SHOW_TIME_EXEC"] == 'Y') {
return false;
} elseif (isset($_SESSION["SHOW_SQL_STAT"]) && $_SESSION["SHOW_SQL_STAT"] == 'Y') {
return false;
} elseif (isset($_SESSION["SHOW_CACHE_STAT"]) && $_SESSION["SHOW_CACHE_STAT"] == 'Y') {
return false;
}
$httpStatus = \CHTTP::GetLastStatus();
if ($httpStatus == 200 || $httpStatus === "") {
return $this->canCache;
} else {
return false;
}
} else {
return false;
}
}
示例4: isCacheable
/**
* Returns true if we can cache current request
*
* @return bool
*/
public function isCacheable()
{
if ($this->storage === null) {
return false;
}
if ($this->cacheProvider !== null && $this->cacheProvider->isCacheable() === false) {
return false;
}
if (isset($_SESSION["SESS_SHOW_TIME_EXEC"]) && $_SESSION["SESS_SHOW_TIME_EXEC"] == 'Y') {
return false;
} elseif (isset($_SESSION["SHOW_SQL_STAT"]) && $_SESSION["SHOW_SQL_STAT"] == 'Y') {
return false;
} elseif (isset($_SESSION["SHOW_CACHE_STAT"]) && $_SESSION["SHOW_CACHE_STAT"] == 'Y') {
return false;
}
$httpStatus = intval(\CHTTP::GetLastStatus());
if ($httpStatus == 200 || $httpStatus === 0) {
return $this->canCache;
}
return false;
}