ly_perfect 发表于 2011-2-16 10:37:25

CI 2.0apc缓存问题


刚下的 2.0 如下的代码直接从手册上复制下来的。
请教下是bug吗?

$this->load->driver('cache', array('adapter' => 'apc', 'backup' => 'file'));
if ( ! $foo = $this->cache->apc->get('foo'))
{
       echo 'Saving to the cache!<br />';
       $foo = 'foobarbaz!';

       // Save into the cache for 5 minutes
       $this->cache->apc->save('foo', $foo, 300);
}
echo $foo;

visvoy 发表于 2011-2-16 20:37:05

你的服务器没开启or不支持apc

Hex 发表于 2011-2-16 22:54:25

要先安装 APC 扩展,不是 BUG

ly_perfect 发表于 2011-2-18 10:40:37

:) 多谢            

仅此而已 发表于 2012-7-25 03:02:39

本帖最后由 仅此而已 于 2012-7-25 03:04 编辑

Hex 发表于 2011-2-16 22:54 static/image/common/back.gif
要先安装 APC 扩展,不是 BUG
$this->load->driver('cache', array('adapter' => 'apc', 'backup' => 'file'));
那这个备用的在apc不能使用的情况下不能自己判断吗?

手册中是这样说的
“下面这个例子:首先加载缓存适配器,然后指定 APC 作为适配器优先使用的缓存实现,同时,我们指定文本缓存作为替代方案。这样,在一些服务器不支持APC的情况下(如国内的虚拟主机),我们可以使用替代方案保证程序正常运行。
$this->load->driver('cache', array('adapter' => 'apc', 'backup' => 'file'));

这样apc不能使用的情况下 应该也不会报错 ci自己判断使用文本缓存了吧?
疑惑 求解

Hex 发表于 2012-7-25 13:23:16

仅此而已 发表于 2012-7-25 03:02 static/image/common/back.gif
$this->load->driver('cache', array('adapter' => 'apc', 'backup' => 'file'));
那这个备用的在apc不能 ...

如果你的 CI 版本和手册标识的一致,那就是BUG。
否则,请更新到手册标识的版本。
页: [1]
查看完整版本: CI 2.0apc缓存问题