22 $this->interfaceTitle = Title::newFromText( __CLASS__ );
36 $this->fail(
"Test changed output buffer level: was {$this->obLevel}" .
37 "before test, but $obLevel after test."
60 $request->response()->header(
'Status: 200 OK',
true, 200 );
62 foreach ( $headers as $name =>
$value ) {
71 $output->setTitle( $this->interfaceTitle );
80 $cases[] = [
'', [], [],
'Invalid title', 400 ];
84 [
'target' =>
'Helsinki' ],
88 [
'Location' =>
'?title=Helsinki&action=raw' ]
92 foreach ( $cases as $c ) {
96 if (
isset( $case[1][
'target'] ) ) {
97 $case[0] .= $case[1][
'target'];
98 unset( $case[1][
'target'] );
101 $subpageCases[] =
$case;
108 [
'target' =>
'Helsinki' ],
109 [
'Accept' =>
'text/HTML' ],
112 [
'Location' =>
'/wiki/Helsinki' ]
118 'target' =>
'Helsinki',
119 'revision' =>
'4242',
121 [
'Accept' =>
'text/HTML' ],
124 [
'Location' =>
'?title=Helsinki&oldid=4242' ]
133 [
'Location' =>
'?title=Helsinki&action=raw' ]
140 [
'Accept' =>
'text/foobar' ],
141 'No matching format found',
148 [
'Accept' =>
'text/HTML' ],
156 [
'Accept' =>
'text/HTML' ],
164 [
'Accept' =>
'text/HTML' ],
172 [
'Accept' =>
'text/HTML' ],
175 [
'Location' =>
'/wiki/Helsinki' ]
181 [
'Accept' =>
'text/HTML' ],
184 [
'Location' =>
'/wiki/Helsinki' ]
190 [
'Accept' =>
'text/HTML' ],
193 [
'Location' =>
'/wiki/AC/DC' ]
213 $expectedOutput =
'',
214 $expectedStatusCode = 200,
215 array $expectedHeaders = []
230 if (
$output->getRedirect() !==
'' ) {
238 $this->
assertSame( $expectedOutput, $text,
'output' );
240 foreach ( $expectedHeaders as $name => $exp ) {
248 $this->
assertEquals( $expectedStatusCode,
$e->getStatusCode(),
'status code' );
257 $helsinki = Title::newFromText(
'Helsinki' );
259 'Accept Header of HTML' => [
261 [
'ACCEPT' =>
'text/html' ],
264 'Accept Header without weights' => [
266 [
'ACCEPT' =>
'*/*, text/html, text/x-wiki' ],
267 'Helsinki&action=raw'
269 'Accept Header with weights' => [
271 [
'ACCEPT' =>
'text/*; q=0.5, text/json; q=0.7, application/rdf+xml; q=0.8' ],
272 'Helsinki&action=raw'
274 'Accept Header accepting evertyhing and HTML' => [
276 [
'ACCEPT' =>
'text/html, */*' ],
277 'Helsinki&action=raw'
279 'No Accept Header' => [
282 'Helsinki&action=raw'
299 $expectedRedirectSuffix
309 $expectedRedirectSuffix,
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 and(2) offer you this license which gives you legal permission to copy
An IContextSource implementation which will inherit context from another source but allow individual ...
WebRequest clone which takes values from a provided array.
Show an error that looks like an HTTP server error.
This class should be covered by a general architecture document which does not exist as of January 20...
PageDataRequestHandler PageData.
testHandleRequest( $subpage, array $params, array $headers, $expectedOutput='', $expectedStatusCode=200, array $expectedHeaders=[])
handleRequestProvider
makeOutputPage(array $params, array $headers)
provideHttpContentNegotiation()
testHttpContentNegotiation(Title $title, array $headers, $expectedRedirectSuffix)
provideHttpContentNegotiation
Request handler implementing a data interface for mediawiki pages.
Represents a title within MediaWiki.
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 $request
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not it can be in the form of< username >< more info > e g for bot passwords intended to be added to log contexts Fields it might only if the login was with a bot password it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable modifiable after all normalizations have been except for the $wgMaxImageArea check set to true or false to override the $wgMaxImageArea check result gives extension the possibility to transform it themselves $handler
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
this hook is for auditing only $response
static configuration should be added through ResourceLoaderGetConfigVars instead can be used to get the real title e g db for database replication lag or jobqueue for job queue size converted to pseudo seconds It is possible to add more fields and they will be returned to the user in the API response after the basic globals have been set but before ordinary actions take place $output
returning false will NOT prevent logging $e
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))