CodeIgniterCI3.0怎么使用redis?codeigniter
codeigniter3.*已经自带redis库了# 新建 /application/config/redis.php 配置如下$config['socket_type'] = 'tcp';$config['host'] = '127.0.0.1';$config['port'] = 6379;$config['timeout'] = 0;用法$this->load->
CodeIgniterCI3.0怎么使用Redis?
Codeigniter3.*已经自带redis库了#新建/应用程序/配置/redis.php配置如下$CONFIG[‘SOCKET_TYPE’]=‘tcp’;$CONFIG[‘HOST’]=‘127.0.0.1’;$CONFIG[‘Password’]=NULL;$CONFIG[‘port’]=6379;$CONFIG[‘Timeout’]=0;用法$This-&>;加载驱动程序(‘CACHE’,ARRAY(‘Adapter’=&>;‘redis’,‘Backup’=&>;‘文件’);$foo=‘aaa’;$this->;缓存-&>保存(‘foo’,$foo,300);$this-&>;缓存->;Get(‘foo’);
0