Permalink
Browse files

MINOR Amendments to installer database configuration and small issue …

…detecting database support in PHP (from r98794)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/phpinstaller/trunk@112102 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent 73964a8 commit 6368a4fea040244f2374fb9b10e3655e97735f5f sminnee committed Oct 13, 2010
Showing with 10 additions and 6 deletions.
  1. +10 −6 install.php
View
@@ -53,31 +53,35 @@
// This is a listing of known external databases
$otherDatabaseLocations = array(
'mssql' => array(
+ 'dir' => 'mssql/code',
'class' => 'MSSQLDatabase',
'title' => 'SQL Server 2008'
),
'postgresql' => array(
+ 'dir' => 'postgresql/code',
'class' => 'PostgreSQLDatabase',
'title' => 'PostgreSQL'
),
'sqlite3' => array(
+ 'dir' => 'sqlite3/code',
'class' => 'SQLite3Database',
'title' => 'SQLite 3'
),
'sqlitepdo' => array(
+ 'dir' => 'sqlite3/code',
'class' => 'SQLitePDODatabase',
'title' => 'SQLite PDO'
)
);
-// MySQL support comes out of the box with sapphire. Other databases
-// live in their own module directories. Let's find out if there
-// are any installed and determine if they have a configuration helper.
+// MySQL support comes out of the box with sapphire
$foundDatabaseClasses = array('MySQLDatabase' => 'MySQL');
include_once('sapphire/dev/install/DatabaseConfigurationHelper.php');
include_once('sapphire/dev/install/MySQLDatabaseConfigurationHelper.php');
-foreach($otherDatabaseLocations as $dir => $details) {
- $helperPath = $dir . '/code/' . $details['class'] . 'ConfigurationHelper.php';
+
+// Determine which external database modules are installed
+foreach($otherDatabaseLocations as $details) {
+ $helperPath = $details['dir'] . '/' . $details['class'] . 'ConfigurationHelper.php';
if(file_exists($helperPath)) {
$foundDatabaseClasses[$details['class']] = $details['title'];
include_once($helperPath);
@@ -616,6 +620,7 @@ function requireDatabaseFunctions($databaseConfig, $testDetails) {
if($result) {
return true;
} else {
+ $this->error($testDetails);
return false;
}
}
@@ -625,7 +630,6 @@ function requireDatabaseConnection($databaseConfig, $testDetails) {
$helper = $this->getDatabaseConfigurationHelper($databaseConfig['type']);
$result = $helper->requireDatabaseConnection($databaseConfig);
if($result['okay']) {
- $result['connection'];
return true;
} else {
$testDetails[2] .= ": " . $result['error'];

0 comments on commit 6368a4f

Please sign in to comment.