Go to the documentation of this file.
71 $this->modules =
$modules ? ResourceLoader::expandModuleNames(
$modules ) : [];
75 $this->debug =
$request->getRawVal(
'debug' ) ===
'true';
76 $this->only =
$request->getRawVal(
'only',
null );
78 $this->raw =
$request->getFuzzyBool(
'raw' );
81 $this->image =
$request->getRawVal(
'image' );
82 $this->variant =
$request->getRawVal(
'variant' );
85 $this->skin =
$request->getRawVal(
'skin' );
88 if ( !$this->skin || !isset( $skinnames[$this->skin] ) ) {
89 $this->skin = $this->
getConfig()->get(
'DefaultSkin' );
103 return ResourceLoader::expandModuleNames(
$modules );
121 return new self(
new ResourceLoader(
122 MediaWikiServices::getInstance()->getMainConfig(),
123 LoggerFactory::getInstance(
'resourceloader' )
184 if ( $this->direction ===
null ) {
185 $this->direction = $this->
getRequest()->getRawVal(
'dir' );
186 if ( !$this->direction ) {
217 public function msg( $key ) {
233 if ( $this->userObj ===
null ) {
240 $this->userObj =
new User;
305 if ( $this->imageObj ===
null ) {
306 $this->imageObj =
false;
308 if ( !$this->image ) {
322 $image = $module->getImage( $this->image, $this );
353 return $this->
getOnly() ===
null || $this->
getOnly() ===
'scripts';
360 return $this->
getOnly() ===
null || $this->
getOnly() ===
'styles';
367 return $this->
getOnly() ===
null;
382 if ( !isset( $this->hash ) ) {
383 $this->hash = implode(
'|', [
Object passed around to modules which contains information about the state of a specific loader reque...
WebRequest clone which takes values from a provided array.
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
static newDummyContext()
Return a dummy ResourceLoaderContext object suitable for passing into things that don't "really" need...
if(!isset( $args[0])) $lang
msg( $key)
Get a Message object with context set.
getContentOverrideCallback()
Return the replaced-content mapping callback.
static expandModuleNames( $modules)
Reverse the process done by ResourceLoader::makePackedModulesString().
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException' returning false will NOT prevent logging a wrapping ErrorException create2 Corresponds to logging log_action database field and which is displayed in the UI similar to $comment or false if none Defaults to false if not set multiOccurrence Can this option be passed multiple times Defaults to false if not set this hook should only be used to add variables that depend on the current page request
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Interface for localizing messages in MediaWiki.
static getSkinNames()
Fetch the set of available skins.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such and we might be restricted by PHP settings such as safe mode or open_basedir We cannot assume that the software even has read access anywhere useful Many shared hosts run all users web applications under the same user
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
getRawVal( $name, $default=null)
Fetch a scalar from the input without normalization, or return $default if it's not set.
static isValidBuiltInCode( $code)
Returns true if a language code is of a valid form for the purposes of internal customisation of Medi...
__construct(ResourceLoader $resourceLoader, WebRequest $request)
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two distribute and or modify the software for each author s protection and we want to make certain that everyone understands that there is no warranty for this free software If the software is modified by someone else and passed we want its recipients to know that what they have is not the so that any problems introduced by others will not reflect on the original authors reputations any free program is threatened constantly by software patents We wish to avoid the danger that redistributors of a free program will individually obtain patent in effect making the program proprietary To prevent we have made it clear that any patent must be licensed for everyone s free use or not licensed at all The precise terms and conditions for distribution and modification follow GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR DISTRIBUTION AND MODIFICATION This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License The refers to any such program or and a work based on the Program means either the Program or any derivative work under copyright a work containing the Program or a portion of either verbatim or with modifications and or translated into another language(Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying
if the prop value should be in the metadata multi language array format
The WebRequest class encapsulates getting at data passed in the URL or via a POSTed form stripping il...
MediaWiki Logger LoggerFactory implements a PSR[0] compatible message logging system Named Psr Log LoggerInterface instances can be obtained from the MediaWiki Logger LoggerFactory::getInstance() static method. MediaWiki\Logger\LoggerFactory expects a class implementing the MediaWiki\Logger\Spi interface to act as a factory for new Psr\Log\LoggerInterface instances. The "Spi" in MediaWiki\Logger\Spi stands for "service provider interface". An SPI is an API intended to be implemented or extended by a third party. This software design pattern is intended to enable framework extension and replaceable components. It is specifically used in the MediaWiki\Logger\LoggerFactory service to allow alternate PSR-3 logging implementations to be easily integrated with MediaWiki. The service provider interface allows the backend logging library to be implemented in multiple ways. The $wgMWLoggerDefaultSpi global provides the classname of the default MediaWiki\Logger\Spi implementation to be loaded at runtime. This can either be the name of a class implementing the MediaWiki\Logger\Spi with a zero argument const ructor or a callable that will return an MediaWiki\Logger\Spi instance. Alternately the MediaWiki\Logger\LoggerFactory MediaWiki Logger LoggerFactory
static factory( $code)
Get a cached or new language object for a given language code.
getHash()
All factors that uniquely identify this request, except 'modules'.
getImageObj()
If this is a request for an image, get the ResourceLoaderImage object.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency MediaWikiServices
getUserObj()
Get the possibly-cached User object for the specified username.
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation use $formDescriptor instead default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "<
ResourceLoader module for generated and embedded images.
this hook is for auditing only or null if authentication failed before getting that far $username