mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 04:22:07 +02:00
MDL-72125 testing: Make global $CFG available when including generators
This will remove the requirement to add the global $CFG call to the top of generator scripts.
This commit is contained in:
parent
87b50a42e8
commit
46a5c75196
@ -103,6 +103,9 @@ EOD;
|
||||
* @return component_generator_base or rather an instance of the appropriate subclass.
|
||||
*/
|
||||
public function get_plugin_generator($component) {
|
||||
// Note: This global is included so that generator have access to it.
|
||||
// CFG is widely used in require statements.
|
||||
global $CFG;
|
||||
list($type, $plugin) = core_component::normalize_component($component);
|
||||
$cleancomponent = $type . '_' . $plugin;
|
||||
if ($cleancomponent != $component) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user