mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00: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.
|
* Ensure that the MySQL server version is at least 5.0.
|
||||||
* @param array $databaseConfig Associative array of db configuration, e.g. "server", "username" etc
|
* @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')
|
* @return array Result - e.g. array('success' => true, 'error' => 'details of error')
|
||||||
*/
|
*/
|
||||||
public function requireDatabaseVersion($databaseConfig) {
|
public function requireDatabaseVersion($databaseConfig) {
|
||||||
$conn = @mysql_connect($databaseConfig['server'], null, null);
|
$version = $this->getDatabaseVersion($databaseConfig);
|
||||||
$version = @mysql_get_server_info($conn);
|
|
||||||
$success = false;
|
$success = false;
|
||||||
$error = '';
|
$error = '';
|
||||||
if($version) {
|
if($version) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user