子分类
  • 无子分类
redis缓存配置
  • 2014-08-07发布
  • 2014-08-07修改

复制bzf框架库中的缓存配置文件Tun/ConfigDemo/cache.config.php,到网站根目录下的config目录中,修改服务器配置参数,就可使用redis缓存服务器了。


cache.config.php文件的内容如下:

<?php
return array(
        'cache'=>array(
            'isCrypt' => false,
            'expiration' => '3600',
            
/************memcached***************/
//             'storage' => 'memcached',
//             'master'=>array(
//                             'host' => '127.0.0.1',
//                             'port' => '11211',
//                     ),
//             'blance' =>array(
//                     array(
//                             'host' => '127.0.0.1',
//                             'port' => '11211',
//                     ),
//                     array(
//                             'host' => '127.0.0.1',
//                             'port' => '11211',
//                     ),
                    
//             ),    
            
/************redis****************/
             'storage' => 'redis',
             'master'=>array(
                 'host' => '127.0.0.1',
                 'port' => '6379',
             ),
            
/*************filesystem****************/
//            'storage' => 'filesystem',
            'cache_server' => array(
                    'cachedir' => 'data/cache',
            ),
        ),
    );



cache类的使用请参考:Cache缓存类(class Cache)