31 $importer->doImport();
33 $this->assertTrue(
$title->exists() );
43 <mediawiki xmlns=
"http://www.mediawiki.org/xml/export-0.10/" xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=
"http://www.mediawiki.org/xml/export-0.10/ http://www.mediawiki.org/xml/export-0.10.xsd" version=
"0.10" xml:lang=
"en">
44 <
page unknown=
"123" dontknow=
"533">
46 <unknowntag>Should be ignored</unknowntag>
48 <
id unknown=
"123" dontknow=
"533">14</
id>
50 <
id unknown=
"123" dontknow=
"533">15</
id>
51 <unknowntag>Should be ignored</unknowntag>
52 <timestamp>2016-01-03T11:18:43Z</timestamp>
54 <unknowntag>Should be ignored</unknowntag>
55 <username unknown=
"123" dontknow=
"533">Admin</username>
58 <model>wikitext</model>
60 <
text xml:space=
"preserve" bytes=
"0">noitazinagro tseb eht si ikiWaideM</
text>
61 <sha1>phoiac9h4m842xq45sp7s6u21eteeq1</sha1>
62 <unknowntag>Should be ignored</unknowntag>
65 <unknowntag>Should be ignored</unknowntag>
69 'noitazinagro tseb eht si ikiWaideM',
87 $sRevCount, $pageInfo )
use ( &$redirect ) {
88 if ( array_key_exists(
'redirect', $pageInfo ) ) {
89 $redirect = $pageInfo[
'redirect'];
97 $importer->setPageOutCallback( $callback );
98 $importer->doImport();
100 $this->assertEquals( $redirectTitle, $redirect );
108 <mediawiki xmlns=
"http://www.mediawiki.org/xml/export-0.10/" xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=
"http://www.mediawiki.org/xml/export-0.10/ http://www.mediawiki.org/xml/export-0.10.xsd" version=
"0.10" xml:lang=
"en">
116 <timestamp>2014-05-27T10:00:00Z</timestamp>
118 <username>Admin</username>
121 <comment>Admin moved
page [[Test]] to [[Test22]]</comment>
122 <model>wikitext</model>
124 <
text xml:space=
"preserve" bytes=
"20">#REDIRECT [[Test22]]</
text>
125 <sha1>tq456o9x3abm7r9ozi6km8yrbbc56o6</sha1>
135 <mediawiki xmlns=
"http://www.mediawiki.org/xml/export-0.9/" xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=
"http://www.mediawiki.org/xml/export-0.9/ http://www.mediawiki.org/xml/export-0.9.xsd" version=
"0.9" xml:lang=
"en">
142 <timestamp>2014-05-27T11:00:00Z</timestamp>
144 <username>Admin</username>
147 <
text xml:space=
"preserve" bytes=
"4">Abcd</
text>
148 <sha1>n7uomjq96szt60fy5w3x7ahf7q8m8rh</sha1>
149 <model>wikitext</model>
171 $importNamespaces = null;
172 $callback =
function (
array $siteinfo, $innerImporter )
use ( &$importNamespaces ) {
173 $importNamespaces = $siteinfo[
'_namespaces'];
180 $importer->setSiteInfoCallback( $callback );
181 $importer->doImport();
183 $this->assertEquals( $importNamespaces,
$namespaces );
191 <mediawiki xmlns=
"http://www.mediawiki.org/xml/export-0.10/" xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=
"http://www.mediawiki.org/xml/export-0.10/ http://www.mediawiki.org/xml/export-0.10.xsd" version=
"0.10" xml:lang=
"en">
194 <
namespace key=
"-2" case=
"first-letter">Media</
namespace>
195 <
namespace key=
"-1" case=
"first-letter">
Special</
namespace>
196 <
namespace key=
"0" case=
"first-letter" />
197 <
namespace key=
"1" case=
"first-letter">Talk</
namespace>
198 <
namespace key=
"2" case=
"first-letter">
User</
namespace>
199 <
namespace key=
"3" case=
"first-letter">
User talk</
namespace>
200 <
namespace key=
"100" case=
"first-letter">Portal</
namespace>
201 <
namespace key=
"101" case=
"first-letter">Portal talk</
namespace>
215 '101' =>
'Portal talk',
static factory(Title $title)
Create a WikiPage object of the appropriate class for the given title.
the array() calling protocol came about after MediaWiki 1.4rc1.
to move a page</td >< td > &*You are moving the page across namespaces
XML file reader for the page data importer.
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
testSiteInfoContainsNamespaces($xml, $namespaces)
WikiImporter::handleSiteInfo getSiteInfoXML.
testUnknownXMLTags($xml, $text, $title)
WikiImporter getUnknownTagsXML.
Used for importing XML dumps where the content of the dump is in a string.
static newFromText($text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
Represents a title within MediaWiki.
Prior to maintenance scripts were a hodgepodge of code that had no cohesion or formal method of action Beginning maintenance scripts have been cleaned up to use a unified class Directory structure How to run a script How to write your own DIRECTORY STRUCTURE The maintenance directory of a MediaWiki installation contains several all of which have unique purposes HOW TO RUN A SCRIPT Ridiculously just call php someScript php that s in the top level maintenance directory if not default wiki
The User object encapsulates all of the user-specific settings (user_id, name, rights, email address, options, last login time).
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add in any and then calling but I prefer the flexibility This should also do the output encoding The system allocates a global one in $wgOut Title Represents the title of an and does all the work of translating among various forms such as plain database key
Test class for Import methods.
Allows to change the fields on the form that will be generated are created Can be used to omit specific feeds from being outputted You must not use this hook to add use OutputPage::addFeedLink() instead.&$feedLinks conditions will AND in the final query as a Content object as a Content object $title
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
namespace and then decline to actually register it & $namespaces
static getDefaultInstance()
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
to move a page</td >< td > &*You are moving the page across *A non empty talk page already exists under the new or *You uncheck the box below In those you will have to move or merge the page manually if desired</td >< td > be sure to &You are responsible for making sure that links continue to point where they are supposed to go Note that the page will &a page at the new title
testHandlePageContainsRedirect($xml, $redirectTitle)
WikiImporter::handlePage getRedirectXML.
This list may contain false positives That usually means there is additional text with links below the first Each row contains links to the first and second redirect
A simple, immutable structure to hold the title of a page on a foreign MediaWiki installation.
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 one of or reset my talk page
if the prop value should be in the metadata multi language array format