mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user