Improve server environment display

This commit is contained in:
Kijin Sung 2017-02-22 19:49:49 +09:00
parent 954d2c7ec6
commit 4ee115e4f3
10 changed files with 186 additions and 210 deletions

View file

@ -112,6 +112,7 @@ class DB
* @var string
*/
public $db_type;
public $db_version = '';
/**
* flag to decide if class prepared statements or not (when supported); can be changed from db.config.info

View file

@ -87,6 +87,7 @@ class DBCubrid extends DB
return;
}
$this->db_version = __CUBRID_VERSION__;
cubrid_set_autocommit($result, CUBRID_AUTOCOMMIT_TRUE);
return $result;

View file

@ -74,13 +74,13 @@ class DBMssql extends DB
$server_info = sqlsrv_server_info($result);
$server_version = $server_info['SQLServerVersion'];
$this->db_version = $server_version;
if ($server_version && version_compare($server_version, '10', '<'))
{
$this->setError(-1, 'Rhymix requires Microsoft SQL Server 2008 or later. Current version is ' . $server_version);
return;
}
return $result;
}

View file

@ -78,9 +78,10 @@ class DBMysql extends DB
}
// Error appears if the version is lower than 5.0.7
if(version_compare(mysql_get_server_info($result), '5.0.7', '<'))
$this->db_version = mysql_get_server_info($result);
if(version_compare($this->db_version, '5.0.7', '<'))
{
$this->setError(-1, 'Rhymix requires MySQL 5.0.7 or later. Current MySQL version is ' . mysql_get_server_info());
$this->setError(-1, 'Rhymix requires MySQL 5.0.7 or later. Current MySQL version is ' . $this->db_version);
return;
}

View file

@ -39,6 +39,7 @@ class DBMysqli extends DBMysql
return;
}
$this->charset = isset($connection['charset']) ? $connection['charset'] : 'utf8';
$this->db_version = $result->server_info;
mysqli_set_charset($result, $this->charset);
return $result;
}