16 'enwiki' =>
'http://en.example.org',
17 'ruwiki' =>
'//ru.example.org',
18 'nopathwiki' =>
'//nopath.example.org',
22 'ruwiki' =>
'/wiki/$1',
25 $conf->suffixes = [
'wiki' ];
35 $enwiki =
new WikiReference(
'http://en.example.org',
'/w/$1' );
36 $ruwiki =
new WikiReference(
'//ru.example.org',
'/wiki/$1' );
39 $nlwiki =
new WikiReference(
'https://nl.wikipedia.org',
'/wiki/$1' );
41 $enwiktionary =
new WikiReference(
'https://en.wiktionary.org',
'/wiki/$1' );
44 'unknown' => [ null,
'xyzzy' ],
45 'enwiki (wgConf)' => [ $enwiki,
'enwiki' ],
46 'ruwiki (wgConf)' => [ $ruwiki,
'ruwiki' ],
47 'nlwiki (sites)' => [ $nlwiki,
'nlwiki',
false ],
48 'enwiktionary (sites)' => [ $enwiktionary,
'enwiktionary',
false ],
49 'non MediaWiki site' => [ null,
'spam',
false ],
50 'boguswiki' => [ null,
'boguswiki' ],
51 'nopathwiki' => [ null,
'nopathwiki' ],
58 public function testGetWiki( $expected, $wikiId, $useWgConf =
true ) {
70 'unknown' => [
'xyzzy',
'xyzzy' ],
71 'enwiki' => [
'en.example.org',
'enwiki' ],
72 'ruwiki' => [
'ru.example.org',
'ruwiki' ],
73 'enwiktionary (sites)' => [
'en.wiktionary.org',
'enwiktionary' ],
86 'unknown' => [
false,
'xyzzy',
'Foo' ],
88 '<a class="external" rel="nofollow" ' .
89 'href="http://en.example.org/w/Foo">Foo</a>',
94 '<a class="external" rel="nofollow" ' .
95 'href="//ru.example.org/wiki/%D0%A4%D1%83">вар</a>',
100 'enwiktionary (sites)' => [
101 '<a class="external" rel="nofollow" ' .
102 'href="https://en.wiktionary.org/wiki/Kitten">Kittens!</a>',
122 'unknown' => [
false,
'xyzzy',
'Foo' ],
124 '<a class="external" rel="nofollow" ' .
125 'href="http://en.example.org/w/User:Foo">User:Foo</a>',
130 '<a class="external" rel="nofollow" ' .
131 'href="//ru.example.org/wiki/User:%D0%A4%D1%83">вар</a>',
136 'enwiktionary (sites)' => [
137 '<a class="external" rel="nofollow" ' .
138 'href="https://en.wiktionary.org/wiki/User:Dummy">Whatever</a>',
155 'unknown' => [
false,
'xyzzy',
'Foo' ],
156 'enwiki' => [
'http://en.example.org/w/Foo',
'enwiki',
'Foo' ],
157 'enwiktionary (sites)' => [
158 'https://en.wiktionary.org/wiki/Testme',
162 'ruwiki with fragment' => [
163 '//ru.example.org/wiki/%D0%A4%D1%83#%D0%B2%D0%B0%D1%80',
processing should stop and the error should be shown to the user * false
static foreignUserLink($wikiID, $user, $text=null)
Convenience to get a link to a user page on a foreign wiki.
static getWikiName($wikiID)
Convenience to get the wiki's display name.
static getForeignURL($wikiID, $page, $fragmentId=null)
Convenience to get a url to a page on a foreign wiki.
Reference to a locally-hosted wiki.
testMakeForeignLink($expected, $wikiId, $page, $text=null)
provideMakeForeignLink
static makeForeignLink($wikiID, $page, $text=null)
Convenience to get a link to a page on a foreign wiki.
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a local account $user
testGetWiki($expected, $wikiId, $useWgConf=true)
provideGetWiki
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
testGetForeignURL($expected, $wikiId, $page, $fragment=null)
provideGetForeignURL
testForeignUserLink($expected, $wikiId, $user, $text=null)
provideForeignUserLink
testGetWikiName($expected, $wikiId)
provideGetWikiName
static getWiki($wikiID)
Get a WikiReference object for $wikiID.
This is a class for holding configuration settings, particularly for multi-wiki sites.
static insertIntoDb()
Inserts sites into the database for the unit tests that need them.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached $page