Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Ingo Schommer authored May 01, 2012

Showing 2 changed files with 5 additions and 33 deletions. Show diff stats Hide diff stats

  1. 6  README.md
  2. 32  _config.php
6  README.md
Source Rendered
@@ -32,4 +32,8 @@ It will create 3^5 pages by default, so takes a while to run through.
32 32
 ## Requirements
33 33
 
34 34
 The module is intended to run against the latest core codebase,
35  
-but also includes branches matching earlier core releases for backwards compatibility.
  35
+but also includes branches matching earlier core releases for backwards compatibility.
  36
+
  37
+## Related
  38
+
  39
+ * [zframeworktest_dbswitcher](https://github.com/silverstripe-labs/zframeworktest_dbswitcher) module - adds capabilities to switch the database by a query parameter for testing purposes
32  _config.php
@@ -13,38 +13,6 @@
13 13
 	'dev/regress/$Action/$ID' => 'FrameworktestRegressSessionAdmin'
14 14
 ));
15 15
 
16  
-Session::start();
17  
-if(@$_GET['db']) {
18  
-	$db = $_GET['db'];
19  
-} elseif(@$_SESSION['db']) {
20  
-	$db = $_SESSION['db'];
21  
-} else {
22  
-	$db = null;
23  
-}
24  
-if($db) {
25  
-	global $databaseConfig;
26  
-	if($db == 'mysql') {
27  
-		$databaseConfig['type'] = 'MySQLDatabase';
28  
-		$databaseConfig['server'] = SS_MYSQL_DATABASE_SERVER;
29  
-		$databaseConfig['username'] = SS_MYSQL_DATABASE_USERNAME;
30  
-		$databaseConfig['password'] = SS_MYSQL_DATABASE_PASSWORD;
31  
-	} else if($db == 'postgresql') {
32  
-		$databaseConfig['type'] = 'PostgreSQLDatabase';
33  
-		$databaseConfig['server'] = SS_PGSQL_DATABASE_SERVER;
34  
-		$databaseConfig['username'] = SS_PGSQL_DATABASE_USERNAME;
35  
-		$databaseConfig['password'] = SS_PGSQL_DATABASE_PASSWORD;
36  
-	} else if($db == 'mssql') {
37  
-		$databaseConfig['type'] = 'MSSQLDatabase';
38  
-		$databaseConfig['server'] = SS_MSSQL_DATABASE_SERVER;
39  
-		$databaseConfig['username'] = SS_MSSQL_DATABASE_USERNAME;
40  
-		$databaseConfig['password'] = SS_MSSQL_DATABASE_PASSWORD;
41  
-	} else if($db == 'sqlite3') {
42  
-		$databaseConfig['type'] = 'SQLite3Database';
43  
-	} else {
44  
-		// stick with default settings set through ConfigureFromEnv
45  
-	}
46  
-}
47  
-
48 16
 if(@$_GET['db']) {
49 17
 	$enabletranslatable = @$_GET['enabletranslatable'];
50 18
 } elseif(@$_SESSION['db']) {

0 notes on commit 23a41eb

Please sign in to comment.
Something went wrong with that request. Please try again.