1
0
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:
Meik Sievertsen
2008-09-04 14:10:03 +00:00
parent a736c97c04
commit 3a330753f4
11 changed files with 193 additions and 72 deletions

View File

@@ -57,24 +57,38 @@ class dbal_mssql extends dbal
/**
* 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)
{
$result_id = @mssql_query("SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition')", $this->db_connect_id);
global $cache;
$row = false;
if ($result_id)
if (empty($cache) || ($this->sql_server_version = $cache->get('mssql_version')) === false)
{
$row = @mssql_fetch_assoc($result_id);
@mssql_free_result($result_id);
$result_id = @mssql_query("SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition')", $this->db_connect_id);
$row = false;
if ($result_id)
{
$row = @mssql_fetch_assoc($result_id);
@mssql_free_result($result_id);
}
$this->sql_server_version = ($row) ? trim(implode(' ', $row)) : 0;
if (!empty($cache))
{
$cache->put('mssql_version', $this->sql_server_version);
}
}
if ($row)
if ($raw)
{
return 'MSSQL<br />' . implode(' ', $row);
return $this->sql_server_version;
}
return 'MSSQL';
return ($this->sql_server_version) ? 'MSSQL<br />' . $this->sql_server_version : 'MSSQL';
}
/**