mirror of
https://github.com/silverstripe/silverstripe-installer
synced 2024-10-22 17:05:33 +02:00
MINOR Removed MySQL specific checking from the installer until we can figure out how to do it well across different databases. The only remaining MySQL specifics in the installer is the sending of the server information to ss2stats
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/branches/2.4@98877 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
c4f1e42a8d
commit
02dc0f4518
41
install.php
41
install.php
@ -216,7 +216,9 @@ class InstallRequirements {
|
||||
var $errors, $warnings, $tests;
|
||||
|
||||
/**
|
||||
* Just check that the database configuration is all good.
|
||||
* Check the database configuration. These are done one after another
|
||||
* starting with checking the database function exists in PHP, and
|
||||
* continuing onto more difficult checks like database permissions.
|
||||
*/
|
||||
function checkdatabase($databaseConfig) {
|
||||
if($this->requireDatabaseFunctions(
|
||||
@ -232,7 +234,8 @@ class InstallRequirements {
|
||||
array(
|
||||
"Database Configuration",
|
||||
"Database server exists",
|
||||
"I couldn't find a database server on '$databaseConfig[server]'", $databaseConfig['server']
|
||||
"I couldn't find a database server on '$databaseConfig[server]'",
|
||||
$databaseConfig['server']
|
||||
)
|
||||
)) {
|
||||
if($this->requireDatabaseConnection(
|
||||
@ -243,16 +246,6 @@ class InstallRequirements {
|
||||
"That username/password doesn't work"
|
||||
)
|
||||
)) {
|
||||
@$this->requireMySQLVersion(
|
||||
"4.1",
|
||||
array(
|
||||
"MySQL Configuration",
|
||||
"MySQL version at least 4.1",
|
||||
"MySQL version 4.1 is required, you only have ",
|
||||
"MySQL " . mysql_get_server_info()
|
||||
)
|
||||
);
|
||||
}
|
||||
$this->requireDatabaseOrCreatePermissions(
|
||||
$databaseConfig,
|
||||
array(
|
||||
@ -264,7 +257,7 @@ class InstallRequirements {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Check everything except the database
|
||||
@ -664,28 +657,6 @@ class InstallRequirements {
|
||||
}
|
||||
}
|
||||
|
||||
function requireMySQLVersion($version, $testDetails) {
|
||||
$this->testing($testDetails);
|
||||
|
||||
if(!mysql_get_server_info()) {
|
||||
$testDetails[2] = 'Cannot determine the version of MySQL installed. Please ensure at least version 4.1 is installed.';
|
||||
$this->warning($testDetails);
|
||||
} else {
|
||||
list($majorRequested, $minorRequested) = explode('.', $version);
|
||||
$result = mysql_query('SELECT VERSION()');
|
||||
$row = mysql_fetch_row($result);
|
||||
$version = ereg_replace("([A-Za-z-])", "", $row[0]);
|
||||
list($majorHas, $minorHas) = explode('.', substr(trim($version), 0, 3));
|
||||
|
||||
if(($majorHas > $majorRequested) || ($majorHas == $majorRequested && $minorHas >= $minorRequested)) {
|
||||
return true;
|
||||
} else {
|
||||
$testDetails[2] .= "{$majorHas}.{$minorHas}.";
|
||||
$this->error($testDetails);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function requireServerVariables($varNames, $errorMessage) {
|
||||
//$this->testing($testDetails);
|
||||
foreach($varNames as $varName) {
|
||||
|
Loading…
Reference in New Issue
Block a user