},
'ResourceLoader' => function ( MediaWikiServices $services ) : ResourceLoader {
+ global $IP;
$config = $services->getMainConfig();
$rl = new ResourceLoader(
LoggerFactory::getInstance( 'resourceloader' )
);
$rl->addSource( $config->get( 'ResourceLoaderSources' ) );
+ $rl->register( include "$IP/resources/Resources.php" );
return $rl;
},
* @param LoggerInterface|null $logger [optional]
*/
public function __construct( Config $config = null, LoggerInterface $logger = null ) {
- global $IP;
-
$this->logger = $logger ?: new NullLogger();
if ( !$config ) {
// Add 'local' source first
$this->addSource( 'local', $config->get( 'LoadScript' ) );
- // Register core modules
- $this->register( include "$IP/resources/Resources.php" );
+ // Special module that always exists
+ $this->register( 'startup', [ 'class' => ResourceLoaderStartUpModule::class ] );
+
// Register extension modules
$this->register( $config->get( 'ResourceModules' ) );
global $wgResourceBasePath;
return [
-
- /**
- * Special modules who have their own classes
- */
- 'startup' => [ 'class' => ResourceLoaderStartUpModule::class ],
-
// Scripts managed by the local wiki (stored in the MediaWiki namespace)
'site' => [ 'class' => ResourceLoaderSiteModule::class ],
'site.styles' => [ 'class' => ResourceLoaderSiteStylesModule::class ],