From: Florian Date: Wed, 6 Apr 2016 22:00:16 +0000 (+0200) Subject: registration: Load extra autoload files before executing callbacks X-Git-Tag: 1.31.0-rc.0~7358^2 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=70f6f8865f2da8e00c671fb1357bdcb3bdfe9cf0;p=lhc%2Fweb%2Fwiklou.git registration: Load extra autoload files before executing callbacks Callbacks should be able to safely assume that anything (or at least mostly) defined in extension registration is already loaded and processed when the callback itself is executed. To make sure, that this applies, callbacks should be executed after all extra autoload paths are loaded. Bug: T131978 Change-Id: I2c6624423957a8a00523b126fa7209d9c283aa9e --- diff --git a/includes/registration/ExtensionRegistry.php b/includes/registration/ExtensionRegistry.php index 33395f74ad..dc53ca455a 100644 --- a/includes/registration/ExtensionRegistry.php +++ b/includes/registration/ExtensionRegistry.php @@ -274,13 +274,12 @@ class ExtensionRegistry { foreach ( $info['defines'] as $name => $val ) { define( $name, $val ); } - foreach ( $info['callbacks'] as $cb ) { - call_user_func( $cb ); - } - foreach ( $info['autoloaderPaths'] as $path ) { require_once $path; } + foreach ( $info['callbacks'] as $cb ) { + call_user_func( $cb ); + } $this->loaded += $info['credits']; if ( $info['attributes'] ) {