28 ConfigFactory::getDefaultInstance()->makeConfig(
'main' )
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'];
95 ConfigFactory::getDefaultInstance()->makeConfig(
'main' )
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>
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'];
178 ConfigFactory::getDefaultInstance()->makeConfig(
'main' )
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',
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
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
to move a page</td >< td > &*You are moving the page across namespaces
A simple, immutable structure to hold the title of a page on a foreign MediaWiki installation.
Used for importing XML dumps where the content of the dump is in a string.
Test class for Import methods.
testSiteInfoContainsNamespaces( $xml, $namespaces)
WikiImporter::handleSiteInfo getSiteInfoXML.
testUnknownXMLTags( $xml, $text, $title)
WikiImporter getUnknownTagsXML.
testHandlePageContainsRedirect( $xml, $redirectTitle)
WikiImporter::handlePage getRedirectXML.
Represents a title within MediaWiki.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
XML file reader for the page data importer.
static factory(Title $title)
Create a WikiPage object of the appropriate class for the given 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
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
the array() calling protocol came about after MediaWiki 1.4rc1.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context the output can only depend on parameters provided to this hook not on global state indicating whether full HTML should be generated If generation of HTML may be but other information should still be present in the ParserOutput object to manipulate or replace but no entry for that model exists in $wgContentHandlers if desired whether it is OK to use $contentModel on $title Handler functions that modify $ok should generally return false to prevent further hooks from further modifying $ok inclusive false for true for descending in case the handler function wants to provide a converted Content object Note that $result getContentModel() must return $toModel. 'CustomEditor' $rcid is used in generating this variable which contains information about the new such as the revision s whether the revision was marked as a minor edit or etc which include things like revision author revision comment
namespace and then decline to actually register it & $namespaces
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context the output can only depend on parameters provided to this hook not on global state indicating whether full HTML should be generated If generation of HTML may be but other information should still be present in the ParserOutput object to manipulate or replace but no entry for that model exists in $wgContentHandlers if desired whether it is OK to use $contentModel on $title Handler functions that modify $ok should generally return false to prevent further hooks from further modifying $ok inclusive false for true for descending in case the handler function wants to provide a converted Content object Note that $result getContentModel() must return $toModel. 'CustomEditor' $rcid is used in generating this variable which contains information about the new revision
namespace and then decline to actually register it file or subcat img or subcat $title
if the prop value should be in the metadata multi language array format
namespace are movable Hooks may change this value to override the return value of MWNamespace::isMovable(). 'NewDifferenceEngine' 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
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
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