• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wincache_ucache_info函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中wincache_ucache_info函数的典型用法代码示例。如果您正苦于以下问题:PHP wincache_ucache_info函数的具体用法?PHP wincache_ucache_info怎么用?PHP wincache_ucache_info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了wincache_ucache_info函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: status

 public function status()
 {
     $status = wincache_ucache_info(true);
     $return['缓存命中'] = $status['total_hit_count'];
     $return['缓存未命中'] = $status['total_miss_count'];
     return $return;
 }
开发者ID:syjzwjj,项目名称:quyeba,代码行数:7,代码来源:wincache.php


示例2: _getCacheKeys

 /**
  * Fetch an array of all keys stored in cache
  *
  * @return array Returns the array of cache keys
  */
 protected function _getCacheKeys()
 {
     $ci = wincache_ucache_info();
     $keys = array();
     foreach ($ci['ucache_entries'] as $entry) {
         $keys[] = $entry['key_name'];
     }
     return $keys;
 }
开发者ID:juokaz,项目名称:wincache-adapters,代码行数:14,代码来源:WinCache.php


示例3: gc

 public function gc()
 {
     $allinfo = wincache_ucache_info();
     $keys = $allinfo['cache_entries'];
     $secret = $this->_hash;
     foreach ($keys as $key) {
         if (strpos($key['key_name'], $secret . '-cache-')) {
             wincache_ucache_get($key['key_name']);
         }
     }
 }
开发者ID:vanie3,项目名称:appland,代码行数:11,代码来源:wincache.php


示例4: cs_cache_info

function cs_cache_info()
{
    $form = array();
    $info = wincache_ucache_info();
    foreach ($info['ucache_entries'] as $num => $data) {
        $handle = $data['key_name'] . ' (' . $num . ')';
        $age = time() - $data['age_seconds'];
        $form[$handle] = array('name' => $handle, 'time' => $age, 'size' => $data['value_size']);
    }
    ksort($form);
    return array_values($form);
}
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:12,代码来源:wincache.php


示例5: keys

 /**
  * @return Array
  */
 public function keys()
 {
     $info = wincache_ucache_info();
     $list = $info['ucache_entries'];
     $keys = array();
     if (is_null($list)) {
         return array();
     }
     foreach ($list as $entry) {
         $keys[] = $entry['key_name'];
     }
     return $keys;
 }
开发者ID:seedbank,项目名称:old-repo,代码行数:16,代码来源:WinCacheBagOStuff.php


示例6: clear

 /**
  * Delete all keys from the cache
  *
  * @param bool $check if true will check expiration, otherwise delete all
  * @return bool True if the cache was successfully cleared, false otherwise
  */
 public function clear($check)
 {
     if ($check) {
         return true;
     }
     $info = wincache_ucache_info();
     $cacheKeys = $info['ucache_entries'];
     unset($info);
     foreach ($cacheKeys as $key) {
         wincache_ucache_delete($key['key_name']);
     }
     return true;
 }
开发者ID:coretyson,项目名称:coretyson,代码行数:19,代码来源:WinCacheEngine.php


示例7: filter

 public function filter($prefix)
 {
     $prefixLen = strlen($prefix);
     $info = wincache_ucache_info();
     $keysToDelete = array();
     foreach ($info['ucache_entries'] as $entry) {
         if (empty($entry['is_session']) && 0 === strncmp($entry['key_name'], $prefix, $prefixLen)) {
             $keysToDelete[] = $entry['key_name'];
         }
     }
     if ($keysToDelete) {
         wincache_ucache_delete($keysToDelete);
     }
     return true;
 }
开发者ID:kuria,项目名称:cache,代码行数:15,代码来源:WinCacheDriver.php


示例8: getIterator

 /**
  * Retrieve an external iterator
  * 
  * Returns an external iterator.
  * 
  * @param string|null $filter   A PCRE regular expression.
  *     Only matching keys will be iterated over.
  *     Setting this to NULL matches all keys of this instance.
  * @param bool        $keysOnly Whether to return only the keys,
  *     or return both the keys and values.
  * 
  * @return ArrayObject An array with all matching keys as array keys,
  *     and values as array values. If $keysOnly is TRUE, the array keys are
  *     numeric, and the array values are key names.
  */
 public function getIterator($filter = null, $keysOnly = false)
 {
     $info = wincache_ucache_info();
     $result = array();
     foreach ($info['ucache_entries'] as $entry) {
         if (!$entry['is_session'] && 0 === strpos($entry['key_name'], $this->persistentId)) {
             $localKey = strstr($entry['key_name'], $this->persistentId);
             if (null === $filter || preg_match($filter, $localKey)) {
                 if ($keysOnly) {
                     $result[] = $localKey;
                 } else {
                     $result[$localKey] = apc_fetch($localKey);
                 }
             }
         }
     }
     return new ArrayObject($result);
 }
