function createCache() { // clear page blocks cache for join and search form blocks bx_import('BxDolPageViewAdmin'); // for clear caching abilities $oPageViewCacher = new BxDolPageViewCacher('', ''); $oCacheBlocks = $oPageViewCacher->getBlocksCacheObject(); $aBlockIds = array(4, 146, 147, 156); $aKeys = array(true . 'tab' . false, false . 'tab' . false, true . 'popup' . false, false . 'popup' . false, true . 'tab' . true, false . 'tab' . true, true . 'popup' . true, false . 'popup' . true); foreach ($aBlockIds as $iBlockId) { foreach ($aKeys as $sKey) { $oCacheBlocks->delData($oPageViewCacher->genBlocksCacheKey($iBlockId . $sKey)); } } $sCacheString = "// cache of Profile Fields\n\nreturn array(\n //areas\n"; // get areas foreach ($this->aAreasProps as $iAreaID => $aArea) { $oArea = new BxDolProfileFieldsArea($iAreaID, $this); $sCacheString .= $oArea->getCacheString(); } $sCacheString .= ");\n"; $aCacheArray = eval($sCacheString); $oCache = $GLOBALS['MySQL']->getDbCacheObject(); return $oCache->setData($GLOBALS['MySQL']->genDbCacheKey('sys_profile_fields'), $aCacheArray); }
function createCache($iBlockId = 0) { $oCacher = new BxDolPageViewCacher($this->sDBTable, $this->sCacheFile); $oCacher->createCache(); if ($iBlockId > 0) { $oCacheBlocks = $oCacher->getBlocksCacheObject(); $a = array($iBlockId . true . 'tab' . false, $iBlockId . false . 'tab' . false, $iBlockId . true . 'popup' . false, $iBlockId . false . 'popup' . false, $iBlockId . true . 'tab' . true, $iBlockId . false . 'tab' . true, $iBlockId . true . 'popup' . true, $iBlockId . false . 'popup' . true); foreach ($a as $sKey) { $oCacheBlocks->delData($oCacher->genBlocksCacheKey($sKey)); } } }