十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
]>
*/
class phpredis extends Redis{
public function connect($config){
$host = $config['host'];
$port = $config['port'];
parent::connect($host,$port);
$pass = @$config['pass']?:false;
if($pass !== false){
parent::auth($pass);
}
return $this;
}
}
$config = array(
'host'=>'192.168.8.81',
'port'=>'6379',
'pass'=>'123456'
);
$redis = new phpredis();
$redis->connect($config);
$redis->set('name','dollarphp');
$ret = $redis->get('name');
var_dump($ret);
string(9) "dollarphp"