本文整理汇总了PHP中xcache_isset函数的典型用法代码示例。如果您正苦于以下问题:PHP xcache_isset函数的具体用法?PHP xcache_isset怎么用?PHP xcache_isset使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xcache_isset函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
public function add($key, $value, $timeOut = 0)
{
if (\xcache_isset($key)) {
return false;
}
return \xcache_set($key, $value, $timeOut);
}
示例2: 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;
}
示例3: delete
public function delete($id, $tag = FALSE)
{
if ($tag !== FALSE) {
Kohana::log('error', 'Cache: tags are unsupported by the Xcache driver');
return TRUE;
} elseif ($id !== TRUE) {
if (xcache_isset($id)) {
return xcache_unset($id);
}
return FALSE;
} else {
// Do the login
$this->auth();
$result = TRUE;
for ($i = 0, $max = xcache_count(XC_TYPE_VAR); $i < $max; $i++) {
if (xcache_clear_cache(XC_TYPE_VAR, $i) !== NULL) {
$result = FALSE;
break;
}
}
// Undo the login
$this->auth(TRUE);
return $result;
}
return TRUE;
}
示例4: delete
/**
* @param string $key
* @return boolean
*/
public function delete($key)
{
if (!xcache_isset($key)) {
return TRUE;
}
return xcache_unset($key);
}
示例5: 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;
}
示例6: 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);
}
示例7: __isset
public function __isset($index)
{
if (function_exists('xcache_isset')) {
return xcache_isset($index);
}
return false;
}
示例8: 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;
}
示例9: get
/**
* 读取缓存,失败或缓存撒失效时返回 false
*
* @param string $id
*
* @return mixed
*/
function get($id)
{
if (xcache_isset($id)) {
return xcache_get($id);
}
return false;
}
示例10: expired
/**
* {@inheritdoc}
*/
public function expired($key, $mins)
{
$key = $this->getName($key);
if (xcache_isset($key)) {
return time() - xcache_get($key)['created'] > $mins * 60;
}
}
示例11: get
public function get($key)
{
if (!$key) {
return false;
}
return xcache_isset($key) ? xcache_get($key) : false;
}
示例12: get
public function get($id)
{
if (xcache_isset($id)) {
return xcache_get($id);
}
return NULL;
}
示例13: add
/**
* {@inheritdoc}
*/
public function add($key, $value, $ttl = 0)
{
if (!xcache_isset($key)) {
return xcache_set($key, $value, $ttl);
}
return false;
}
示例14: delData
/**
* Delete cache from shared memory
*
* @param string $sKey - file name
* @return result of the operation
*/
function delData($sKey)
{
if (!xcache_isset($sKey)) {
return true;
}
return xcache_unset($sKey);
}
示例15: get
/**
* 读取缓存
* @access public
* @param string $name 缓存变量名
* @return mixed
*/
public function get($name)
{
$name = $this->options['prefix'] . $name;
if (xcache_isset($name)) {
return xcache_get($name);
}
return false;
}