function __construct() { // member menu bx_import('BxDolMemberMenu'); $this->oMemberMenu = new BxDolMemberMenu(); $this->oCacheMemberMenu = $this->oMemberMenu->getCacheObject(); // page blocks bx_import('BxDolPageViewAdmin'); $oPageViewCacher = new BxDolPageViewCacher('', ''); $this->oCachePb = $oPageViewCacher->getBlocksCacheObject(); // DB $this->oCacheDb = $GLOBALS['MySQL']->getDbCacheObject(); // templates $this->oCacheTemplates = $GLOBALS['oSysTemplate']->getTemplatesCacheObject(); }
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 actionRecompilePageBuilder($bInstall = true) { ob_start(); $oPVCacher = new BxDolPageViewCacher('sys_page_compose', 'sys_page_compose.inc'); $bResult = $oPVCacher->createCache(); ob_get_clean(); return $bResult ? BX_DOL_INSTALLER_SUCCESS : BX_DOL_INSTALLER_FAILED; }
function createCache() { $oCacher = new BxDolPageViewCacher($this->sDBTable, $this->sCacheFile); $oCacher->createCache(); }
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)); } } }
$oCacheTemplates = $GLOBALS['oSysTemplate']->getTemplatesCacheObject(); $aResult = clearCacheObject($oCacheTemplates, $GLOBALS['oSysTemplate']->_sCacheFilePrefix); if ($aResult['code'] != 0) { break; } // CSS $aResult = clearCache($GLOBALS['oSysTemplate']->_sCssCachePrefix, BX_DIRECTORY_PATH_CACHE_PUBLIC); if ($aResult['code'] != 0) { break; } // JS $aResult = clearCache($GLOBALS['oSysTemplate']->_sJsCachePrefix, BX_DIRECTORY_PATH_CACHE_PUBLIC); break; case 'pb': bx_import('BxDolPageViewAdmin'); $oPageViewCacher = new BxDolPageViewCacher('', ''); $oCachePb = $oPageViewCacher->getBlocksCacheObject(); $aResult = clearCacheObject($oCachePb, 'pb_'); break; case 'users': //member menu bx_import('BxDolMemberMenu'); $oMemberMenu = new BxDolMemberMenu(); $oMemberMenu->deleteMemberMenuCaches(); $aResult = clearCache('user', BX_DIRECTORY_PATH_CACHE); break; case 'db': $GLOBALS['MySQL']->oParams->clearCache(); $oCacheDb = $GLOBALS['MySQL']->getDbCacheObject(); $aResult = clearCacheObject($oCacheDb, 'db_'); break;