20 defined(
'XOOPS_ROOT_PATH') or die('Restricted access');
64 var $settings = array();
76 function init($settings)
78 parent::init($settings);
79 $defaults = array(
'PHP_AUTH_USER' =>
'cake' ,
'PHP_AUTH_PW' =>
'cake');
80 $this->settings = array_merge($defaults, $this->settings);
81 return function_exists(
'xcache_info');
93 function write($key, &$value, $duration)
95 return xcache_set($key, $value, $duration);
107 if (xcache_isset($key)) {
108 return xcache_get($key);
120 function delete($key)
122 return xcache_unset($key);
135 for (
$i = 0, $max = xcache_count(XC_TYPE_VAR);
$i < $max;
$i++) {
136 if (!xcache_clear_cache(XC_TYPE_VAR,
$i)) {
155 function __auth($reverse =
false)
157 static $backup = array();
158 $keys = array(
'PHP_AUTH_USER' ,
'PHP_AUTH_PW');
159 foreach ($keys as $key) {
161 if (isset($backup[$key])) {
163 unset($backup[$key]);
169 if (!empty($value)) {
170 $backup[$key] = $value;
172 $varName =
'__' . $key;
173 $_SERVER[$key] = $this->settings[$varName];