1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +02:00

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
This commit is contained in:
Meik Sievertsen
2008-09-04 12:01:47 +00:00
parent 4a225280a0
commit 2fcd96ca72
18 changed files with 199 additions and 74 deletions

View File

@@ -62,24 +62,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';
}
/**