30 return $GLOBALS[
'__CacheMemcache__'];
43 $config[
'url'] = is_array($url) ? $url : array($url);
44 if(class_exists(
'Memcached'))
46 $this->Memcache =
new Memcached;
47 $this->SelectedExtension =
'Memcached';
49 elseif(class_exists(
'Memcache'))
51 $this->Memcache =
new Memcache;
52 $this->SelectedExtension =
'Memcache';
59 foreach($config[
'url'] as $url)
61 $info = parse_url($url);
62 $this->Memcache->addServer($info[
'host'], $info[
'port']);
73 if(isset(
$GLOBALS[
'XE_MEMCACHE_SUPPORT']))
75 return $GLOBALS[
'XE_MEMCACHE_SUPPORT'];
77 if($this->SelectedExtension ===
'Memcached')
79 return $GLOBALS[
'XE_MEMCACHE_SUPPORT'] = $this->Memcache->set(
'xe',
'xe', 1);
81 elseif($this->SelectedExtension ===
'Memcache')
83 return $GLOBALS[
'XE_MEMCACHE_SUPPORT'] = $this->Memcache->set(
'xe',
'xe', MEMCACHE_COMPRESSED, 1);
87 return $GLOBALS[
'XE_MEMCACHE_SUPPORT'] =
false;
125 if($this->SelectedExtension ===
'Memcached')
127 return $this->Memcache->set($this->
getKey($key), array($_SERVER[
'REQUEST_TIME'], $buff),
$valid_time);
131 return $this->Memcache->set($this->
getKey($key), array($_SERVER[
'REQUEST_TIME'], $buff), MEMCACHE_COMPRESSED,
$valid_time);
145 $_key = $this->
getKey($key);
147 $obj = $this->Memcache->get($_key);
154 if($modified_time > 0 && $modified_time >
$obj[0])
173 function get($key, $modified_time = 0)
175 $_key = $this->
getKey($key);
176 $obj = $this->Memcache->get($_key);
182 if($modified_time > 0 && $modified_time >
$obj[0])
201 function delete($key)
203 $_key = $this->
getKey($key);
216 $this->Memcache->delete($_key);
230 return $this->Memcache->flush();
isValid($key, $modified_time=0)
if(file_exists(_XE_PATH_. 'config/config.user.inc.php')) if(!defined('__DEBUG__')) if(!defined('__DEBUG_OUTPUT__')) if(!defined('__DEBUG_PROTECT__')) if(!defined('__DEBUG_PROTECT_IP__')) if(!defined('__DEBUG_DB_OUTPUT__')) if(!defined('__LOG_SLOW_QUERY__')) if(!defined('__LOG_SLOW_TRIGGER__')) if(!defined('__LOG_SLOW_ADDON__')) if(!defined('__LOG_SLOW_WIDGET__')) if(!defined('__DEBUG_QUERY__')) if(!defined('__OB_GZHANDLER_ENABLE__')) if(!defined('__ENABLE_PHPUNIT_TEST__')) if(!defined('__PROXY_SERVER__')) if(!defined('__ERROR_LOG__')) if(!defined('__DISABLE_DEFAULT_CSS__')) if(!defined('__AUTO_OPCACHE_INVALIDATE__')) if((__DEBUG_OUTPUT__==2)&&version_compare(PHP_VERSION, '6.0.0')===-1) if(version_compare(PHP_VERSION, '5.3.0') >=0) $GLOBALS['__xe_autoload_file_map']
put($key, $buff, $valid_time=0)