本文整理汇总了PHP中CPHPCache::abortDataCache方法的典型用法代码示例。如果您正苦于以下问题:PHP CPHPCache::abortDataCache方法的具体用法?PHP CPHPCache::abortDataCache怎么用?PHP CPHPCache::abortDataCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPHPCache
的用法示例。
在下文中一共展示了CPHPCache::abortDataCache方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: resolveComponentEngine
public static function resolveComponentEngine(CComponentEngine $engine, $pageCandidates, &$arVariables)
{
/** @global CMain $APPLICATION */
global $APPLICATION, $CACHE_MANAGER;
$component = $engine->GetComponent();
if ($component) {
$iblock_id = intval($component->arParams["IBLOCK_ID"]);
} else {
$iblock_id = 0;
}
$requestURL = $APPLICATION->GetCurPage(true);
$cacheId = $requestURL . implode("|", array_keys($pageCandidates));
$cache = new CPHPCache();
if ($cache->startDataCache(3600, $cacheId, "iblock_find")) {
if (defined("BX_COMP_MANAGED_CACHE")) {
$CACHE_MANAGER->StartTagCache("iblock_find");
CIBlock::registerWithTagCache($iblock_id);
}
foreach ($pageCandidates as $pageID => $arVariablesTmp) {
if ($arVariablesTmp["SECTION_CODE_PATH"] != "" && (isset($arVariablesTmp["ELEMENT_ID"]) || isset($arVariablesTmp["ELEMENT_CODE"]))) {
if (CIBlockFindTools::checkElement($iblock_id, $arVariablesTmp)) {
$arVariables = $arVariablesTmp;
if (defined("BX_COMP_MANAGED_CACHE")) {
$CACHE_MANAGER->EndTagCache();
}
$cache->endDataCache(array($pageID, $arVariablesTmp));
return $pageID;
}
}
}
foreach ($pageCandidates as $pageID => $arVariablesTmp) {
if ($arVariablesTmp["SECTION_CODE_PATH"] != "" && (!isset($arVariablesTmp["ELEMENT_ID"]) && !isset($arVariablesTmp["ELEMENT_CODE"]))) {
if (CIBlockFindTools::checkSection($iblock_id, $arVariablesTmp)) {
$arVariables = $arVariablesTmp;
if (defined("BX_COMP_MANAGED_CACHE")) {
$CACHE_MANAGER->EndTagCache();
}
$cache->endDataCache(array($pageID, $arVariablesTmp));
return $pageID;
}
}
}
if (defined("BX_COMP_MANAGED_CACHE")) {
$CACHE_MANAGER->AbortTagCache();
}
$cache->abortDataCache();
} else {
$vars = $cache->getVars();
$pageID = $vars[0];
$arVariables = $vars[1];
return $pageID;
}
list($pageID, $arVariables) = each($pageCandidates);
return $pageID;
}
示例2: abortResultCache
/**
* Function aborts the cache after it's start.
*
* <p>Note: must be called if component returns before endResultCache or includeComponentTemplate called.</p>
* @return void
*
*/
public final function abortResultCache()
{
global $CACHE_MANAGER;
if (!$this->__bInited) {
return null;
}
if (!$this->__cache) {
return null;
}
$this->__cache->abortDataCache();
if (defined("BX_COMP_MANAGED_CACHE")) {
$CACHE_MANAGER->abortTagCache();
}
$this->__cache = null;
}
示例3: resolveComponentEngine
public static function resolveComponentEngine(CComponentEngine $engine, $pageCandidates, &$arVariables)
{
/** @global CMain $APPLICATION */
global $APPLICATION, $CACHE_MANAGER;
static $aSearch = array("<", ">", """, "'");
static $aReplace = array("<", ">", "\"", "'");
$component = $engine->GetComponent();
if ($component) {
$iblock_id = intval($component->arParams["IBLOCK_ID"]);
} else {
$iblock_id = 0;
}
//To fix GetPagePath security hack for SMART_FILTER_PATH
foreach ($pageCandidates as $pageID => $arVariablesTmp) {
foreach ($arVariablesTmp as $variableName => $variableValue) {
if ($variableName === "SMART_FILTER_PATH") {
$pageCandidates[$pageID][$variableName] = str_replace($aSearch, $aReplace, $variableValue);
}
}
}
$requestURL = $APPLICATION->GetCurPage(true);
$cacheId = $requestURL . implode("|", array_keys($pageCandidates)) . "|" . SITE_ID;
$cache = new CPHPCache();
if ($cache->startDataCache(3600, $cacheId, "iblock_find")) {
if (defined("BX_COMP_MANAGED_CACHE")) {
$CACHE_MANAGER->StartTagCache("iblock_find");
CIBlock::registerWithTagCache($iblock_id);
}
foreach ($pageCandidates as $pageID => $arVariablesTmp) {
if ($arVariablesTmp["SECTION_CODE_PATH"] != "" && (isset($arVariablesTmp["ELEMENT_ID"]) || isset($arVariablesTmp["ELEMENT_CODE"]))) {
if (CIBlockFindTools::checkElement($iblock_id, $arVariablesTmp)) {
$arVariables = $arVariablesTmp;
if (defined("BX_COMP_MANAGED_CACHE")) {
$CACHE_MANAGER->EndTagCache();
}
$cache->endDataCache(array($pageID, $arVariablesTmp));
return $pageID;
}
}
}
foreach ($pageCandidates as $pageID => $arVariablesTmp) {
if ($arVariablesTmp["SECTION_CODE_PATH"] != "" && (!isset($arVariablesTmp["ELEMENT_ID"]) && !isset($arVariablesTmp["ELEMENT_CODE"]))) {
if (CIBlockFindTools::checkSection($iblock_id, $arVariablesTmp)) {
$arVariables = $arVariablesTmp;
if (defined("BX_COMP_MANAGED_CACHE")) {
$CACHE_MANAGER->EndTagCache();
}
$cache->endDataCache(array($pageID, $arVariablesTmp));
return $pageID;
}
}
}
if (defined("BX_COMP_MANAGED_CACHE")) {
$CACHE_MANAGER->AbortTagCache();
}
$cache->abortDataCache();
} else {
$vars = $cache->getVars();
$pageID = $vars[0];
$arVariables = $vars[1];
return $pageID;
}
reset($pageCandidates);
list($pageID, $arVariables) = each($pageCandidates);
return $pageID;
}