mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-02 21:52:34 +08:00
缓存驱动类更新
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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']);
|
||||
|
||||
@@ -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']);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user