aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db/sqlite.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2008-09-04 12:01:47 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2008-09-04 12:01:47 +0000
commit2fcd96ca72741bdfb36c24a0af9dd8230b5a828f (patch)
treeaf6068957c73f64d5885311396c1d7730aa30b3c /phpBB/includes/db/sqlite.php
parent4a225280a0fe1b7c364a007eb43dc93975c544e9 (diff)
downloadforums-2fcd96ca72741bdfb36c24a0af9dd8230b5a828f.tar
forums-2fcd96ca72741bdfb36c24a0af9dd8230b5a828f.tar.gz
forums-2fcd96ca72741bdfb36c24a0af9dd8230b5a828f.tar.bz2
forums-2fcd96ca72741bdfb36c24a0af9dd8230b5a828f.tar.xz
forums-2fcd96ca72741bdfb36c24a0af9dd8230b5a828f.zip
Ok, story real database server info, as well as caching it
Store it on installation too - allows us to check the db version used on installation and used currently to warn the user about incompatibilities git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8814 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 fae9ba3f92..288f6e0992 100644
--- a/phpBB/includes/db/sqlite.php
+++ b/phpBB/includes/db/sqlite.php
@@ -41,18 +41,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;
}
/**