Ejemplo n.º 1
0
 /**
  * test RdisPOOL
  */
 public function redis()
 {
     $configs = ['redis0' => ['host' => '192.168.10.10', 'port' => 6379]];
     RedisPool::addServer($configs);
     $redis = RedisPool::getRedis('redis0');
     //$redis->set('name', 'hanfeng');
     echo $redis->get('name');
 }
Ejemplo n.º 2
0
 protected function init()
 {
     $config = ['redis0' => ['host' => '192.168.10.10', 'port' => 6379]];
     RedisPool::addServer($config);
     $this->redis = RedisPool::getRedis('redis0');
 }