Go to the documentation of this file.
24 if ( $this->dump !==
null ) {
41 $this->assertEquals( $expected, $this->dump->prefetch( $page, $revision ),
42 "Prefetch of page $page revision $revision" );
117 $this->dump =
new BaseDump( $fname1 .
";" . $fname2 );
129 $this->dump =
new BaseDump( $fname1 .
";" . $fname2 .
";" . $fname3 );
138 $this->dump =
new BaseDump( $fname1 .
";" . $fname2 );
158 $header =
'<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.7/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.7/ http://www.mediawiki.org/xml/export-0.7.xsd" version="0.7" xml:lang="en">
160 <sitename>wikisvn</sitename>
161 <base>http://localhost/wiki-svn/index.php/Main_Page</base>
162 <generator>MediaWiki 1.21alpha</generator>
163 <case>first-letter</case>
165 <namespace key="-2" case="first-letter">Media</namespace>
166 <namespace key="-1" case="first-letter">Special</namespace>
167 <namespace key="0" case="first-letter" />
168 <namespace key="1" case="first-letter">Talk</namespace>
169 <namespace key="2" case="first-letter">User</namespace>
170 <namespace key="3" case="first-letter">User talk</namespace>
171 <namespace key="4" case="first-letter">Wikisvn</namespace>
172 <namespace key="5" case="first-letter">Wikisvn talk</namespace>
173 <namespace key="6" case="first-letter">File</namespace>
174 <namespace key="7" case="first-letter">File talk</namespace>
175 <namespace key="8" case="first-letter">MediaWiki</namespace>
176 <namespace key="9" case="first-letter">MediaWiki talk</namespace>
177 <namespace key="10" case="first-letter">Template</namespace>
178 <namespace key="11" case="first-letter">Template talk</namespace>
179 <namespace key="12" case="first-letter">Help</namespace>
180 <namespace key="13" case="first-letter">Help talk</namespace>
181 <namespace key="14" case="first-letter">Category</namespace>
182 <namespace key="15" case="first-letter">Category talk</namespace>
188 $available_pages = [];
191 $available_pages[1] =
' <page>
192 <title>BackupDumperTestP1</title>
197 <timestamp>2012-04-01T16:46:05Z</timestamp>
201 <comment>BackupDumperTestP1Summary1</comment>
202 <sha1>0bolhl6ol7i6x0e7yq91gxgaan39j87</sha1>
203 <text xml:space="preserve">BackupDumperTestP1Text1</text>
204 <model name="wikitext">1</model>
205 <format mime="text/x-wiki">1</format>
210 $available_pages[2] =
' <page>
211 <title>BackupDumperTestP2</title>
216 <timestamp>2012-04-01T16:46:05Z</timestamp>
220 <comment>BackupDumperTestP2Summary1</comment>
221 <sha1>jprywrymfhysqllua29tj3sc7z39dl2</sha1>
222 <text xml:space="preserve">BackupDumperTestP2Text1</text>
223 <model name="wikitext">1</model>
224 <format mime="text/x-wiki">1</format>
228 <parentid>2</parentid>
229 <timestamp>2012-04-01T16:46:05Z</timestamp>
233 <comment>BackupDumperTestP2Summary4 extra</comment>
234 <sha1>6o1ciaxa6pybnqprmungwofc4lv00wv</sha1>
235 <text xml:space="preserve">BackupDumperTestP2Text4 some additional Text</text>
236 <model name="wikitext">1</model>
237 <format mime="text/x-wiki">1</format>
242 $available_pages[4] =
' <page>
243 <title>Talk:BackupDumperTestP1</title>
248 <timestamp>2012-04-01T16:46:05Z</timestamp>
252 <comment>Talk BackupDumperTestP1 Summary1</comment>
253 <sha1>nktofwzd0tl192k3zfepmlzxoax1lpe</sha1>
254 <model name="wikitext">1</model>
255 <format mime="text/x-wiki">1</format>
256 <text xml:space="preserve">Talk about BackupDumperTestP1 Text1</text>
262 $tail =
'</mediawiki>
267 foreach ( $requested_pages
as $i ) {
268 $this->assertTrue( array_key_exists( $i, $available_pages ),
269 "Check for availability of requested page " . $i );
274 $this->assertEquals( strlen(
$content ), file_put_contents(
Readahead helper for making large MediaWiki data dumps; reads in a previous XML dump to sequentially ...
testSynchronizePageMiss()
assertPrefetchEquals( $expected, $page, $revision)
asserts that a prefetch yields an expected string
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
BaseDump $dump
The BaseDump instance used within a test.
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
testSynchronizeSkipAcrossFile()
if(defined( 'MW_SETUP_CALLBACK')) $fname
Customization point after all loading (constants, functions, classes, DefaultSettings,...
testSynchronizePageMissAtStart()
testSynchronizeMissInWholeFirstFile()
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
testSequentialAcrossFiles()
testSynchronizeRevisionMissToRevision()
setUpPrefetch( $requested_pages=[1, 2, 4])
Constructs a temporary file that can be used for prefetching.
testSynchronizeRevisionMissToPage()
testSynchronizeRevisionMissAtStart()