'wgCaseSensitiveNamespaces' => $caseSensitiveNamespaces,
'wgLegalTitleChars' => Title::convertByteClassToUnicodeClass( Title::legalChars() ),
'wgIllegalFileChars' => Title::convertByteClassToUnicodeClass( $illegalFileChars ),
- 'wgResourceLoaderStorageVersion' => $conf->get( 'ResourceLoaderStorageVersion' ),
'wgResourceLoaderStorageEnabled' => $conf->get( 'ResourceLoaderStorageEnabled' ),
'wgForeignUploadTargets' => $conf->get( 'ForeignUploadTargets' ),
'wgEnableUploads' => $conf->get( 'EnableUploads' ),
return $baseModules;
}
+ /**
+ * Get the key on which the JavaScript module cache (mw.loader.store) will vary.
+ *
+ * @param ResourceLoaderContext $context
+ * @return string String of concatenated vary conditions
+ */
+ private function getStoreVary( ResourceLoaderContext $context ) {
+ return implode( ':', [
+ $context->getSkin(),
+ $this->getConfig()->get( 'ResourceLoaderStorageVersion' ),
+ $context->getLanguage(),
+ ] );
+ }
+
/**
* @param ResourceLoaderContext $context
* @return string JavaScript code
'$VARS.maxQueryLength' => ResourceLoader::encodeJsonForScript(
$conf->get( 'ResourceLoaderMaxQueryLength' )
),
+ '$VARS.storeVary' => ResourceLoader::encodeJsonForScript( $this->getStoreVary( $context ) ),
];
$profilerStubs = [
'$CODE.profileExecuteStart();' => 'mw.loader.profiler.onExecuteStart( module );',
* @return {string} String of concatenated vary conditions.
*/
getVary: function () {
- return mw.config.get( 'skin' ) + ':' +
- mw.config.get( 'wgResourceLoaderStorageVersion' ) + ':' +
- mw.config.get( 'wgUserLanguage' );
+ return $VARS.storeVary;
},
/**