本文整理汇总了PHP中xcache_get函数的典型用法代码示例。如果您正苦于以下问题:PHP xcache_get函数的具体用法?PHP xcache_get怎么用?PHP xcache_get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xcache_get函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get
/**
* Retrieve an item from the cache by key.
*
* @param string $key
* @return mixed
*/
public function get($key)
{
$value = xcache_get($this->getPrefixWithLocale() . $key);
if (isset($value)) {
return $value;
}
}
开发者ID:jooorooo,项目名称:cache,代码行数:13,代码来源:XCacheStore.php
示例2: get
public function get($key)
{
if (!$key) {
return false;
}
return xcache_isset($key) ? xcache_get($key) : false;
}
开发者ID:MrMoDoor,项目名称:Carbon-Forum,代码行数:7,代码来源:XCache.class.php
示例3: get
/**
* 读取缓存,失败或缓存撒失效时返回 false
*
* @param string $id
*
* @return mixed
*/
function get($id)
{
if (xcache_isset($id)) {
return xcache_get($id);
}
return false;
}
开发者ID:BGCX262,项目名称:zys-blog-svn-to-git,代码行数:14,代码来源:xcache.php
示例4: get
/**
* Gets a value from the variable store
* @param string $key The key of the variable
* @param mixed $default The default value for when the key is not set
* @return mixed The value of the variable if it exists, the provided default value otherwise
*/
public function get($key, $default = null)
{
if (xcache_isset($key)) {
return xcache_get($key);
}
return $default;
}
开发者ID:BGCX261,项目名称:zibo-svn-to-git,代码行数:13,代码来源:XCacheIO.php
示例5: realGet
/**
* Get cache record implementation
* @param string $id
* @param boolean $doNotTestCacheValidity
* @return string
*/
public function realGet($id, $doNotTestCacheValidity = false)
{
if (xcache_isset($id)) {
return xcache_get($id);
}
return null;
}
开发者ID:difra-org,项目名称:difra,代码行数:13,代码来源:XCache.php
示例6: get
public static function get($key)
{
global $config, $debug;
$key = $config['cache']['prefix'] . $key;
$data = false;
switch ($config['cache']['enabled']) {
case 'memcached':
if (!self::$cache) {
self::init();
}
$data = self::$cache->get($key);
break;
case 'apc':
$data = apc_fetch($key);
break;
case 'xcache':
$data = xcache_get($key);
break;
case 'php':
$data = isset(self::$cache[$key]) ? self::$cache[$key] : false;
break;
case 'redis':
if (!self::$cache) {
self::init();
}
$data = json_decode(self::$cache->get($key), true);
break;
}
if ($config['debug']) {
$debug['cached'][] = $key . ($data === false ? ' (miss)' : ' (hit)');
}
return $data;
}
开发者ID:carriercomm,项目名称:Tinyboard,代码行数:33,代码来源:cache.php
示例7: cacheget
function cacheget($name)
{
if (!$this->cache_type) {
return;
}
$rdata2 = false;
if (!$this->thestorage) {
switch ($this->cache_type) {
case 1:
if ($this->connect()) {
$rdata = $this->mchandle->get(VBSEO_CACHE_VAR);
}
break;
case 2:
$rdata = apc_fetch(VBSEO_CACHE_VAR);
break;
case 3:
if (xcache_isset(VBSEO_CACHE_VAR)) {
$rdata = xcache_get(VBSEO_CACHE_VAR);
}
break;
case 4:
$rdata = eaccelerator_get(VBSEO_CACHE_VAR);
break;
}
if ($rdata) {
$this->thestorage = unserialize($rdata);
} else {
$this->thestorage = array();
}
}
$rdata2 = $this->thestorage[$name];
return $rdata2;
}
开发者ID:holandacz,项目名称:nb4,代码行数:34,代码来源:functions_vbseo_cache.php
示例8: readCache
/**
* Get
*
* Since this is the dummy class, it's always going to return FALSE.
*
* @param string
* @return Boolean FALSE
*/
public function readCache($type, $name, $ID, $onlyCheck = FALSE)
{
$this->getInstance();
$originalID = $ID;
if (isset($_POST) && count($_POST) > 0) {
$ID = $ID . md5(serialize($_POST));
}
self::logMessage('cache', "Cche xcache reading {$type} - {$name} - {$ID}.");
$item_expiration = $this->getCacheItemExpiration($type, $name, $originalID);
if (is_array($item_expiration)) {
$item_properties = $item_expiration;
$name .= '-' . $item_properties[0];
$item_expiration = $item_properties[1];
}
if ($item_expiration == FALSE) {
$item_expiration = $this->getCacheConfigItem('default', $type);
if ($item_expiration == FALSE) {
return FALSE;
}
}
$cache = xcache_get($type . '-' . $name . '-' . $ID);
if ($cache == FALSE) {
return FALSE;
}
self::logMessage('cache', 'Cache xcache read OK: ' . $type . '/' . $name . '/' . $ID);
if ($cache && $onlyCheck) {
return TRUE;
}
return unserialize($cache);
}
开发者ID:xmadmax,项目名称:xcache,代码行数:38,代码来源:XCache_xcache.php
示例9: expired
/**
* {@inheritdoc}
*/
public function expired($key, $mins)
{
$key = $this->getName($key);
if (xcache_isset($key)) {
return time() - xcache_get($key)['created'] > $mins * 60;
}
}
开发者ID:mdzzohrabi,项目名称:azera-cache,代码行数:10,代码来源:XCache.php
示例10: set
/**
* 写入缓存
* @access public
* @param string $name 缓存变量名
* @param mixed $value 存储数据
* @param integer $expire 有效时间(秒)
* @return boolean
*/
public function set($name, $value, $expire = null)
{
if (is_null($expire)) {
$expire = $this->options['expire'];
}
$name = $this->options['prefix'] . $name;
if (xcache_set($name, $value, $expire)) {
if ($this->options['length'] > 0) {
// 记录缓存队列
$queue = xcache_get('__info__');
if (!$queue) {
$queue = [];
}
if (false === array_search($name, $queue)) {
array_push($queue, $name);
}
if (count($queue) > $this->options['length']) {
// 出列
$key = array_shift($queue);
// 删除缓存
xcache_unset($key);
}
xcache_set('__info__', $queue);
}
return true;
}
return false;
}
开发者ID:dingyi-History,项目名称:ime-daimaduan.cn,代码行数:36,代码来源:xcache.php
示例11: get
public function get($key)
{
if (xcache_isset($key)) {
return xcache_get($key);
}
return FALSE;
}
开发者ID:Kami,项目名称:Multi-Storage-Cache,代码行数:7,代码来源:XCache.php
示例12: get
public function get($id)
{
if (xcache_isset($id)) {
return xcache_get($id);
}
return NULL;
}
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:7,代码来源:Xcache.php
示例13: get
/**
* Returns cached value by key or false if there is no cache entry for the given key
*
* @param string $key
* @return bool|mixed
*/
public function get($key)
{
if ($value = xcache_get($this->prepareKey($key))) {
return $this->unserializeCompound($value);
}
return false;
}
开发者ID:ihor,项目名称:cachalot,代码行数:13,代码来源:XcacheCache.php
示例14: __get
public function __get($index)
{
if (function_exists('xcache_get')) {
return xcache_get($index);
}
return null;
}
开发者ID:appdeck,项目名称:sampa,代码行数:7,代码来源:XCache.php
示例15: get
function get($key)
{
if (!ini_get('xcache.var_size')) {
return FALSE;
}
return unserialize(strval(@xcache_get($key)));
}
开发者ID:pihizi,项目名称:qf,代码行数:7,代码来源:cache_xcache.php
示例16: getData
/**
* Get data from shared memory cache
*
* @param string $sKey - file name
* @param int $iTTL - time to live
* @return the data is got from cache.
*/
function getData($sKey, $iTTL = false)
{
if (!xcache_isset($sKey)) {
return null;
}
return xcache_get($sKey);
}
开发者ID:toxalot,项目名称:dolphin.pro,代码行数:14,代码来源:BxDolCacheXCache.php
示例17: fetch
/**
* Retrieve an item from the cache.
*
* @param string The name of the cache
* @param boolean True if we should do a hard refresh
* @return mixed Cache data if successful, false if failure
*/
function fetch($name, $hard_refresh = false)
{
if (!xcache_isset($this->unique_id . "_" . $name)) {
return false;
}
return xcache_get($this->unique_id . "_" . $name);
}
开发者ID:slothly,项目名称:mybb,代码行数:14,代码来源:xcache.php
示例18: get
/**
* Veriyi döndürür
*
* @param string $name
* @return bool|mixed|string
*/
public function get($name = '')
{
if (false === ($var = xcache_get($name))) {
xcache_set($name, $var = parent::get($name));
}
return $var;
}
开发者ID:AnonymPHP,项目名称:Anonym-Config,代码行数:13,代码来源:XcacheReposity.php
示例19: get
/**
* Retrieve an item from the cache by key.
*
* @param string $key
* @return mixed
*/
public function get($key)
{
$value = xcache_get($this->prefix . $key);
if (isset($value)) {
return $value;
}
}
开发者ID:kartx22,项目名称:Otoru-Dice,代码行数:13,代码来源:XCacheStore.php
示例20: read
/**
* Read a key from the cache
*
* @param string $key Identifier for the data
* @return mixed The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it
* @access public
*/
function read($key)
{
if (xcache_isset($key)) {
return xcache_get($key);
}
return false;
}
开发者ID:BLisa90,项目名称:cakecart,代码行数:14,代码来源:xcache.php
注:本文中的xcache_get函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论