Skip to content

Commit

Permalink
MINOR Amendments to installer database configuration and small issue …
Browse files Browse the repository at this point in the history
…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
sminnee committed Oct 13, 2010
1 parent 73964a8 commit 6368a4f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions install.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -616,6 +620,7 @@ function requireDatabaseFunctions($databaseConfig, $testDetails) {
if($result) {
return true;
} else {
$this->error($testDetails);
return false;
}
}
Expand All @@ -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'];
Expand Down

0 comments on commit 6368a4f

Please sign in to comment.