aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db/sqlite.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2008-09-04 14:10:03 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2008-09-04 14:10:03 +0000
commit3a330753f413c3e024163f8f401f327bc2f9930c (patch)
tree37621305e29c6b56e8aa93778e8ec3bc64f38a38 /phpBB/includes/db/sqlite.php
parenta736c97c04bde8138c3cb7236004e30133d91b65 (diff)
downloadforums-3a330753f413c3e024163f8f401f327bc2f9930c.tar
forums-3a330753f413c3e024163f8f401f327bc2f9930c.tar.gz
forums-3a330753f413c3e024163f8f401f327bc2f9930c.tar.bz2
forums-3a330753f413c3e024163f8f401f327bc2f9930c.tar.xz
forums-3a330753f413c3e024163f8f401f327bc2f9930c.zip
Get real dbms version instead of relying on php internal functions which only grab the local library version
git-svn-id: file:///svn/phpbb/trunk@8821 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/db/sqlite.php')
-rw-r--r--phpBB/includes/db/sqlite.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/phpBB/includes/db/sqlite.php b/phpBB/includes/db/sqlite.php
index df1180db8f..dc2701c1ce 100644
--- a/phpBB/includes/db/sqlite.php
+++ b/phpBB/includes/db/sqlite.php
@@ -49,18 +49,31 @@ class dbal_sqlite extends dbal
if ($this->db_connect_id)
{
@sqlite_query('PRAGMA short_column_names = 1', $this->db_connect_id);
+// @sqlite_query('PRAGMA encoding = "UTF-8"', $this->db_connect_id);
}
-
return ($this->db_connect_id) ? true : array('message' => $error);
}
/**
* Version information about used database
+ * @param bool $raw if true, only return the fetched sql_server_version
+ * @return string sql server version
*/
- function sql_server_info()
+ function sql_server_info($raw = false)
{
- return 'SQLite ' . @sqlite_libversion();
+ global $cache;
+
+ if (empty($cache) || ($this->sql_server_version = $cache->get('sqlite_version')) === false)
+ {
+ $result = @sqlite_query('SELECT sqlite_version() AS version', $this->db_connect_id);
+ $row = @sqlite_fetch_array($result, SQLITE_ASSOC);
+
+ $this->sql_server_version = (!empty($row['version'])) ? $row['version'] : 0;
+ $cache->put('sqlite_version', $this->sql_server_version);
+ }
+
+ return ($raw) ? $this->sql_server_version : 'SQLite ' . $this->sql_server_version;
}
/**