开发者ID:CBEPX,项目名称:yii2-mikrotik,代码行数:33,代码来源:Wincache.php


示例9: stats

 function stats()
 {
     echo "<p>\n";
     foreach ($this->stats as $stat => $n) {
         echo "<strong>{$stat}</strong> {$n}";
         echo "<br/>\n";
     }
     echo "</p>\n";
     echo "<h3>WinCache:</h3>";
     foreach ($this->group_ops as $group => $ops) {
         if (!isset($_GET['debug_queries']) && 500 < count($ops)) {
             $ops = array_slice($ops, 0, 500);
             echo "<big>Too many to show! <a href='" . add_query_arg('debug_queries', 'true') . "'>Show them anyway</a>.</big>\n";
         }
         echo "<h4>{$group} commands</h4>";
         echo "<pre>\n";
         $lines = array();
         foreach ($ops as $op) {
             $lines[] = $this->colorize_debug_line($op);
         }
         print_r($lines);
         echo "</pre>\n";
     }
     if ($this->debug) {
         $wincache_info = wincache_ucache_info();
         echo "<p>";
         echo "<strong>Cache Hits:</strong> {$wincache_info['total_hit_count']}<br/>\n";
         echo "<strong>Cache Misses:</strong> {$wincache_info['total_miss_count']}\n";
         echo "</p>\n";
     }
 }
开发者ID:IDOAgency,项目名称:PAHClinic,代码行数:31,代码来源:wincache.object-cache.php


示例10: internalGetMetadata

 /**
  * Get metadata of an item.
  *
  * @param  string $normalizedKey
  * @return array|bool Metadata on success, false on failure
  * @throws Exception\ExceptionInterface
  */
 protected function internalGetMetadata(&$normalizedKey)
 {
     $options = $this->getOptions();
     $namespace = $options->getNamespace();
     $prefix = $namespace === '' ? '' : $namespace . $options->getNamespaceSeparator();
     $internalKey = $prefix . $normalizedKey;
     $info = wincache_ucache_info(true, $internalKey);
     if (isset($info['ucache_entries'][1])) {
         $metadata = $info['ucache_entries'][1];
         $this->normalizeMetadata($metadata);
         return $metadata;
     }
     return false;
 }
开发者ID:CHRISTOPHERVANDOMME,项目名称:zf2complet,代码行数:21,代码来源:WinCache.php


示例11: reset

 /**
  *	Clear contents of cache backend
  *	@return bool
  *	@param $suffix string
  *	@param $lifetime int
  **/
 function reset($suffix = NULL, $lifetime = 0)
 {
     if (!$this->dsn) {
         return TRUE;
     }
     $regex = '/' . preg_quote($this->prefix . '.', '/') . '.+?' . preg_quote($suffix, '/') . '/';
     $parts = explode('=', $this->dsn, 2);
     switch ($parts[0]) {
         case 'apc':
         case 'apcu':
             $info = apc_cache_info('user');
             if (!empty($info['cache_list'])) {
                 $key = array_key_exists('info', $info['cache_list'][0]) ? 'info' : 'key';
                 $mtkey = array_key_exists('mtime', $info['cache_list'][0]) ? 'mtime' : 'modification_time';
                 foreach ($info['cache_list'] as $item) {
                     if (preg_match($regex, $item[$key]) && $item[$mtkey] + $lifetime < time()) {
                         apc_delete($item[$key]);
                     }
                 }
             }
             return TRUE;
         case 'redis':
             $fw = Base::instance();
             $keys = $this->ref->keys($this->prefix . '.*' . $suffix);
             foreach ($keys as $key) {
                 $val = $fw->unserialize($this->ref->get($key));
                 if ($val[1] + $lifetime < time()) {
                     $this->ref->del($key);
                 }
             }
             return TRUE;
         case 'memcache':
             foreach (memcache_get_extended_stats($this->ref, 'slabs') as $slabs) {
                 foreach (array_filter(array_keys($slabs), 'is_numeric') as $id) {
                     foreach (memcache_get_extended_stats($this->ref, 'cachedump', $id) as $data) {
                         if (is_array($data)) {
                             foreach ($data as $key => $val) {
                                 if (preg_match($regex, $key) && $val[1] + $lifetime < time()) {
                                     memcache_delete($this->ref, $key);
                                 }
                             }
                         }
                     }
                 }
             }
             return TRUE;
         case 'wincache':
             $info = wincache_ucache_info();
             foreach ($info['ucache_entries'] as $item) {
                 if (preg_match($regex, $item['key_name']) && $item['use_time'] + $lifetime < time()) {
                     wincache_ucache_delete($item['key_name']);
                 }
             }
             return TRUE;
         case 'xcache':
             return TRUE;
             /* Not supported */
         /* Not supported */
         case 'folder':
             if ($glob = @glob($parts[1] . '*')) {
                 foreach ($glob as $file) {
                     if (preg_match($regex, basename($file)) && filemtime($file) + $lifetime < time()) {
                         @unlink($file);
                     }
                 }
             }
             return TRUE;
     }
     return FALSE;
 }
