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


PHP Cache::getStats方法代碼示例

本文整理匯總了PHP中Doctrine\Common\Cache\Cache::getStats方法的典型用法代碼示例。如果您正苦於以下問題:PHP Cache::getStats方法的具體用法?PHP Cache::getStats怎麽用?PHP Cache::getStats使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Doctrine\Common\Cache\Cache的用法示例。


在下文中一共展示了Cache::getStats方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: build

 /**
  * @param EntityManager $em
  * @param bool $doCache
  * @param Cache|null $cache
  * @param CacheHitsContainer|null $hitsContainer
  * @return DbCacheableExecutor|DbExecutor
  */
 public static function build(EntityManagerInterface $em, $doCache = false, Cache $cache = null, CacheHitsContainer $hitsContainer = null)
 {
     if (!$cache) {
         return new DbExecutor($em);
     }
     try {
         $stats = $cache->getStats();
         if (isset($stats[Cache::STATS_UPTIME]) && !$stats[Cache::STATS_UPTIME]) {
             throw new \Exception('cache down');
         }
     } catch (\Exception $e) {
         return new DbExecutor($em);
     }
     if ($doCache) {
         return new DbCacheableExecutor($em, $cache, $hitsContainer);
     }
     return new DbExecutor($em);
 }
開發者ID:lsnova,項目名稱:simple-query-executor,代碼行數:25,代碼來源:ExecutorFactory.php

示例2: getStats

 public function getStats()
 {
     return $this->cache->getStats();
 }
開發者ID:AWSRandall,項目名稱:aws-sdk-php,代碼行數:4,代碼來源:DoctrineCacheAdapter.php

示例3: getStats

 public function getStats()
 {
     return $this->getEncryptionStats($this->decorated->getStats() ?: []);
 }
開發者ID:jeskew,項目名稱:doctrine-cache-encrypter,代碼行數:4,代碼來源:Decorator.php

示例4: getStats

 public function getStats()
 {
     return self::$cache->getStats();
 }
開發者ID:natanaelsimoes,項目名稱:zeus-framework,代碼行數:4,代碼來源:Cache.php

示例5: getStats

 /**
  * Retrieves cached information from the data store.
  *
  * The server's statistics array has the following values:
  *
  * - <b>hits</b>
  * Number of keys that have been requested and found present.
  *
  * - <b>misses</b>
  * Number of items that have been requested and not found.
  *
  * - <b>uptime</b>
  * Time that the server is running.
  *
  * - <b>memory_usage</b>
  * Memory used by this server to store items.
  *
  * - <b>memory_available</b>
  * Memory allowed to use for storage.
  *
  * @since 2.2
  *
  * @return array|null An associative array with server's statistics if available, NULL otherwise.
  */
 public function getStats()
 {
     return $this->doctrineCache->getStats();
 }
開發者ID:sphring,項目名稱:sphring-cache,代碼行數:28,代碼來源:DoctrineCacheManager.php

示例6: getStats

 /**
  * Retrieves cached information from the data store.
  *
  * The server's statistics array has the following values:
  *
  * - <b>hits</b>
  * Number of keys that have been requested and found present.
  *
  * - <b>misses</b>
  * Number of items that have been requested and not found.
  *
  * - <b>uptime</b>
  * Time that the server is running.
  *
  * - <b>memory_usage</b>
  * Memory used by this server to store items.
  *
  * - <b>memory_available</b>
  * Memory allowed to use for storage.
  *
  * @since 2.2
  *
  * @return array|null An associative array with server's statistics if available, NULL otherwise.
  */
 public function getStats()
 {
     return $this->CacheDriver->getStats();
 }
開發者ID:AgniCMS,項目名稱:agni-framework,代碼行數:28,代碼來源:Cache.php

示例7: getStats

 /**
  * @return array|null
  */
 public function getStats()
 {
     return $this->cacheProvider->getStats();
 }
開發者ID:caxy,項目名稱:php-htmldiff,代碼行數:7,代碼來源:DiffCache.php


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