mirror of
https://github.com/catalyst/moodle-auth_outage.git
synced 2026-05-16 21:41:31 +02:00
Fixed issue where behat_update_vars_for_process changes $CFG prematurely.
This commit is contained in:
@@ -40,10 +40,13 @@ if (!isset($CFG->dataroot)) {
|
||||
// 1) Make sure we replace the configurations for behat as we have not ran 'lib/setup.php' yet.
|
||||
if (!empty($CFG->behat_wwwroot) or !empty($CFG->behat_dataroot) or !empty($CFG->behat_prefix)) {
|
||||
require_once(__DIR__.'/../../lib/behat/lib.php');
|
||||
|
||||
// The function call below will change $CFG so let's save it and restore later if access is granted.
|
||||
$beforebehatcfg = $CFG;
|
||||
$CFG = clone($CFG);
|
||||
behat_update_vars_for_process();
|
||||
|
||||
if (behat_is_test_site()) {
|
||||
$beforebehatcfg = $CFG;
|
||||
$CFG = clone($CFG);
|
||||
clearstatcache();
|
||||
behat_check_config_vars();
|
||||
behat_clean_init_config();
|
||||
@@ -82,4 +85,5 @@ $CFG->auth_outage_bootstrap_loaded = true;
|
||||
// 5) Restore behat config as needed (let setup.php execute which is more complex than our quick-check).
|
||||
if (isset($beforebehatcfg)) {
|
||||
$CFG = $beforebehatcfg;
|
||||
unset($beforebehatcfg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user