コード例 #1
0
ファイル: Memcached.php プロジェクト: Devitek/orm
 /**
  * Retrieves cached information from the data store.
  * @since 2.2
  * @return array|null An associative array with server's statistics if available, NULL otherwise.
  */
 protected function doGetStats()
 {
     $stats = $this->store->getMemcached()->getStats();
     $servers = $this->store->getMemcached()->getServerList();
     $key = $servers[0]['host'] . ':' . $servers[0]['port'];
     $stats = $stats[$key];
     return [Cache::STATS_HITS => $stats['get_hits'], Cache::STATS_MISSES => $stats['get_misses'], Cache::STATS_UPTIME => $stats['uptime'], Cache::STATS_MEMORY_USAGE => $stats['bytes'], Cache::STATS_MEMORY_AVAILABLE => $stats['limit_maxbytes']];
 }
コード例 #2
0
 /**
  * Get the underlying Memcached connection.
  *
  * @return \Memcached 
  * @static 
  */
 public static function getMemcached()
 {
     return \Illuminate\Cache\MemcachedStore::getMemcached();
 }