21 $this->oCacheMemberMenu = $this->oMemberMenu->getCacheObject();
26 $this->oCachePb = $oPageViewCacher->getBlocksCacheObject ();
29 $this->oCacheDb =
$GLOBALS[
'MySQL']->getDbCacheObject();
32 $this->oCacheTemplates =
$GLOBALS[
'oSysTemplate']->getTemplatesCacheObject();
37 return $this->
_action($sCache,
'clear');
40 function size($sCache, $isFormatted =
false)
42 $iSize = $this->
_action($sCache,
'size');
43 return $isFormatted ? sprintf(
"%.2f", $iSize / 1024 / 1024) : $iSize;
48 $sFuncCacheObject = (
'clear' ==
$sMode ?
'_clearCacheObject' :
'_getSizeCacheObject');
49 $sFuncCacheFile = (
'clear' ==
$sMode ?
'_clearCache' :
'_getSizeCache');
54 $mixedResult = $this->$sFuncCacheObject ($this->oCacheMemberMenu, $this->oMemberMenu->sMenuMemberKeysCache);
58 $mixedResult = $this->$sFuncCacheObject ($this->oCacheDb,
'pb_');
62 $mixedResult = $this->$sFuncCacheFile(
'user', CH_DIRECTORY_PATH_CACHE);
66 $mixedResult = $this->$sFuncCacheObject ($this->oCacheDb,
'db_');
70 $mixedResult = $this->$sFuncCacheObject ($this->oCacheTemplates,
$GLOBALS[
'oSysTemplate']->_sCacheFilePrefix);
74 $mixedResult = $this->$sFuncCacheFile(
$GLOBALS[
'oSysTemplate']->_sCssCachePrefix, CH_DIRECTORY_PATH_CACHE_PUBLIC);
78 $mixedResult = $this->$sFuncCacheFile(
$GLOBALS[
'oSysTemplate']->_sJsCachePrefix, CH_DIRECTORY_PATH_CACHE_PUBLIC);
87 if (
'db_' == $sPrefix)
88 $GLOBALS[
'MySQL']->oParams->clearCache();
89 elseif ($this->oMemberMenu->sMenuMemberKeysCache == $sPrefix)
90 $this->oMemberMenu->deleteMemberMenuCaches();
92 if (!
$oCache->removeAllByPrefix ($sPrefix))
93 return array(
'code' => 1,
'message' =>
_t(
'_adm_txt_dashboard_cache_clean_failed'));
95 return array(
'code' => 0,
'message' =>
_t(
'_adm_txt_dashboard_cache_clean_success'));
99 return $oCache->getSizeByPrefix ($sPrefix);
104 if (!($rHandler = opendir($sPath)))
105 return array(
'code' => 1,
'message' =>
_t(
'_adm_txt_dashboard_cache_clean_failed'));
107 $l = strlen($sPrefix);
108 while ((
$sFile = readdir($rHandler)) !==
false)
109 if (0 === strncmp(
$sFile, $sPrefix, $l))
114 return array(
'code' => 0,
'message' =>
_t(
'_adm_txt_dashboard_cache_clean_success'));
118 if (!($rHandler = opendir($sPath)))
122 $l = strlen($sPrefix);
123 while ((
$sFile = readdir($rHandler)) !==
false)
124 if (0 === strncmp(
$sFile, $sPrefix, $l))
125 $iSize += filesize($sPath .
$sFile);