76 $this->modules =
$modules ? ResourceLoader::expandModuleNames(
$modules ) : [];
79 $this->user =
$request->getRawVal(
'user' );
80 $this->debug =
$request->getRawVal(
'debug' ) ===
'true';
81 $this->only =
$request->getRawVal(
'only' );
82 $this->version =
$request->getRawVal(
'version' );
83 $this->raw =
$request->getFuzzyBool(
'raw' );
86 $this->image =
$request->getRawVal(
'image' );
87 $this->variant =
$request->getRawVal(
'variant' );
88 $this->format =
$request->getRawVal(
'format' );
90 $this->skin =
$request->getRawVal(
'skin' );
91 $skinnames = Skin::getSkinNames();
92 if ( !$this->skin || !isset( $skinnames[$this->skin] ) ) {
116 MediaWikiServices::getInstance()->getMainConfig(),
117 LoggerFactory::getInstance(
'resourceloader' )
167 if ( $this->language ===
null ) {
172 if ( !Language::isValidBuiltInCode(
$lang ) ) {
177 $this->language =
$lang;
186 if ( $this->direction ===
null ) {
192 $this->direction = Language::factory( $this->
getLanguage() )->getDir();
221 public function msg( $key, ...$params ) {
227 ->title( Title::newFromText(
'Dwimmerlaik' ) );
237 if ( $this->userObj ===
null ) {
244 $this->userObj =
new User;
309 if ( $this->imageObj ===
null ) {
310 $this->imageObj =
false;
312 if ( !$this->image ) {
326 $image = $module->getImage( $this->image, $this );
357 return $this->
getOnly() ===
null || $this->
getOnly() ===
'scripts';
364 return $this->
getOnly() ===
null || $this->
getOnly() ===
'styles';
371 return $this->
getOnly() ===
null;
386 if ( !isset( $this->hash ) ) {
387 $this->hash = implode(
'|', [
413 if ( $this->
getLanguage() !== self::DEFAULT_LANG ) {
416 if ( $this->
getSkin() !== self::DEFAULT_SKIN ) {
417 $reqBase[
'skin'] = $this->
getSkin();
420 $reqBase[
'debug'] =
'true';
443 $jsonFlags = JSON_UNESCAPED_SLASHES |
444 JSON_UNESCAPED_UNICODE |
448 $jsonFlags |= JSON_PRETTY_PRINT;
450 return json_encode( $data, $jsonFlags );
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
WebRequest clone which takes values from a provided array.
Context object that contains information about the state of a specific ResourceLoader web request.
getReqBase()
Get the request base parameters, omitting any defaults.
ResourceLoaderImage false $imageObj
__construct(ResourceLoader $resourceLoader, WebRequest $request)
getImageObj()
If this is a request for an image, get the ResourceLoaderImage object.
getUserObj()
Get the possibly-cached User object for the specified username.
getHash()
All factors that uniquely identify this request, except 'modules'.
encodeJson( $data)
Wrapper around json_encode that avoids needless escapes, and pretty-prints in debug mode.
msg( $key,... $params)
Get a Message object with context set.
static newDummyContext()
Return a dummy ResourceLoaderContext object suitable for passing into things that don't "really" need...
getContentOverrideCallback()
Return the replaced-content mapping callback.
Module for generated and embedded images.
Class encapsulating an image used in a ResourceLoaderImageModule.
getModule()
Get name of the module this image belongs to.
ResourceLoader is a loading system for JavaScript and CSS resources.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
The WebRequest class encapsulates getting at data passed in the URL or via a POSTed form stripping il...
Interface for localizing messages in MediaWiki.
if(!isset( $args[0])) $lang