2008-10-03 00:48:55 +02:00
|
|
|
<?php
|
|
|
|
|
2010-01-28 08:26:00 +01:00
|
|
|
Object::add_extension('Member', 'FrameworkTestRole');
|
|
|
|
Object::add_extension('Member', 'FileUploadRole');
|
|
|
|
|
2010-02-19 04:36:29 +01:00
|
|
|
Object::add_extension('SiteConfig', 'CMSWorkflowSiteConfigDecorator');
|
|
|
|
|
|
|
|
CMSWorkflowSiteConfigDecorator::apply_active_config();
|
2010-05-03 22:43:40 +02:00
|
|
|
|
|
|
|
Director::addRules(100, array(
|
|
|
|
'dev/regress/$Action/$ID' => 'FrameworktestRegressSessionAdmin'
|
|
|
|
));
|
2010-05-03 22:45:17 +02:00
|
|
|
|
|
|
|
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']) {
|
2010-05-11 00:45:09 +02:00
|
|
|
$enabletranslatable = @$_GET['enabletranslatable'];
|
2010-05-03 22:45:17 +02:00
|
|
|
} elseif(@$_SESSION['db']) {
|
2010-05-11 00:45:09 +02:00
|
|
|
$enabletranslatable = @$_SESSION['enabletranslatable'];
|
2010-05-03 22:45:17 +02:00
|
|
|
} else {
|
|
|
|
$enabletranslatable = null;
|
|
|
|
}
|
|
|
|
if($enabletranslatable) {
|
|
|
|
Object::add_extension('SiteTree', 'Translatable');
|
|
|
|
Object::add_extension('SiteConfig', 'Translatable');
|
|
|
|
}
|
2010-01-28 08:26:00 +01:00
|
|
|
?>
|