Update references to deprecated global

This commit is contained in:
Damian Mooyman 2017-06-22 15:15:17 +12:00
parent f5ef9f4fbf
commit 2868e6bd3e
3 changed files with 17 additions and 17 deletions

View File

@ -12,7 +12,7 @@ TestSessionEnvironment::singleton()->loadFromFile();
*/
if (class_exists('Resque_Event') && class_exists('SSResqueRun')) {
Resque_Event::listen('beforeFork', function ($data) {
global $databaseConfig;
$databaseConfig = DB::getConfig();
// Reconnect to the database - this may connect to the old DB first, but is required because these processes
// are long-lived, and MySQL connections often get closed in between worker runs. We need to connect before

View File

@ -450,9 +450,9 @@ class TestSessionEnvironment
public function resetDatabaseName()
{
if ($this->oldDatabaseName) {
global $databaseConfig;
$databaseConfig = DB::getConfig();
$databaseConfig['database'] = $this->oldDatabaseName;
DB::setConfig($databaseConfig);
$conn = DB::get_conn();

View File

@ -58,7 +58,7 @@ class TestSessionRequestFilter implements RequestFilter
$file = $testState->stubfile;
if (!Director::isLive() && $file && file_exists($file)) {
// Connect to the database so the included code can interact with it
global $databaseConfig;
$databaseConfig = DB::getConfig();
if ($databaseConfig) {
DB::connect($databaseConfig);
}