registration: Load extra autoload files before executing callbacks
authorFlorian <florian.schmidt.stargatewissen@gmail.com>
Wed, 6 Apr 2016 22:00:16 +0000 (00:00 +0200)
committerLegoktm <legoktm.wikipedia@gmail.com>
Wed, 6 Apr 2016 22:33:18 +0000 (22:33 +0000)
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

includes/registration/ExtensionRegistry.php

index 33395f7..dc53ca4 100644 (file)
@@ -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'] ) {