mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
ENHANCEMENT Added MySQLDatabaseConfigurationHelper::getDatabaseVersion() which abstracts the version number away from the version check the installer requires
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@105712 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
003d43f3ac
commit
83a433894a
@ -42,14 +42,18 @@ class MySQLDatabaseConfigurationHelper implements DatabaseConfigurationHelper {
|
||||
);
|
||||
}
|
||||
|
||||
public function getDatabaseVersion($databaseConfig) {
|
||||
$conn = @mysql_connect($databaseConfig['server'], null, null);
|
||||
return @mysql_get_server_info($conn);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure that the MySQL server version is at least 5.0.
|
||||
* @param array $databaseConfig Associative array of db configuration, e.g. "server", "username" etc
|
||||
* @return array Result - e.g. array('success' => true, 'error' => 'details of error')
|
||||
*/
|
||||
public function requireDatabaseVersion($databaseConfig) {
|
||||
$conn = @mysql_connect($databaseConfig['server'], null, null);
|
||||
$version = @mysql_get_server_info($conn);
|
||||
$version = $this->getDatabaseVersion($databaseConfig);
|
||||
$success = false;
|
||||
$error = '';
|
||||
if($version) {
|
||||
|
Loading…
Reference in New Issue
Block a user