silverstripe-translatable/tests/travis/_config.php

50 lines
1.1 KiB
PHP
Raw Normal View History

2012-10-02 21:34:53 +02:00
<?php
global $project;
$project = 'mysite';
global $databaseConfig;
2013-03-28 11:21:32 +01:00
switch(getenv('DB')) {
case "PGSQL";
$databaseConfig = array(
"type" => "PostgreSQLDatabase",
"server" => 'localhost',
"username" => 'postgres',
"password" => '',
"database" => 'SS_travis'
);
break;
case "MYSQL":
$databaseConfig = array(
"type" => "MySQLDatabase",
"server" => 'localhost',
"username" => 'root',
"password" => '',
"database" => 'SS_travis'
);
break;
default:
$databaseConfig = array(
"type" => "SQLitePDODatabase",
"server" => 'localhost',
"memory" => true,
"database" => 'SS_travis',
'path' => dirname(dirname(__FILE__)) .'/assets/'
);
}
echo $databaseConfig['type'];
2012-10-02 21:34:53 +02:00
2013-03-28 11:21:32 +01:00
Security::setDefaultAdmin('username', 'password');
2012-10-02 21:34:53 +02:00
2013-03-28 11:21:32 +01:00
// Fake hostname on CLI to stop framework from complaining
$_SERVER['HTTP_HOST'] = 'http://localhost';
2012-10-02 21:34:53 +02:00
2013-03-28 11:21:32 +01:00
// Version-specific configuration
$version = getenv('CORE_RELEASE');
if($version != 'master' && version_compare('3.1', $version) == -1) {
MySQLDatabase::set_connection_charset('utf8');
SSViewer::set_theme('simple');
} else {
Config::inst()->update('SSViewer', 'theme', 'simple');
}