mirror of
https://github.com/silverstripe/silverstripe-testsession
synced 2024-10-22 14:06:00 +02:00
Update references to deprecated global
This commit is contained in:
parent
f5ef9f4fbf
commit
2868e6bd3e
@ -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
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user