return;
}
$dbr = wfGetDB( DB_REPLICA );
- $skin = $context->getSkin();
$lang = $context->getLanguage();
// Batched version of ResourceLoaderModule::getFileDependencies
- $vary = "$skin|$lang";
+ $vary = ResourceLoaderModule::getVary( $context );
$res = $dbr->select( 'module_deps', [ 'md_module', 'md_deps' ], [
'md_module' => $moduleNames,
'md_skin' => $vary,
$states[$name] = 'missing';
}
- // Generate output
- $isRaw = false;
-
$filter = $context->getOnly() === 'styles' ? 'minify-css' : 'minify-js';
foreach ( $modules as $name => $module ) {
$states[$name] = 'error';
unset( $modules[$name] );
}
- $isRaw |= $module->isRaw();
}
// Update module states
- if ( $context->shouldIncludeScripts() && !$context->getRaw() && !$isRaw ) {
- if ( count( $modules ) && $context->getOnly() === 'scripts' ) {
+ if ( $context->shouldIncludeScripts() && !$context->getRaw() ) {
+ if ( $modules && $context->getOnly() === 'scripts' ) {
// Set the state of modules loaded as only scripts to ready as
// they don't have an mw.loader.implement wrapper that sets the state
foreach ( $modules as $name => $module ) {
}
// Set the state of modules we didn't respond to with mw.loader.implement
- if ( count( $states ) ) {
+ if ( $states ) {
$stateScript = self::makeLoaderStateScript( $states );
if ( !$context->getDebug() ) {
$stateScript = self::filter( 'minify-js', $stateScript );
// match the defaults assumed by ResourceLoaderContext.
// Note: This relies on the defaults either being insignificant or forever constant,
// as otherwise cached urls could change in meaning when the defaults change.
- if ( $lang !== 'qqx' ) {
+ if ( $lang !== ResourceLoaderContext::DEFAULT_LANG ) {
$query['lang'] = $lang;
}
- if ( $skin !== 'fallback' ) {
+ if ( $skin !== ResourceLoaderContext::DEFAULT_SKIN ) {
$query['skin'] = $skin;
}
if ( $debug === true ) {