开发者ID:eghojansu,项目名称:moe,代码行数:76,代码来源:Cache.php


示例12: getStats

 /**
  * @return driverStatistic
  */
 public function getStats()
 {
     $memInfo = wincache_ucache_meminfo();
     $info = wincache_ucache_info();
     $date = (new \DateTime())->setTimestamp(time() - $info['total_cache_uptime']);
     return (new driverStatistic())->setInfo(sprintf("The Wincache daemon is up since %s.\n For more information see RawData.", $date->format(DATE_RFC2822)))->setSize($memInfo['memory_free'] - $memInfo['memory_total'])->setData(implode(', ', array_keys($this->itemInstances)))->setRawData($memInfo);
 }
开发者ID:jigoshop,项目名称:Jigoshop2,代码行数:10,代码来源:Driver.php


示例13: queryKeys

 /**
  * {@inheritdoc}
  *
  * @param  string $prefix
  * @return array
  */
 public function queryKeys($prefix = null)
 {
     $info = wincache_ucache_info();
     $entries = array();
     foreach ($info['ucache_entries'] as $entry) {
         if ($prefix === null) {
             $entries[] = $entry['key_name'];
         } else {
             if (substr($entry['key_name'], 0, strlen($prefix)) === $prefix) {
                 $entries[] = $entry['key_name'];
             }
         }
     }
     return $entries;
 }
开发者ID:shatkovskiy,项目名称:phalcon-sms-factory,代码行数:21,代码来源:Wincache.php


示例14: get_metadata

 /**
  * Get Cache Metadata
  *
  * @param	mixed	key to get cache metadata on
  * @return	mixed	array on success/false on failure
  */
 public function get_metadata($id)
 {
     if ($stored = wincache_ucache_info(FALSE, $id)) {
         $age = $stored['ucache_entries'][1]['age_seconds'];
         $ttl = $stored['ucache_entries'][1]['ttl_seconds'];
         $hitcount = $stored['ucache_entries'][1]['hitcount'];
         return array('expire' => $ttl - $age, 'hitcount' => $hitcount, 'age' => $age, 'ttl' => $ttl);
     }
     return FALSE;
 }
开发者ID:alyayazilim,项目名称:E-Ticaret-2015,代码行数:16,代码来源:Cache_wincache.php


示例15: clear

 /**
  * Delete all keys from the cache. This will clear every
  * item in the cache matching the cache config prefix.
  *
  * @param bool $check If true, nothing will be cleared, as entries will
  *   naturally expire in wincache..
  * @return bool True Returns true.
  */
 public function clear($check)
 {
     if ($check) {
         return true;
     }
     $info = wincache_ucache_info();
     $cacheKeys = $info['ucache_entries'];
     unset($info);
     foreach ($cacheKeys as $key) {
         if (strpos($key['key_name'], $this->_config['prefix']) === 0) {
             wincache_ucache_delete($key['key_name']);
         }
     }
     return true;
 }
开发者ID:CakeDC,项目名称:cakephp,代码行数:23,代码来源:WincacheEngine.php


示例16: getMeta

 /**
  * @inheritdoc
  */
 public function getMeta($id)
 {
     if ($stored = wincache_ucache_info(false, $id)) {
         $age = $stored['ucache_entries'][1]['age_seconds'];
         $ttl = $stored['ucache_entries'][1]['ttl_seconds'];
         $hitCount = $stored['ucache_entries'][1]['hitcount'];
         return ['expire' => $ttl - $age, 'hitcount' => $hitCount, 'age' => $age, 'ttl' => $ttl];
     }
     return false;
 }
