diff --git a/library/ajax/manage_admin.php b/library/ajax/manage_admin.php index c270e5a1..20bba3eb 100644 --- a/library/ajax/manage_admin.php +++ b/library/ajax/manage_admin.php @@ -15,7 +15,7 @@ switch ($mode) foreach ($bb_cfg['cache']['engines'] as $cache_name => $cache_val) { - if (!in_array('db_sqlite', $cache_val)) + if (!in_array(array('sqlite', 'filecache'), $cache_val)) { CACHE($cache_name)->rm(); } diff --git a/library/includes/cache/sqlite.php b/library/includes/cache/sqlite.php index 145acc1d..942c22ef 100644 --- a/library/includes/cache/sqlite.php +++ b/library/includes/cache/sqlite.php @@ -4,6 +4,7 @@ if (!defined('BB_ROOT')) die(basename(__FILE__)); class cache_sqlite extends cache_common { + var $engine = 'SQLite'; var $used = true; var $db = null; var $prefix = null; @@ -298,41 +299,11 @@ class sqlite_common extends cache_common return SQLite3::escapeString($str); } - function close () - { - @$this->dbh->close(); - } - - function busy ($timeout) - { - @$this->dbh->busyTimeout($timeout); - } - function get_error_msg () { return 'SQLite error #'. ($err_code = $this->dbh->lastErrorCode()) .': '. $this->dbh->lastErrorMsg(); } - function rm ($name = '') - { - if ($name) - { - $this->db->shard($this->prefix . $name); - $result = $this->db->query("DELETE FROM ". $this->cfg['table_name'] ." WHERE cache_name = '". sqlite3_escape_string($this->prefix . $name) ."'"); - } - else - { - $result = $this->db->query("DELETE FROM ". $this->cfg['table_name']); - } - return (bool) $result; - } - - function gc ($expire_time = TIMENOW) - { - $result = $this->db->query("DELETE FROM ". $this->cfg['table_name'] ." WHERE cache_expire_time < $expire_time"); - return ($result) ? sqlite_changes($this->db->dbh) : 0; - } - function trigger_error ($msg = 'DB Error') { if (error_reporting()) trigger_error($msg, E_USER_ERROR); diff --git a/library/includes/core/caches.php b/library/includes/core/caches.php index ef027fd8..c49d58d0 100644 --- a/library/includes/core/caches.php +++ b/library/includes/core/caches.php @@ -48,19 +48,6 @@ class CACHES $this->ref[$cache_name] =& $this->obj[$cache_name]; break; - case 'db_sqlite': - if (!isset($this->obj[$cache_name])) - { - $cache_cfg['pconnect'] = $this->cfg['pconnect']; - $cache_cfg['db_file_path'] = $this->get_db_path($cache_name, $cache_cfg, '.sqlite.db'); - $cache_cfg['table_name'] = $cache_name; - $cache_cfg['table_schema'] = $this->get_table_schema($cache_cfg); - - $this->obj[$cache_name] = new sqlite_common($cache_cfg); - } - $this->ref[$cache_name] =& $this->obj[$cache_name]; - break; - case 'redis': if (!isset($this->obj[$cache_name])) {