Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BUGFIX Moved db switching to separate module which is included later …

…in the manifest, which means it doesn't get overwritten by ConfigureFromEnv.php in mysite
  • Loading branch information...
commit 23a41ebf92038fe847359825b25a34b30382d2c6 1 parent 728bcfe
@chillu chillu authored
Showing with 5 additions and 33 deletions.
  1. +5 −1 README.md
  2. +0 −32 _config.php
View
6 README.md
@@ -32,4 +32,8 @@ It will create 3^5 pages by default, so takes a while to run through.
## Requirements
The module is intended to run against the latest core codebase,
-but also includes branches matching earlier core releases for backwards compatibility.
+but also includes branches matching earlier core releases for backwards compatibility.
+
+## Related
+
+ * [zframeworktest_dbswitcher](https://github.com/silverstripe-labs/zframeworktest_dbswitcher) module - adds capabilities to switch the database by a query parameter for testing purposes
View
32 _config.php
@@ -13,38 +13,6 @@
'dev/regress/$Action/$ID' => 'FrameworktestRegressSessionAdmin'
));
-Session::start();
-if(@$_GET['db']) {
- $db = $_GET['db'];
-} elseif(@$_SESSION['db']) {
- $db = $_SESSION['db'];
-} else {
- $db = null;
-}
-if($db) {
- global $databaseConfig;
- if($db == 'mysql') {
- $databaseConfig['type'] = 'MySQLDatabase';
- $databaseConfig['server'] = SS_MYSQL_DATABASE_SERVER;
- $databaseConfig['username'] = SS_MYSQL_DATABASE_USERNAME;
- $databaseConfig['password'] = SS_MYSQL_DATABASE_PASSWORD;
- } else if($db == 'postgresql') {
- $databaseConfig['type'] = 'PostgreSQLDatabase';
- $databaseConfig['server'] = SS_PGSQL_DATABASE_SERVER;
- $databaseConfig['username'] = SS_PGSQL_DATABASE_USERNAME;
- $databaseConfig['password'] = SS_PGSQL_DATABASE_PASSWORD;
- } else if($db == 'mssql') {
- $databaseConfig['type'] = 'MSSQLDatabase';
- $databaseConfig['server'] = SS_MSSQL_DATABASE_SERVER;
- $databaseConfig['username'] = SS_MSSQL_DATABASE_USERNAME;
- $databaseConfig['password'] = SS_MSSQL_DATABASE_PASSWORD;
- } else if($db == 'sqlite3') {
- $databaseConfig['type'] = 'SQLite3Database';
- } else {
- // stick with default settings set through ConfigureFromEnv
- }
-}
-
if(@$_GET['db']) {
$enabletranslatable = @$_GET['enabletranslatable'];
} elseif(@$_SESSION['db']) {
Please sign in to comment.
Something went wrong with that request. Please try again.