當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Cache::getCacheEngineType方法代碼示例

本文整理匯總了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");
開發者ID:akniyev,項目名稱:itprom_dobrohost,代碼行數:31,代碼來源:perfmon_panel.php

示例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;
 }
開發者ID:mrdeadmouse,項目名稱:u136006,代碼行數:8,代碼來源:measure.php

示例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"]++;
                     }
開發者ID:Satariall,項目名稱:izurit,代碼行數:31,代碼來源:cache.php


注:本文中的Bitrix\Main\Data\Cache::getCacheEngineType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。