我是新手,XCache
我正在尝试使用此功能在我的应用程序中通过无线方式进行可编辑的配置。
所以我需要存储一些数据,为此我做了:
class Settings
{
private $_config = array();
function __construct()
{
$file = 'config.php'; //return $config content
require_once $file;
$this->_config = $config;
foreach($config as $item => $value)
{
if(!xcache_isset($item))
{
xcache_set($item, $value);
}
}
}
}
不幸的是,今天官方网站似乎关闭了,所以我无法按照文档检查我是否做错了什么。
我还创建了两种方法:
public static function setItem($name, $value)
{
xcache_set($name, $value);
}
public static function getItem($name)
{
return xcache_get($name);
}
现在getItem
15/20 分钟后无法获得关键值。为什么?
更新
好的,问题出header('Location..)
在调用 an 时。事实上,如果我进行重定向,我会丢失存储在缓存中的值,有人知道为什么吗?