缓存驱动类更新

This commit is contained in:
thinkphp
2013-04-02 15:57:27 +08:00
parent 3de1949696
commit 083b312c96
8 changed files with 11 additions and 11 deletions

View File

@@ -32,13 +32,13 @@ class Redis {
*/
public function __construct($options=[]) {
if ( !extension_loaded('redis') ) {
throw new Exception('_NOT_SUPPERT_:redis');
E('_NOT_SUPPERT_:redis');
}
if(!empty($options)) {
$this->options = array_merge($this->options,$options);
}
$func = $options['persistent'] ? 'pconnect' : 'connect';
$this->handler = new Redis;
$this->handler = new \Redis;
$options['timeout'] === false ?
$this->handler->$func($options['host'], $options['port']) :
$this->handler->$func($options['host'], $options['port'], $options['timeout']);