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

PHP xcache_list函数代码示例

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

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



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


示例16: clean

 /**
  * Clean cache for a group given a mode.
  *
  * This requires the php.ini setting xcache.admin.enable_auth = Off.
  *
  * @param   string  $group  The cache data group
  * @param   string  $mode   The mode for cleaning cache [group|notgroup]
  * group mode  : cleans all cache in the group
  * notgroup mode  : cleans all cache not in the group
  *
  * @return  boolean  True on success, false otherwise
  *
  * @since   11.1
  */
 public function clean($group, $mode = null)
 {
     // Make sure XCache is configured properly
     if (self::isSupported() == false) {
         return true;
     }
     $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:deenison,项目名称:joomla-cms,代码行数:30,代码来源:xcache.php


示例17: array

 // {{{ load info/list
 $cacheinfos = array();
 for ($i = 0; $i < $pcnt; $i++) {
     $data = xcache_info(XC_TYPE_PHP, $i);
     if ($type === XC_TYPE_PHP) {
         $data += xcache_list(XC_TYPE_PHP, $i);
     }
     $data['type'] = XC_TYPE_PHP;
     $data['cache_name'] = "php#{$i}";
     $data['cacheid'] = $i;
     $cacheinfos[] = $data;
 }
 for ($i = 0; $i < $vcnt; $i++) {
     $data = xcache_info(XC_TYPE_VAR, $i);
     if ($type === XC_TYPE_VAR) {
         $data += xcache_list(XC_TYPE_VAR, $i);
     }
     $data['type'] = XC_TYPE_VAR;
     $data['cache_name'] = "var#{$i}";
     $data['cacheid'] = $i;
     $cacheinfos[] = $data;
 }
 // }}}
 // {{{ merge the list
 switch ($type) {
     case XC_TYPE_PHP:
     case XC_TYPE_VAR:
         $cachelist = array('type' => $type, 'cache_list' => array(), 'deleted_list' => array());
         if ($type == XC_TYPE_VAR) {
             $cachelist['type_name'] = 'var';
         } else {
开发者ID:gggeek,项目名称:ggsysinfo,代码行数:31,代码来源:xcache.php


示例18: getCacheInfos

function getCacheInfos()
{
    static $cacheInfos;
    if (isset($cacheInfos)) {
        return $cacheInfos;
    }
    $phpCacheCount = xcache_count(XC_TYPE_PHP);
    $varCacheCount = xcache_count(XC_TYPE_VAR);
    $cacheInfos = array();
    $total = array();
    global $maxHitsByHour;
    $maxHitsByHour = array(0, 0);
    for ($i = 0; $i < $phpCacheCount; $i++) {
        $data = xcache_info(XC_TYPE_PHP, $i);
        if ($_GET['do'] === 'listphp') {
            $data += xcache_list(XC_TYPE_PHP, $i);
        }
        $data['type'] = XC_TYPE_PHP;
        $data['cache_name'] = "php#{$i}";
        $data['cacheid'] = $i;
        $cacheInfos[] = $data;
        $maxHitsByHour[XC_TYPE_PHP] = max($maxHitsByHour[XC_TYPE_PHP], max($data['hits_by_hour']));
        if ($phpCacheCount >= 2) {
            calc_total($total, $data);
        }
    }
    if ($phpCacheCount >= 2) {
        $total['type'] = XC_TYPE_PHP;
        $total['cache_name'] = _T('Total');
        $total['cacheid'] = -1;
        $total['gc'] = null;
        $total['istotal'] = true;
        unset($total['compiling']);
        $cacheInfos[] = $total;
    }
    $total = array();
    for ($i = 0; $i < $varCacheCount; $i++) {
        $data = xcache_info(XC_TYPE_VAR, $i);
        if ($_GET['do'] === 'listvar') {
            $data += xcache_list(XC_TYPE_VAR, $i);
        }
        $data['type'] = XC_TYPE_VAR;
        $data['cache_name'] = "var#{$i}";
        $data['cacheid'] = $i;
        $cacheInfos[] = $data;
        $maxHitsByHour[XC_TYPE_VAR] = max($maxHitsByHour[XC_TYPE_VAR], max($data['hits_by_hour']));
        if ($varCacheCount >= 2) {
            calc_total($total, $data);
        }
    }
    if ($varCacheCount >= 2) {
        $total['type'] = XC_TYPE_VAR;
        $total['cache_name'] = _T('Total');
        $total['cacheid'] = -1;
        $total['gc'] = null;
        $total['istotal'] = true;
        $cacheInfos[] = $total;
    }
    return $cacheInfos;
}
开发者ID:akhan786,项目名称:LaunchDevelopment,代码行数:60,代码来源:index.php


示例19: xcache_get

         return xcache_set($name, $value, $time_in_second);
     }
     return false;
 }
 private static function xcache_get($name)
 {
     $name = self::getMemoryName($name);
     $data = xcache_get($name);
开发者ID:abdoumej,项目名称:libsamy,代码行数:8,代码来源:FlexibleCustomFastCache.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP xcache_set函数代码示例发布时间:2022-05-23
下一篇:
PHP xcache_isset函数代码示例发布时间: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