From 083b312c96bd7963a6c3dca584a33de4a4974de7 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 2 Apr 2013 15:57:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=93=E5=AD=98=E9=A9=B1=E5=8A=A8=E7=B1=BB?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Think/Cache/Driver/Apc.php | 2 +- Think/Cache/Driver/Db.php | 2 +- Think/Cache/Driver/Memcache.php | 4 ++-- Think/Cache/Driver/Redis.php | 4 ++-- Think/Cache/Driver/Secache.php | 4 ++-- Think/Cache/Driver/Sqlite.php | 2 +- Think/Cache/Driver/Wincache.php | 2 +- Think/Cache/Driver/Xcache.php | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Think/Cache/Driver/Apc.php b/Think/Cache/Driver/Apc.php index 0dc68e7c..d85feb7e 100644 --- a/Think/Cache/Driver/Apc.php +++ b/Think/Cache/Driver/Apc.php @@ -30,7 +30,7 @@ class Apc { */ public function __construct($options=[]) { if(!function_exists('apc_cache_info')) { - throw New Exception('_NOT_SUPPERT_:Apc'); + E('_NOT_SUPPERT_:Apc'); } if(!empty($options)) { $this->options = array_merge($this->options,$options); diff --git a/Think/Cache/Driver/Db.php b/Think/Cache/Driver/Db.php index d4914eef..38ccbcdf 100644 --- a/Think/Cache/Driver/Db.php +++ b/Think/Cache/Driver/Db.php @@ -40,7 +40,7 @@ class Db { if(!empty($options)) { $this->options = array_merge($this->options,$options); } - $this->handler = ThinkDB::getInstance(); + $this->handler = \Think\Db::instance(); } /** diff --git a/Think/Cache/Driver/Memcache.php b/Think/Cache/Driver/Memcache.php index 809c574b..ac773315 100644 --- a/Think/Cache/Driver/Memcache.php +++ b/Think/Cache/Driver/Memcache.php @@ -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']); diff --git a/Think/Cache/Driver/Redis.php b/Think/Cache/Driver/Redis.php index 37d12bd3..39c5f974 100644 --- a/Think/Cache/Driver/Redis.php +++ b/Think/Cache/Driver/Redis.php @@ -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']); diff --git a/Think/Cache/Driver/Secache.php b/Think/Cache/Driver/Secache.php index 68376d1e..126a501e 100644 --- a/Think/Cache/Driver/Secache.php +++ b/Think/Cache/Driver/Secache.php @@ -34,7 +34,7 @@ class Secache { $this->options = array_merge($this->options,$options); } if(substr($this->options['temp'], -1) != '/') $this->options['temp'] .= '/'; - $this->handler = new secache; + $this->handler = new SecacheClient; $this->handler->workat($this->options['temp'].$this->options['project']); } @@ -108,7 +108,7 @@ class Secache { if(!defined('SECACHE_SIZE')){ define('SECACHE_SIZE','15M'); } -class secache{ +class SecacheClient{ var $idx_node_size = 40; var $data_base_pos = 262588; //40+20+24*16+16*16*16*16*4; diff --git a/Think/Cache/Driver/Sqlite.php b/Think/Cache/Driver/Sqlite.php index f3e8eed2..8914fabd 100644 --- a/Think/Cache/Driver/Sqlite.php +++ b/Think/Cache/Driver/Sqlite.php @@ -31,7 +31,7 @@ class Sqlite { */ public function __construct($options=[]) { if ( !extension_loaded('sqlite') ) { - throw new Exception('_NOT_SUPPERT_:sqlite'); + E('_NOT_SUPPERT_:sqlite'); } if(!empty($options)) { $this->options = array_merge($this->options,$options); diff --git a/Think/Cache/Driver/Wincache.php b/Think/Cache/Driver/Wincache.php index c83e2e51..0d8178c7 100644 --- a/Think/Cache/Driver/Wincache.php +++ b/Think/Cache/Driver/Wincache.php @@ -28,7 +28,7 @@ class Wincache { */ public function __construct($options=[]) { if ( !function_exists('wincache_ucache_info') ) { - throw new Exception('_NOT_SUPPERT_:WinCache'); + E('_NOT_SUPPERT_:WinCache'); } if(!empty($options)) { $this->options = array_merge($this->options,$options); diff --git a/Think/Cache/Driver/Xcache.php b/Think/Cache/Driver/Xcache.php index 7d22e276..934fbeb1 100644 --- a/Think/Cache/Driver/Xcache.php +++ b/Think/Cache/Driver/Xcache.php @@ -28,7 +28,7 @@ class Xcache { */ public function __construct($options=[]) { if ( !function_exists('xcache_info') ) { - throw new Exception('_NOT_SUPPERT_:Xcache'); + E('_NOT_SUPPERT_:Xcache'); } if(!empty($options)) { $this->options = array_merge($this->options,$options);