缓存驱动类更新

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

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