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
49
install.php
49
install.php
@ -216,7 +216,9 @@ class InstallRequirements {
|
|||||||
var $errors, $warnings, $tests;
|
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) {
|
function checkdatabase($databaseConfig) {
|
||||||
if($this->requireDatabaseFunctions(
|
if($this->requireDatabaseFunctions(
|
||||||
@ -232,7 +234,8 @@ class InstallRequirements {
|
|||||||
array(
|
array(
|
||||||
"Database Configuration",
|
"Database Configuration",
|
||||||
"Database server exists",
|
"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(
|
if($this->requireDatabaseConnection(
|
||||||
@ -243,29 +246,19 @@ class InstallRequirements {
|
|||||||
"That username/password doesn't work"
|
"That username/password doesn't work"
|
||||||
)
|
)
|
||||||
)) {
|
)) {
|
||||||
@$this->requireMySQLVersion(
|
$this->requireDatabaseOrCreatePermissions(
|
||||||
"4.1",
|
$databaseConfig,
|
||||||
array(
|
array(
|
||||||
"MySQL Configuration",
|
"Database Configuration",
|
||||||
"MySQL version at least 4.1",
|
"Can I access/create the database",
|
||||||
"MySQL version 4.1 is required, you only have ",
|
"I can't create new databases and the database '$databaseConfig[database]' doesn't exist"
|
||||||
"MySQL " . mysql_get_server_info()
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$this->requireDatabaseOrCreatePermissions(
|
|
||||||
$databaseConfig,
|
|
||||||
array(
|
|
||||||
"Database Configuration",
|
|
||||||
"Can I access/create the database",
|
|
||||||
"I can't create new databases and the database '$databaseConfig[database]' doesn't exist"
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check everything except the database
|
* 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) {
|
function requireServerVariables($varNames, $errorMessage) {
|
||||||
//$this->testing($testDetails);
|
//$this->testing($testDetails);
|
||||||
foreach($varNames as $varName) {
|
foreach($varNames as $varName) {
|
||||||
|
Loading…
Reference in New Issue
Block a user