Example #1
0
 function IsCacheExpired($path)
 {
     if (is_object($this) && $this instanceof CPHPCache) {
         return $this->cache->isCacheExpired($path);
     } else {
         $obCache = new CPHPCache();
         return $obCache->IsCacheExpired($path);
     }
 }
Example #2
0
                }
                $CACHE_MANAGER->EndTagCache();
            } else {
                if (!($arCurSection = $dbRes->Fetch())) {
                    $arCurSection = array();
                }
            }
        }
        $obCache->EndDataCache($arCurSection);
    }
    if (!isset($arCurSection)) {
        $arCurSection = array();
    }
}
///////////////////////////
$сacheObj = Bitrix\Main\Data\Cache::createInstance();
$cacheTimeSm = 3600;
$cacheIdSm = 'arrFilterrr';
$cacheDirSm = '/' . $cacheIdSm;
$arrFilterrr = [];
global $arSimilarItems;
if ($сacheObj->InitCache($cacheTimeSm, $cacheIdSm, $cacheDirSm)) {
    $arrFilterrr = $сacheObj->GetVars();
} elseif ($сacheObj->StartDataCache()) {
    function GetPreLinkProducts($iblockId, $elementId, $showCountElBySides, $sectionId)
    {
        if (CModule::IncludeModule("iblock")) {
            $resdb = CIBlockElement::GetList(array('ID' => 'DESC'), array('IBLOCK_ID' => $iblockId, 'SECTION_ID' => $sectionId, 'ACTIVE' => 'Y', 'SECTION_GLOBAL_ACTIVE' => 'Y'), false, array('nPageSize' => $showCountElBySides, 'nElementID' => $elementId), array());
            $linkProds = [];
            while ($res = $resdb->fetch()) {
                if ($res['ID'] !== $elementId) {