本文整理汇总了PHP中Bitrix\Main\Data\Cache::getCacheEngineType方法的典型用法代码示例。如果您正苦于以下问题:PHP Cache::getCacheEngineType方法的具体用法?PHP Cache::getCacheEngineType怎么用?PHP Cache::getCacheEngineType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bitrix\Main\Data\Cache
的用法示例。
在下文中一共展示了Cache::getCacheEngineType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetMessage
$cache_type = GetMessage("PERFMON_PANEL_CACHE_STORAGE_MEMCACHE");
break;
case "cacheengineapc":
$cache_type = GetMessage("PERFMON_PANEL_CACHE_STORAGE_APC");
break;
case "cacheenginexcache":
$cache_type = GetMessage("PERFMON_PANEL_CACHE_STORAGE_XCACHE");
break;
case "cacheenginefiles":
$cache_type = GetMessage("PERFMON_PANEL_CACHE_STORAGE_FILES");
break;
case "cacheenginememcachecluster":
$cache_type = GetMessage("PERFMON_PANEL_CACHE_STORAGE_CLUSTER");
break;
default:
$cache_type = \Bitrix\Main\Data\Cache::getCacheEngineType();
break;
}
?>
<td class="bx-digit-cell"><?php
echo $cache_type;
?>
</td>
<td><?php
echo GetMessage("PERFMON_PANEL_CACHE_STORAGE_REC");
?>
</td>
</tr>
<tr>
<td nowrap><?php
echo GetMessage("PERFMON_PANEL_MANAGED_CACHE");
示例2: GetParams
function GetParams()
{
$res = array("enabled" => array(array("PARAMETER" => 'eaccelerator.enable', "VALUE" => ini_get('eaccelerator.enable'), "RECOMMENDATION" => GetMessage("PERFMON_MEASURE_SET_REC", array("#value#" => "1")))), "cache_ttl" => array(array("PARAMETER" => 'eaccelerator.shm_ttl', "VALUE" => ini_get('eaccelerator.shm_ttl'), "RECOMMENDATION" => GetMessage("PERFMON_MEASURE_GREATER_THAN_ZERO_REC"))), "check_mtime" => array(array("PARAMETER" => 'eaccelerator.check_mtime', "VALUE" => ini_get('eaccelerator.check_mtime'), "RECOMMENDATION" => GetMessage("PERFMON_MEASURE_SET_REC", array("#value#" => "1")))), "memory_pct" => array(array("PARAMETER" => 'eaccelerator.shm_size (' . GetMessage("PERFMON_MEASURE_CURRENT_VALUE", array("#value#" => ini_get('eaccelerator.shm_size'))) . ')', "VALUE" => ini_get('eaccelerator.shm_size'), "RECOMMENDATION" => GetMessage("PERFMON_MEASURE_EQUAL_OR_GREATER_THAN_REC", array("#value#" => "40")))));
if (\Bitrix\Main\Data\Cache::getCacheEngineType() == "cacheengineeaccelerator") {
$res["cache_limit"] = array(array("PARAMETER" => 'eaccelerator.shm_max', "VALUE" => ini_get('eaccelerator.shm_max'), "RECOMMENDATION" => GetMessage("PERFMON_MEASURE_GREATER_THAN_ZERO_REC")));
}
return $res;
}
示例3: usleep
if (@unlink($file)) {
$_SESSION["CACHE_STAT"]["deleted"]++;
$_SESSION["CACHE_STAT"]["space_freed"] += $file_size;
$space_freed += $file_size;
} else {
$_SESSION["CACHE_STAT"]["errors"]++;
}
if (time() >= $endTime) {
break;
}
}
//no more than 200 files per second
usleep(5000);
}
CHTMLPagesCache::writeStatistic(0, 0, 0, 0, -$space_freed);
} elseif (\Bitrix\Main\Data\Cache::getCacheEngineType() == "cacheenginefiles") {
$obCacheCleaner->Start();
while ($file = $obCacheCleaner->GetNextFile()) {
if (is_string($file)) {
$date_expire = $obCacheCleaner->GetFileExpiration($file);
if ($date_expire) {
$file_size = filesize($file);
$_SESSION["CACHE_STAT"]["scanned"]++;
$_SESSION["CACHE_STAT"]["space_total"] += $file_size;
if ($bDoNotCheckExpiredDate || $date_expire < $curentTime) {
if (@unlink($file)) {
$_SESSION["CACHE_STAT"]["deleted"]++;
$_SESSION["CACHE_STAT"]["space_freed"] += $file_size;
} else {
$_SESSION["CACHE_STAT"]["errors"]++;
}