当前位置: 首页>>代码示例>>PHP>>正文


PHP xcache_list函数代码示例

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


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

示例1: driver_stats

 function driver_stats($option = array())
 {
     $res = array("info" => "", "size" => "", "data" => "");
     try {
         $res['data'] = xcache_list(XC_TYPE_VAR, 100);
     } catch (Exception $e) {
         $res['data'] = array();
     }
     return $res;
 }
开发者ID:kvox,项目名称:TVSS,代码行数:10,代码来源:xcache.php

示例2: getStats

 /**
  * {@inheritDoc}
  */
 public function getStats()
 {
     $size = 0;
     for ($ii = 0, $max = xcache_count(XC_TYPE_VAR); $ii < $max; ++$ii) {
         $block = xcache_list(XC_TYPE_VAR, $ii);
         foreach ($block as $entries) {
             $size += count($entries);
         }
     }
     return array(CacheInterface::STATS_SIZE => $size);
 }
开发者ID:Nyholm,项目名称:acache,代码行数:14,代码来源:XCacheCache.php

示例3: clean

 public function clean($group, $mode = null)
 {
     $allinfo = xcache_list(XC_TYPE_VAR, 0);
     $keys = $allinfo['cache_list'];
     $secret = $this->_hash;
     foreach ($keys as $key) {
         if (strpos($key['name'], $secret . '-cache-' . $group . '-') === 0 xor $mode != 'group') {
             xcache_unset($key['name']);
         }
     }
     return true;
 }
开发者ID:vanie3,项目名称:appland,代码行数:12,代码来源:xcache.php

示例4: cs_cache_info

function cs_cache_info()
{
    $form = array();
    $cache_count = xcache_count(XC_TYPE_VAR);
    for ($i = 0; $i < $cache_count; $i++) {
        $info = xcache_list(XC_TYPE_VAR, $i);
        foreach ($info['cache_list'] as $num => $data) {
            $handle = $data['name'] . ' (' . $i . '.' . $num . ')';
            $form[$handle] = array('name' => $handle, 'time' => $data['ctime'], 'size' => $data['size']);
        }
    }
    ksort($form);
    return array_values($form);
}
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:14,代码来源:xcache.php

示例5: getCacheKeys

 /**
  * @return array
  */
 public function getCacheKeys()
 {
     $this->checkAuth();
     $keys = array();
     for ($i = 0, $max = xcache_count(XC_TYPE_VAR); $i < $max; $i++) {
         $infos = xcache_list(XC_TYPE_VAR, $i);
         if (is_array($infos['cache_list'])) {
             foreach ($infos['cache_list'] as $info) {
                 $keys[] = substr($info['name'], strlen($this->getOption('prefix')));
             }
         }
     }
     return $keys;
 }
开发者ID:uniteddiversity,项目名称:policat,代码行数:17,代码来源:sfXCacheTaggingCache.class.php

示例6: getIds

 /**
  * {@inheritdoc}
  */
 public function getIds()
 {
     $this->_checkAuth();
     $keys = array();
     for ($i = 0, $count = xcache_count(XC_TYPE_VAR); $i < $count; $i++) {
         $entries = xcache_list(XC_TYPE_VAR, $i);
         if (is_array($entries['cache_list'])) {
             foreach ($entries['cache_list'] as $entry) {
                 $keys[] = $entry['name'];
             }
         }
     }
     return $keys;
 }
开发者ID:manish436,项目名称:zform,代码行数:17,代码来源:XcacheCache.php

示例7: clear

 /**
  * {@inheritDoc}
  */
 public function clear()
 {
     $this->lastModified = time();
     // iterate over all entries and match the group prefix
     $groupPrefix = $this->group . '/';
     for ($ii = 0, $max = xcache_count(XC_TYPE_VAR); $ii < $max; ++$ii) {
         $block = xcache_list(XC_TYPE_VAR, $ii);
         foreach ($block as $entries) {
             foreach ($entries as $entry) {
                 if (0 === strpos($entry['name'], $groupPrefix)) {
                     xcache_unset($entry['name']);
                 }
             }
         }
     }
     return true;
 }
开发者ID:zenmagick,项目名称:zenmagick,代码行数:20,代码来源:XCache.php

示例8: flush

 /**
  * Flush the cache.
  */
 function flush()
 {
     $prefix = INDEX_FILE_LOCATION . ':' . $this->getContext() . ':' . $this->getCacheId();
     if (function_exists('xcache_unset_by_prefix')) {
         // If possible, just flush the context
         xcache_unset_by_prefix(prefix);
     } else {
         // Otherwise, we need to do this manually
         for ($i = 0; $i < xcache_count(XC_TYPE_VAR); $i++) {
             $cache = xcache_list(XC_TYPE_VAR, $i);
             foreach ($cache['cache_list'] as $entry) {
                 if (substr($entry['name'], 0, strlen($prefix)) == $prefix) {
                     xcache_unset($entry['name']);
                 }
             }
         }
     }
 }
开发者ID:doana,项目名称:pkp-lib,代码行数:21,代码来源:XCacheCache.inc.php

