* of a specific loader request.
*/
class ResourceLoaderContext implements MessageLocalizer {
+ const DEFAULT_LANG = 'qqx';
+ const DEFAULT_SKIN = 'fallback';
+
protected $resourceLoader;
protected $request;
protected $logger;
// The 'skin' parameter is required. (Not yet enforced.)
// For requests without a known skin specified,
// use MediaWiki's 'fallback' skin for skin-specific decisions.
- $this->skin = 'fallback';
+ $this->skin = self::DEFAULT_SKIN;
}
}
if ( !Language::isValidBuiltInCode( $lang ) ) {
// The 'lang' parameter is required. (Not yet enforced.)
// If omitted, localise with the dummy language code.
- $lang = 'qqx';
+ $lang = self::DEFAULT_LANG;
}
$this->language = $lang;
}
}
return $this->hash;
}
+
+ /**
+ * Get the request base parameters, omitting any defaults.
+ *
+ * @internal For internal use by ResourceLoaderStartUpModule only
+ * @return array
+ */
+ public function getReqBase() {
+ $reqBase = [];
+ if ( $this->getLanguage() !== self::DEFAULT_LANG ) {
+ $reqBase['lang'] = $this->getLanguage();
+ }
+ if ( $this->getSkin() !== self::DEFAULT_SKIN ) {
+ $reqBase['skin'] = $this->getSkin();
+ }
+ if ( $this->getDebug() ) {
+ $reqBase['debug'] = 'true';
+ }
+ return $reqBase;
+ }
}