diff options
| author | Nils Adermann <naderman@naderman.de> | 2010-03-02 01:05:34 +0100 |
|---|---|---|
| committer | Nils Adermann <naderman@naderman.de> | 2010-03-02 01:05:34 +0100 |
| commit | 07633a66e8c9bbb2b288a286bfbea6f562eeca4d (patch) | |
| tree | a255efa70ed6f202542649148c0445445504d181 /phpBB/includes/db/sqlite.php | |
| parent | ee82970d96e0a6772b24c48aab8ebd1888ec5216 (diff) | |
| parent | 5cfa0ec0c32ddc424f9651d8766db3e4ced59f96 (diff) | |
| download | forums-07633a66e8c9bbb2b288a286bfbea6f562eeca4d.tar forums-07633a66e8c9bbb2b288a286bfbea6f562eeca4d.tar.gz forums-07633a66e8c9bbb2b288a286bfbea6f562eeca4d.tar.bz2 forums-07633a66e8c9bbb2b288a286bfbea6f562eeca4d.tar.xz forums-07633a66e8c9bbb2b288a286bfbea6f562eeca4d.zip | |
Merge commit 'release-3.0-B3'
Diffstat (limited to 'phpBB/includes/db/sqlite.php')
| -rw-r--r-- | phpBB/includes/db/sqlite.php | 91 |
1 files changed, 14 insertions, 77 deletions
diff --git a/phpBB/includes/db/sqlite.php b/phpBB/includes/db/sqlite.php index cd6d40e3c7..708376881c 100644 --- a/phpBB/includes/db/sqlite.php +++ b/phpBB/includes/db/sqlite.php @@ -9,20 +9,14 @@ */ /** +* @ignore */ if (!defined('IN_PHPBB')) { exit; } -/** -* @ignore -*/ -if (!defined('SQL_LAYER')) -{ - - define('SQL_LAYER', 'sqlite'); - include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx); +include_once($phpbb_root_path . 'includes/db/dbal.' . $phpEx); /** * Sqlite Database Abstraction Layer @@ -63,7 +57,7 @@ class dbal_sqlite extends dbal /** * SQL Transaction - * @access: private + * @access private */ function _sql_transaction($status = 'begin') { @@ -109,7 +103,7 @@ class dbal_sqlite extends dbal $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false; $this->sql_add_num_queries($this->query_result); - if (!$this->query_result) + if ($this->query_result === false) { if (($this->query_result = @sqlite_query($query, $this->db_connect_id)) === false) { @@ -170,27 +164,6 @@ class dbal_sqlite extends dbal } /** - * Return number of rows - * Not used within core code - */ - function sql_numrows($query_id = false) - { - global $cache; - - if (!$query_id) - { - $query_id = $this->query_result; - } - - if (isset($cache->sql_rowset[$query_id])) - { - return $cache->sql_numrows($query_id); - } - - return ($query_id) ? @sqlite_num_rows($query_id) : false; - } - - /** * Return number of affected rows */ function sql_affectedrows() @@ -205,7 +178,7 @@ class dbal_sqlite extends dbal { global $cache; - if (!$query_id) + if ($query_id === false) { $query_id = $this->query_result; } @@ -215,40 +188,7 @@ class dbal_sqlite extends dbal return $cache->sql_fetchrow($query_id); } - $row = @sqlite_fetch_array($query_id, SQLITE_ASSOC); - - return $row; - } - - /** - * Fetch field - * if rownum is false, the current row is used, else it is pointing to the row (zero-based) - */ - function sql_fetchfield($field, $rownum = false, $query_id = false) - { - global $cache; - - if (!$query_id) - { - $query_id = $this->query_result; - } - - if ($query_id) - { - if ($rownum !== false) - { - $this->sql_rowseek($rownum, $query_id); - } - - if (isset($cache->sql_rowset[$query_id])) - { - return $cache->sql_fetchfield($query_id, $field); - } - - return @sqlite_column($query_id, $field); - } - - return false; + return ($query_id !== false) ? @sqlite_fetch_array($query_id, SQLITE_ASSOC) : false; } /** @@ -259,17 +199,17 @@ class dbal_sqlite extends dbal { global $cache; - if (!$query_id) + if ($query_id === false) { $query_id = $this->query_result; } if (isset($cache->sql_rowset[$query_id])) { - return $cache->sql_rowseek($query_id, $rownum); + return $cache->sql_rowseek($rownum, $query_id); } - return ($query_id) ? @sqlite_seek($query_id, $rownum) : false; + return ($query_id !== false) ? @sqlite_seek($query_id, $rownum) : false; } /** @@ -287,7 +227,7 @@ class dbal_sqlite extends dbal { global $cache; - if (!$query_id) + if ($query_id === false) { $query_id = $this->query_result; } @@ -310,7 +250,7 @@ class dbal_sqlite extends dbal /** * return sql error array - * @access: private + * @access private */ function _sql_error() { @@ -322,7 +262,7 @@ class dbal_sqlite extends dbal /** * Build db-specific query data - * @access: private + * @access private */ function _sql_custom_build($stage, $data) { @@ -331,7 +271,7 @@ class dbal_sqlite extends dbal /** * Close sql connection - * @access: private + * @access private */ function _sql_close() { @@ -340,7 +280,7 @@ class dbal_sqlite extends dbal /** * Build db-specific report - * @access: private + * @access private */ function _sql_report($mode, $query = '') { @@ -367,9 +307,6 @@ class dbal_sqlite extends dbal break; } } - } -} // if ... define - ?>
\ No newline at end of file |
