|
发表于 2012-9-29 08:54:17
|
显示全部楼层
PHP复制代码
//这样试下呢
$this->load->driver('cache');
if ( ! $foo = $this->cache->get('foo'))
{
echo 'Saving to the cache!<br />';
$foo = 'foobarbaz!';
// Save into the cache for 5 minutes
$this->cache->save('foo', $foo, 300);
}
echo "<pre>";
print_r($this->cache->cache_info());
print_r($this->cache->get_metadata('foo'));
// $this->cache->delete('foo');
echo "</pre>";
echo $foo;
/**/
echo "<br/>";
echo "Memcache启动<br/>";
if ($this->cache->memcached->is_supported())
{
if ( ! $cier = $this->cache->memcached->get('CIER'))
{
echo 'Memcache CIER !<br />';
$cier = 'Memcache CIER !';
// Save into the cache for 5 minutes
$this->cache->memcached->save('CIER', $cier, 300);
}
else
{
echo "读取缓存 ";
echo $cier;
}
}
else
{
echo "Memcache启动失败";
} 复制代码 |
|