<?php
/**
- * Module for resource loader initialization.
+ * Module for ResourceLoader initialization.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
'wgUrlProtocols' => wfUrlProtocols(),
'wgArticlePath' => $conf->get( 'ArticlePath' ),
'wgScriptPath' => $conf->get( 'ScriptPath' ),
- 'wgScriptExtension' => $conf->get( 'ScriptExtension' ),
+ 'wgScriptExtension' => '.php',
'wgScript' => wfScript(),
'wgSearchType' => $conf->get( 'SearchType' ),
'wgVariantArticlePath' => $conf->get( 'VariantArticlePath' ),
'wgResourceLoaderStorageVersion' => $conf->get( 'ResourceLoaderStorageVersion' ),
'wgResourceLoaderStorageEnabled' => $conf->get( 'ResourceLoaderStorageEnabled' ),
'wgResourceLoaderLegacyModules' => self::getLegacyModules(),
+ 'wgForeignUploadTargets' => $conf->get( 'ForeignUploadTargets' ),
+ 'wgEnableUploads' => $conf->get( 'EnableUploads' ),
);
Hooks::run( 'ResourceLoaderGetConfigVars', array( &$vars ) );
* - array 'dependencies'
* - string|null 'group'
* - string 'source'
- * - string|false 'loader'
*/
public static function compileUnresolvedDependencies( array &$registryData ) {
foreach ( $registryData as $name => &$data ) {
- if ( $data['loader'] !== false ) {
- continue;
- }
$dependencies = $data['dependencies'];
foreach ( $data['dependencies'] as $dependency ) {
$implicitDependencies = self::getImplicitDependencies( $registryData, $dependency );
$resourceLoader = $context->getResourceLoader();
$target = $context->getRequest()->getVal( 'target', 'desktop' );
- // Bypass target filter if this request is from a unit test context. To prevent misuse in
- // production, this is only allowed if testing is enabled server-side.
+ // Bypass target filter if this request is Special:JavaScriptTest.
+ // To prevent misuse in production, this is only allowed if testing is enabled server-side.
$byPassTargetFilter = $this->getConfig()->get( 'EnableJavaScriptTest' ) && $target === 'test';
$out = '';
$skipFunction = $module->getSkipFunction();
if ( $skipFunction !== null && !ResourceLoader::inDebugMode() ) {
- $skipFunction = $resourceLoader->filter( 'minify-js',
- $skipFunction,
- // There will potentially be lots of these little strings in the registrations
- // manifest, we don't want to blow up the startup module with
- // "/* cache key: ... */" all over it.
- /* cacheReport = */ false
- );
+ $skipFunction = ResourceLoader::filter( 'minify-js', $skipFunction );
}
$registryData[$name] = array(
'dependencies' => $module->getDependencies( $context ),
'group' => $module->getGroup(),
'source' => $module->getSource(),
- 'loader' => $module->getLoaderScript(),
'skip' => $skipFunction,
);
}
// Register sources
$out .= ResourceLoader::makeLoaderSourcesScript( $resourceLoader->getSources() );
- // Concatenate module loader scripts and figure out the different call
- // signatures for mw.loader.register
+ // Figure out the different call signatures for mw.loader.register
$registrations = array();
foreach ( $registryData as $name => $data ) {
- if ( $data['loader'] !== false ) {
- $out .= ResourceLoader::makeCustomLoaderScript(
- $name,
- $data['version'],
- $data['dependencies'],
- $data['group'],
- $data['source'],
- $data['loader']
- );
- continue;
- }
-
// Call mw.loader.register(name, version, dependencies, group, source, skip)
$registrations[] = array(
$name,