Go to the documentation of this file.
19 $page->getContext()->setOutput(
new OutputPage( $page->getContext() ) );
29 $cases[
'Empty request'] = [
'', [], [],
'!!', 200 ];
31 $cases[
'Only title specified'] = [
33 [
'target' =>
'Helsinki' ],
37 [
'Location' =>
'!.+!' ]
40 $cases[
'Accept only HTML'] = [
42 [
'target' =>
'Helsinki' ],
43 [
'Accept' =>
'text/HTML' ],
46 [
'Location' =>
'!Helsinki$!' ]
49 $cases[
'Accept only HTML with revid'] = [
52 'target' =>
'Helsinki',
55 [
'Accept' =>
'text/HTML' ],
58 [
'Location' =>
'!Helsinki(\?|&)oldid=4242!' ]
61 $cases[
'Nothing specified'] = [
67 [
'Location' =>
'!Helsinki&action=raw!' ]
70 $cases[
'Nothing specified'] = [
76 [
'Location' =>
'!Helsinki&action=raw!' ]
79 $cases[
'Invalid Accept header'] = [
82 [
'Accept' =>
'text/foobar' ],
107 array $expHeaders = []
110 $request->response()->header(
'Status: 200 OK',
true, 200 );
120 $this->assertEquals( $expCode,
$response->getStatusCode(),
"status code" );
121 $this->assertRegExp( $expRegExp,
$output,
"output" );
123 foreach ( $expHeaders
as $name => $exp ) {
125 $this->assertNotNull(
$value,
"header: $name" );
126 $this->assertInternalType(
'string',
$value,
"header: $name" );
127 $this->assertRegExp( $exp,
$value,
"header: $name" );
130 $this->assertEquals( $expCode,
$e->getStatusCode(),
"status code" );
131 $this->assertRegExp( $expRegExp,
$e->getHTML(),
"error output" );
138 $request->response()->header(
'Status: 200 OK',
true, 200 );
142 $this->assertContains(
143 "Content negotiation applies based on your client's Accept header.",
WebRequest clone which takes values from a provided array.
Request handler implementing a data interface for mediawiki pages.
Allows to change the fields on the form that will be generated $name
static configuration should be added through ResourceLoaderGetConfigVars instead can be used to get the real title after the basic globals have been set but before ordinary actions take place $output
Show an error that looks like an HTTP server error.
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
testSpecialPageWithoutParameters()
Base class for testing special pages.
Special page to act as an endpoint for accessing raw page data.
This class should be covered by a general architecture document which does not exist as of January 20...
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
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
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException' returning false will NOT prevent logging $e
executeSpecialPage( $subPage='', WebRequest $request=null, $language=null, User $user=null)
this hook is for auditing only $response
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 as
static factory( $code)
Get a cached or new language object for a given language code.
newSpecialPage()
Returns a new instance of the special page under test.
the array() calling protocol came about after MediaWiki 1.4rc1.
testExecute( $subpage, array $params, array $headers, $expRegExp, $expCode=200, array $expHeaders=[])
provideExecute