示例9: getCacheInfo

 public function getCacheInfo($key)
 {
     $this->checkAuth();
     for ($i = 0, $max = xcache_count(XC_TYPE_VAR); $i < $max; $i++) {
         $infos = xcache_list(XC_TYPE_VAR, $i);
         if (is_array($infos['cache_list'])) {
             foreach ($infos['cache_list'] as $info) {
                 if ($this->getOption('prefix') . $key == $info['name']) {
                     return $info;
                 }
             }
         }
     }
     return null;
 }
开发者ID:cuongnv540,项目名称:jobeet,代码行数:15,代码来源:sfXCacheCache.class.php

示例10: driver_stats

 /**
  * @param array $option
  * @return array
  */
 public function driver_stats($option = array())
 {
     $res = array('info' => '', 'size' => '', 'data' => '');
     try {
         $res['data'] = xcache_list(XC_TYPE_VAR, 100);
     } catch (Exception $e) {
         $res['data'] = array();
     }
     return $res;
 }
开发者ID:dudusouza,项目名称:wowadmin,代码行数:14,代码来源:xcache.php

示例11: clean

 /**
  * Clean cache for a group given a mode.
  *
  * group mode		: cleans all cache in the group
  * notgroup mode	: cleans all cache not in the group
  *
  * @access	public
  * @param	string	$group	The cache data group
  * @param	string	$mode	The mode for cleaning cache [group|notgroup]
  * @return	boolean	True on success, false otherwise
  * @since	1.5
  */
 function clean($group, $mode)
 {
     if (!ini_get('xcache.admin.enable_auth')) {
         $allinfo = xcache_list(XC_TYPE_VAR, 0);
         $keys = $allinfo['cache_list'];
         $secret = $this->_hash;
         foreach ($keys as $key) {
             if (strpos($key['name'], $secret . '-cache-' . $group . '-' . $this->_site) === 0 xor $mode != 'group') {
                 xcache_unset($key['name']);
             }
         }
         return true;
     }
     return false;
 }
开发者ID:janssit,项目名称:www.rvproductions.be,代码行数:27,代码来源:xcache.php

示例12: 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;
     if (xcache_isset($internalKey)) {
         $this->initAdminAuth();
         $cnt = xcache_count(XC_TYPE_VAR);
         for ($i = 0; $i < $cnt; $i++) {
             $list = xcache_list(XC_TYPE_VAR, $i);
             foreach ($list['cache_list'] as &$metadata) {
                 if ($metadata['name'] === $internalKey) {
                     $this->normalizeMetadata($metadata);
                     return $metadata;
                 }
             }
         }
         $this->resetAdminAuth();
     }
     return false;
 }
开发者ID:karnurik,项目名称:zf2-turtorial,代码行数:29,代码来源:XCache.php

示例13: getIDs

 /**
  * Get all the cache ids
  *
  * @return array
  */
 public function getIDs()
 {
     if (empty($this->_ids)) {
         for ($i = 0, $count = xcache_count(XC_TYPE_VAR); $i < $count; ++$i) {
             $entries = xcache_list(XC_TYPE_VAR, $i);
             if (is_array($entries['cache_list'])) {
                 foreach ($entries['cache_list'] as $entry) {
                     $this->_ids[] = str_replace(array($this->_prefix, $this->_suffix), '', $entry['name']);
                 }
             }
         }
     }
     return $this->_ids;
 }
开发者ID:Dirty-Butter,项目名称:v6,代码行数:19,代码来源:xcache.class.php

示例14: clean

 /**
  * Clean cache for a group provided.
  *
  * @param   string $group The cache data group, passed '*' indicate all cache removal
  *
  * @return  boolean
  *
  * @since   1.2.7
  */
 public function clean($group)
 {
     $group = trim($group);
     if (!$group) {
         return false;
     }
     $cache_info = xcache_list(XC_TYPE_VAR, 0);
     $keys = $cache_info['cache_list'];
     foreach ($keys as $key) {
         if ($group == '*' || strpos($key['name'], $this->secret . '-cache-' . $group . '.') === 0) {
             xcache_unset($key['name']);
         }
     }
     return true;
 }
开发者ID:siddht1,项目名称:abantecart-src,代码行数:24,代码来源:xcache.php

示例15: all

 /**
  * Get all cached data
  *
  * This requires the php.ini setting xcache.admin.enable_auth = Off.
  *
  * @return  array
  */
 public function all()
 {
     $hash = $this->options['hash'];
     $allinfo = xcache_list(XC_TYPE_VAR, 0);
     $data = array();
     foreach ($allinfo['cache_list'] as $key) {
         $namearr = explode('-', $key['name']);
         if ($namearr !== false && $namearr[0] == $secret && $namearr[1] == 'cache') {
             $group = $namearr[2];
             if (!isset($data[$group])) {
                 $item = new Auditor($group);
             } else {
                 $item = $data[$group];
             }
             $item->tally($key['size'] / 1024);
             $data[$group] = $item;
         }
     }
     return $data;
 }
开发者ID:mined-gatech,项目名称:framework,代码行数:27,代码来源:XCache.php


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