Permalink
Browse files

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 (from r98877)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/trunk@112107 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent 1a2f989 commit 4997c0a9bd7631ea1ed89cbc5ddddf30aaab6f56 sminnee committed Oct 13, 2010
Showing with 10 additions and 39 deletions.
  1. +10 −39 install.php
View
@@ -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 @@ function checkdatabase($databaseConfig) {
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,29 +246,19 @@ function checkdatabase($databaseConfig) {
"That username/password doesn't work"
)
)) {
- @$this->requireMySQLVersion(
- "4.1",
+ $this->requireDatabaseOrCreatePermissions(
+ $databaseConfig,
array(
- "MySQL Configuration",
- "MySQL version at least 4.1",
- "MySQL version 4.1 is required, you only have ",
- "MySQL " . mysql_get_server_info()
+ "Database Configuration",
+ "Can I access/create the database",
+ "I can't create new databases and the database '$databaseConfig[database]' doesn't exist"
)
);
}
- $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
*/
@@ -664,28 +657,6 @@ function requireDatabaseOrCreatePermissions($databaseConfig, $testDetails) {
}
}
- 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) {

0 comments on commit 4997c0a

Please sign in to comment.