开发者ID:dp-ifacesoft,项目名称:micro,代码行数:13,代码来源:WincacheCache.php


示例17: getIds

 /**
  * Return an array of stored cache ids
  *
  * @return array array of stored cache ids (string)
  */
 public function getIds()
 {
     $res = array();
     $array = wincache_ucache_info();
     $records = $array['ucache_entries'];
     foreach ($records as $record) {
         $res[] = $record['key_name'];
     }
     return $res;
 }
开发者ID:jasmun,项目名称:Noco100,代码行数:15,代码来源:WinCache.php


示例18: all

 /**
  * Get all cached data
  *
  * @return  array
  */
 public function all()
 {
     $hash = $this->options['hash'];
     $allinfo = wincache_ucache_info();
     $data = array();
     foreach ($allinfo['cache_entries'] as $key) {
         $name = $key['key_name'];
         $namearr = explode('-', $name);
         if ($namearr !== false && $namearr[0] == $hash && $namearr[1] == 'cache') {
             $group = $namearr[2];
             if (!isset($data[$group])) {
                 $item = new Auditor($group);
             } else {
                 $item = $data[$group];
             }
             if (isset($key['value_size'])) {
                 $item->tally($key['value_size'] / 1024);
             } else {
                 // Dummy, WINCACHE version is too low.
                 $item->tally(1);
             }
             $data[$group] = $item;
         }
     }
     return $data;
 }
开发者ID:mined-gatech,项目名称:framework,代码行数:31,代码来源:WinCache.php


示例19: init_cache_info

function init_cache_info($cache_data = SUMMARY_DATA)
{
    global $ocache_mem_info, $ocache_file_info, $ocache_summary_info, $fcache_mem_info, $fcache_file_info, $fcache_summary_info, $rpcache_mem_info, $rpcache_file_info, $ucache_mem_info, $ucache_info, $scache_mem_info, $scache_info, $user_cache_available, $session_cache_available;
    if ($cache_data == SUMMARY_DATA || $cache_data == OCACHE_DATA) {
        $ocache_mem_info = wincache_ocache_meminfo();
        $ocache_file_info = wincache_ocache_fileinfo();
        $ocache_summary_info = get_ocache_summary($ocache_file_info['file_entries']);
    }
    if ($cache_data == SUMMARY_DATA || $cache_data == FCACHE_DATA) {
        $fcache_mem_info = wincache_fcache_meminfo();
        $fcache_file_info = wincache_fcache_fileinfo();
        $fcache_summary_info = get_fcache_summary($fcache_file_info['file_entries']);
    }
    if ($cache_data == SUMMARY_DATA || $cache_data == RCACHE_DATA) {
        $rpcache_mem_info = wincache_rplist_meminfo();
        $rpcache_file_info = wincache_rplist_fileinfo();
    }
    if ($user_cache_available && ($cache_data == SUMMARY_DATA || $cache_data == UCACHE_DATA)) {
        $ucache_mem_info = wincache_ucache_meminfo();
        $ucache_info = wincache_ucache_info();
    }
    if ($session_cache_available && ($cache_data == SUMMARY_DATA || $cache_data == SCACHE_DATA)) {
        $scache_mem_info = wincache_scache_meminfo();
        $scache_info = wincache_scache_info();
    }
}
开发者ID:laiello,项目名称:kangle-php-mysql,代码行数:26,代码来源:wincache.php


示例20: getStats

 /**
  * {@inheritDoc}
  */
 public function getStats()
 {
     $info = wincache_ucache_info(true);
     $meminfo = wincache_ucache_meminfo();
     return array(CacheInterface::STATS_SIZE => $info['total_item_count'], CacheInterface::STATS_HITS => $info['total_hit_count'], CacheInterface::STATS_MISSES => $info['total_miss_count'], CacheInterface::STATS_UPTIME => $info['total_cache_uptime'], CacheInterface::STATS_MEMORY_USAGE => $meminfo['memory_total'], CacheInterface::STATS_MEMORY_AVAILIABLE => $meminfo['memory_free']);
 }
开发者ID:Nyholm,项目名称:acache,代码行数:9,代码来源:WincacheCache.php



注:本文中的wincache_ucache_info函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wincache_ucache_meminfo函数代码示例发布时间:2022-05-23
下一篇:
PHP wincache_ucache_inc函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap