-
- $config = Zend_Registry::get('config');
- $host = $config->setting->redis->host;
- $port = $config->setting->redis->port;
- $redis = new Redis();
- $redis->connect($host, $port) or die("connect to redis error\n");
- $redis->auth($config->setting->redis->password) or die("auth failed\n");
- $redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP);
复制代码
|