$this->user = $request->getRawVal( 'user' );
$this->debug = $request->getFuzzyBool(
'debug',
- $resourceLoader->getConfig()->get( 'ResourceLoaderDebug' )
+ $this->getConfig()->get( 'ResourceLoaderDebug' )
);
$this->only = $request->getRawVal( 'only', null );
$this->version = $request->getRawVal( 'version', null );
$skinnames = Skin::getSkinNames();
// If no skin is specified, or we don't recognize the skin, use the default skin
if ( !$this->skin || !isset( $skinnames[$this->skin] ) ) {
- $this->skin = $resourceLoader->getConfig()->get( 'DefaultSkin' );
+ $this->skin = $this->getConfig()->get( 'DefaultSkin' );
}
}
return $this->resourceLoader;
}
+ /**
+ * @return Config
+ */
+ public function getConfig() {
+ return $this->getResourceLoader()->getConfig();
+ }
+
/**
* @return WebRequest
*/
$lang = $this->getRequest()->getRawVal( 'lang', '' );
// Stricter version of RequestContext::sanitizeLangCode()
if ( !Language::isValidBuiltInCode( $lang ) ) {
- $lang = $this->getResourceLoader()->getConfig()->get( 'LanguageCode' );
+ $lang = $this->getConfig()->get( 'LanguageCode' );
}
$this->language = $lang;
}
* @return Message
*/
public function msg( $key ) {
- return call_user_func_array( 'wfMessage', func_get_args() )
+ return wfMessage( ...func_get_args() )
->inLanguage( $this->getLanguage() )
// Use a dummy title because there is no real title
// for this endpoint, and the cache won't vary on it
return $this->imageObj;
}
+ /**
+ * Return the replaced-content mapping callback
+ *
+ * When editing a page that's used to generate the scripts or styles of a
+ * ResourceLoaderWikiModule, a preview should use the to-be-saved version of
+ * the page rather than the current version in the database. A context
+ * supporting such previews should return a callback to return these
+ * mappings here.
+ *
+ * @since 1.32
+ * @return callable|null Signature is `Content|null func( Title $t )`
+ */
+ public function getContentOverrideCallback() {
+ return null;
+ }
+
/**
* @return bool
*/