MediaWiki REL1_31
ApiTestContext.php
Go to the documentation of this file.
1<?php
2
4
12 public function newTestContext( WebRequest $request, User $user = null ) {
13 $context = new DerivativeContext( $this );
14 $context->setRequest( $request );
15 if ( $user !== null ) {
16 $context->setUser( $user );
17 }
18
19 return $context;
20 }
21}
newTestContext(WebRequest $request, User $user=null)
Returns a DerivativeContext with the request variables in place.
An IContextSource implementation which will inherit context from another source but allow individual ...
Group all the pieces relevant to the context of a request into one instance.
WebRequest $request
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
Definition User.php:53
The WebRequest class encapsulates getting at data passed in the URL or via a POSTed form stripping il...
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext $context
Definition hooks.txt:2811