From eeff813be2ccd9ea07d6a816d8b6d403897573d8 Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Tue, 26 May 2009 23:45:54 +0000 Subject: [PATCH] API CHANGE: Added SS_DATABASE_CLASS as an option for _ss_environment.php git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77890 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- conf/ConfigureFromEnv.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/conf/ConfigureFromEnv.php b/conf/ConfigureFromEnv.php index 5a8dd0bda..b7a52b1cd 100644 --- a/conf/ConfigureFromEnv.php +++ b/conf/ConfigureFromEnv.php @@ -8,11 +8,13 @@ * your site. * * Your database connection will be set up using these defines: - * - SS_DATABASE_SERVER: The database server to use, defaulting to localhost + * - SS_DATABASE_CLASS: The database class to use, MySQLDatabase, MSSQLDatabase, etc. defaults to + * MySQLDatabase + * - SS_DATABASE_SERVER: The database server to use, defaulting to localhost * - SS_DATABASE_USERNAME: The databsae username (mandatory) * - SS_DATABASE_PASSWORD: The database password (mandatory) - * - SS_DATABASE_SUFFIX: A suffix to add to the database name. - * - SS_DATABASE_PREFIX: A prefix to add to the database name. + * - SS_DATABASE_SUFFIX: A suffix to add to the database name. + * - SS_DATABASE_PREFIX: A prefix to add to the database name. * * There is one more setting that is intended to be used by people who work on SilverStripe. * - SS_DATABASE_CHOOSE_NAME: Boolean/Int. If set, then the system will choose a default database name for you if one isn't give @@ -73,7 +75,7 @@ if(!isset($database) || !$database) { if(defined('SS_DATABASE_USERNAME') && defined('SS_DATABASE_PASSWORD')) { global $databaseConfig; $databaseConfig = array( - "type" => "MySQLDatabase", + "type" => defined('SS_DATABASE_CLASS') ? SS_DATABASE_CLASS : "MySQLDatabase", "server" => defined('SS_DATABASE_SERVER') ? SS_DATABASE_SERVER : 'localhost', "username" => SS_DATABASE_USERNAME, "password" => SS_DATABASE_PASSWORD,