r100130 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100129‎ | r100130 | r100131 >
Date:17:31, 18 October 2011
Author:reedy
Status:ok
Tags:
Comment:
Remove some unused getting of non existent arguments

Documentation
Modified paths:
  • /trunk/phase3/maintenance/Maintenance.php (modified) (history)
  • /trunk/phase3/maintenance/backup.inc (modified) (history)
  • /trunk/phase3/maintenance/backupPrefetch.inc (modified) (history)
  • /trunk/phase3/maintenance/benchmarks/benchmarkPurge.php (modified) (history)
  • /trunk/phase3/maintenance/checkSyntax.php (modified) (history)
  • /trunk/phase3/maintenance/cleanupCaps.php (modified) (history)
  • /trunk/phase3/maintenance/cleanupImages.php (modified) (history)
  • /trunk/phase3/maintenance/cleanupUploadStash.php (modified) (history)
  • /trunk/phase3/maintenance/dumpTextPass.php (modified) (history)
  • /trunk/phase3/maintenance/fuzz-tester.php (modified) (history)
  • /trunk/phase3/maintenance/generateSitemap.php (modified) (history)
  • /trunk/phase3/maintenance/importDump.php (modified) (history)
  • /trunk/phase3/maintenance/jsparse.php (modified) (history)
  • /trunk/phase3/maintenance/mwdocgen.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/cleanupUploadStash.php
@@ -36,12 +36,12 @@
3737
3838 public function execute() {
3939 $repo = RepoGroup::singleton()->getLocalRepo();
40 -
 40+
4141 $dbr = $repo->getSlaveDb();
4242
4343 // how far back should this look for files to delete?
4444 global $wgUploadStashMaxAge;
45 -
 45+
4646 $this->output( "Getting list of files to clean up...\n" );
4747 $res = $dbr->select(
4848 'uploadstash',
@@ -49,10 +49,11 @@
5050 'us_timestamp < ' . $dbr->timestamp( time() - $wgUploadStashMaxAge ),
5151 __METHOD__
5252 );
53 -
 53+
5454 if( !is_object( $res ) || $res->numRows() == 0 ) {
 55+ $this->output( 'No files to cleanup!' );
5556 // nothing to do.
56 - return false;
 57+ return;
5758 }
5859
5960 // finish the read before starting writes.
@@ -60,13 +61,13 @@
6162 foreach($res as $row) {
6263 array_push( $keys, $row->us_key );
6364 }
64 -
 65+
6566 $this->output( 'Removing ' . count($keys) . " file(s)...\n" );
6667 // this could be done some other, more direct/efficient way, but using
6768 // UploadStash's own methods means it's less likely to fall accidentally
6869 // out-of-date someday
6970 $stash = new UploadStash( $repo );
70 -
 71+
7172 foreach( $keys as $key ) {
7273 $stash->getFile( $key, true );
7374 $stash->removeFileNoAuth( $key );
@@ -75,4 +76,4 @@
7677 }
7778
7879 $maintClass = "UploadStashCleanup";
79 -require_once( RUN_MAINTENANCE_IF_MAIN );
\ No newline at end of file
 80+require_once( RUN_MAINTENANCE_IF_MAIN );
Index: trunk/phase3/maintenance/checkSyntax.php
@@ -165,6 +165,8 @@
166166
167167 /**
168168 * Returns true if $file is of a type we can check
 169+ * @param $file string
 170+ * @return bool
169171 */
170172 private function isSuitableFile( $file ) {
171173 $file = str_replace( '\\', '/', $file );
@@ -181,6 +183,8 @@
182184
183185 /**
184186 * Add given path to file list, searching it in include path if needed
 187+ * @param $path string
 188+ * @return bool
185189 */
186190 private function addPath( $path ) {
187191 global $IP;
@@ -188,8 +192,10 @@
189193 }
190194
191195 /**
192 - * Add given file to file list, or, if it's a directory, add its content
193 - */
 196+ * Add given file to file list, or, if it's a directory, add its content
 197+ * @param $path string
 198+ * @return bool
 199+ */
194200 private function addFileOrDir( $path ) {
195201 if ( is_dir( $path ) ) {
196202 $this->addDirectoryContent( $path );
Index: trunk/phase3/maintenance/fuzz-tester.php
@@ -759,14 +759,18 @@
760760 static private $maxparams = 10;
761761
762762 /**
763 - ** Returns random number between finish and start.
 763+ * Returns random number between finish and start.
 764+ * @param $finish
 765+ * @param $start int
 766+ * @return int
764767 */
765768 static public function randnum( $finish, $start = 0 ) {
766769 return mt_rand( $start, $finish );
767770 }
768771
769772 /**
770 - ** Returns a mix of random text and random wiki syntax.
 773+ * Returns a mix of random text and random wiki syntax.
 774+ * @return string
771775 */
772776 static private function randstring() {
773777 $thestring = "";
@@ -796,18 +800,17 @@
797801 }
798802
799803 /**
800 - ** Returns either random text, or random wiki syntax, or random data from "ints",
801 - ** or random data from "other".
 804+ * Returns either random text, or random wiki syntax, or random data from "ints",
 805+ * or random data from "other".
 806+ * @return string
802807 */
803808 static private function makestring() {
804809 $what = wikiFuzz::randnum( 2 );
805810 if ( $what == 0 ) {
806811 return wikiFuzz::randstring();
807 - }
808 - elseif ( $what == 1 ) {
 812+ } elseif ( $what == 1 ) {
809813 return wikiFuzz::$ints[wikiFuzz::randnum( count( wikiFuzz::$ints ) - 1 )];
810 - }
811 - else {
 814+ } else {
812815 return wikiFuzz::$other[wikiFuzz::randnum( count( wikiFuzz::$other ) - 1 )];
813816 }
814817 }
@@ -815,6 +818,8 @@
816819 /**
817820 * Returns the matched character slash-escaped as in a C string
818821 * Helper for makeTitleSafe callback
 822+ * @param $matches
 823+ * @return atring
819824 */
820825 static private function stringEscape( $matches ) {
821826 return sprintf( "\\x%02x", ord( $matches[1] ) );
@@ -823,6 +828,8 @@
824829 /**
825830 ** Strips out the stuff that Mediawiki balks at in a page's title.
826831 ** Implementation copied/pasted from cleanupTable.inc & cleanupImages.php
 832+ * @param $str string
 833+ * @return string
827834 */
828835 static public function makeTitleSafe( $str ) {
829836 $legalTitleChars = " %!\"$&'()*,\\-.\\/0-9:;=?@A-Z\\\\^_`a-z~\\x80-\\xFF";
@@ -833,6 +840,7 @@
834841
835842 /**
836843 ** Returns a string of fuzz text.
 844+ * @return string
837845 */
838846 static private function loop() {
839847 switch ( wikiFuzz::randnum( 3 ) ) {
@@ -860,7 +868,8 @@
861869 }
862870
863871 /**
864 - ** Returns one of the three styles of random quote: ', ", and nothing.
 872+ * Returns one of the three styles of random quote: ', ", and nothing.
 873+ * @return string
865874 */
866875 static private function getRandQuote() {
867876 switch ( wikiFuzz::randnum( 3 ) ) {
@@ -872,6 +881,8 @@
873882
874883 /**
875884 ** Returns fuzz text, with the parameter indicating approximately how many lines of text you want.
 885+ * @param $maxtypes int
 886+ * @return string
876887 */
877888 static public function makeFuzz( $maxtypes = 2 ) {
878889 $page = "";
@@ -2174,9 +2185,10 @@
21752186 }
21762187 }
21772188
2178 -
21792189 /**
21802190 ** selects a page test to run.
 2191+ * @param $count
 2192+ * @return \api|\confirmEmail|\contributionsTest|\editPageTest|\imagelistTest|\imagepageTest|\ipblocklistTest|\listusersTest|\mimeSearchTest|\newImagesTest|\pageDeletion|\pageHistoryTest|\pageProtectionForm|\prefixindexTest|\profileInfo|\recentchangesTest|\redirectTest|\searchTest|\specialAllmessagesTest|\specialAllpagesTest|\specialBlockip|\specialBlockmeTest|\specialBooksourcesTest|\specialCategoryTree|\specialChemicalsourcesTest|\specialCitePageTest|\specialExportTest|\specialFilepathPageTest|\specialImportPageTest|\specialLinksearch|\specialLockdbPageTest|\specialLogTest|\specialMovePage|\specialNewpagesPageTest|\specialRenameuserPageTest|\specialRevisionDeletePageTest|\specialUndeletePageTest|\specialUnlockdbPageTest|\specialUserrights|\successfulUserLoginTest|\thumbTest|\trackbackTest|\userLoginTest|\viewPageTest|\watchlistTest
21812193 */
21822194 function selectPageTest( $count ) {
21832195
@@ -2248,11 +2260,12 @@
22492261 file_put_contents( $name, $data );
22502262 }
22512263
2252 -
22532264 /**
22542265 ** Returns a test as an experimental GET-to-POST URL.
22552266 ** This doesn't seem to always work though, and sometimes the output is too long
22562267 ** to be a valid GET URL, so we also save in other formats.
 2268+ * @param $test pageTest
 2269+ * @return string
22572270 */
22582271 function getAsURL( pageTest $test ) {
22592272 $used_question_mark = ( strpos( $test->getPagePath(), "?" ) !== false );
@@ -2304,11 +2317,12 @@
23052318 saveFile( $str, $filename );
23062319 }
23072320
2308 -
23092321 /**
2310 - ** Escapes a value so that it can be used on the command line by Curl.
2311 - ** Specifically, "<" and "@" need to be escaped if they are the first character,
2312 - ** otherwise curl interprets these as meaning that we want to insert a file.
 2322+ * Escapes a value so that it can be used on the command line by Curl.
 2323+ * Specifically, "<" and "@" need to be escaped if they are the first character,
 2324+ * otherwise curl interprets these as meaning that we want to insert a file.
 2325+ * @param $input_params array
 2326+ * @return array
23132327 */
23142328 function escapeForCurl( array $input_params ) {
23152329 $output_params = array();
@@ -2359,18 +2373,21 @@
23602374 saveTestData ( $test, $base_name . DATA_FILE );
23612375 }
23622376
2363 -
23642377 // ////////////////// MEDIAWIKI OUTPUT /////////////////////////
23652378
23662379 /**
2367 - ** Asks MediaWiki for the HTML output of a test.
 2380+ * Asks MediaWiki for the HTML output of a test.
 2381+ * @param $test pageTest
 2382+ * @return string
23682383 */
23692384 function wikiTestOutput( pageTest $test ) {
23702385
23712386 $ch = curl_init();
23722387
23732388 // specify the cookie, if required.
2374 - if ( $test->getCookie() ) curl_setopt( $ch, CURLOPT_COOKIE, $test->getCookie() );
 2389+ if ( $test->getCookie() ) {
 2390+ curl_setopt( $ch, CURLOPT_COOKIE, $test->getCookie() );
 2391+ }
23752392 curl_setopt( $ch, CURLOPT_POST, 1 ); // save form using a POST
23762393
23772394 $params = escapeForCurl( $test->getParams() );
@@ -2397,6 +2414,8 @@
23982415
23992416 /**
24002417 * Asks the validator whether this is valid HTML, or not.
 2418+ * @param $text string
 2419+ * @return array
24012420 */
24022421 function validateHTML( $text ) {
24032422
@@ -2425,9 +2444,10 @@
24262445 return array( $valid, $result );
24272446 }
24282447
2429 -
24302448 /**
2431 - ** Get tidy to check for no HTML errors in the output file (e.g. unescaped strings).
 2449+ * Get tidy to check for no HTML errors in the output file (e.g. unescaped strings).
 2450+ * @param $name
 2451+ * @return bool
24322452 */
24332453 function tidyCheckFile( $name ) {
24342454 $file = DIRECTORY . "/" . $name;
@@ -2446,10 +2466,10 @@
24472467 }
24482468 }
24492469
2450 -
24512470 /**
24522471 ** Returns whether or not an database error log file has changed in size since
24532472 ** the last time this was run. This is used to tell if a test caused a DB error.
 2473+ * @return bool
24542474 */
24552475 function dbErrorLogged() {
24562476 static $filesize;
@@ -2477,8 +2497,12 @@
24782498 // //////////////// TOP-LEVEL PROBLEM-FINDING FUNCTION ////////////////////////
24792499
24802500 /**
2481 - ** takes a page test, and runs it and tests it for problems in the output.
2482 - ** Returns: False on finding a problem, or True on no problems being found.
 2501+ * takes a page test, and runs it and tests it for problems in the output.
 2502+ * Returns: False on finding a problem, or True on no problems being found.
 2503+ * @param $test pageTest
 2504+ * @param $testname
 2505+ * @param $can_overwrite bool
 2506+ * @return bool
24832507 */
24842508 function runWikiTest( pageTest $test, &$testname, $can_overwrite = false ) {
24852509
Index: trunk/phase3/maintenance/mwdocgen.php
@@ -89,6 +89,7 @@
9090 /**
9191 * Read a line from the shell
9292 * @param $prompt String
 93+ * @return string
9394 */
9495 function readaline( $prompt = '' ) {
9596 print $prompt;
@@ -151,6 +152,7 @@
152153 * @param $exclude String: Additionals path regex to exclude
153154 * @param $exclude_patterns String: Additionals path regex to exclude
154155 * (LocalSettings.php, AdminSettings.php, .svn and .git directories are always excluded)
 156+ * @return string
155157 */
156158 function generateConfigFile( $doxygenTemplate, $outputDirectory, $stripFromPath, $currentVersion, $svnstat, $input, $exclude, $exclude_patterns ) {
157159
Index: trunk/phase3/maintenance/generateSitemap.php
@@ -188,6 +188,9 @@
189189
190190 // Custom priorities
191191 if ( $wgSitemapNamespacesPriorities !== false ) {
 192+ /**
 193+ * @var $wgSitemapNamespacesPriorities array
 194+ */
192195 foreach ( $wgSitemapNamespacesPriorities as $namespace => $priority ) {
193196 $float = floatval( $priority );
194197 if ( $float > 1.0 ) {
@@ -202,6 +205,8 @@
203206
204207 /**
205208 * Create directory if it does not exist and return pathname with a trailing slash
 209+ * @param $fspath string
 210+ * @return null|string
206211 */
207212 private static function init_path( $fspath ) {
208213 if ( !isset( $fspath ) ) {
Index: trunk/phase3/maintenance/jsparse.php
@@ -32,7 +32,6 @@
3333 }
3434
3535 public function execute() {
36 - $iterations = $this->getOption( 'i', 100 );
3736 if ( $this->hasArg() ) {
3837 $files = $this->mArgs;
3938 } else {
Index: trunk/phase3/maintenance/backup.inc
@@ -252,6 +252,7 @@
253253 * @todo Fixme: the --server parameter is currently not respected, as it
254254 * doesn't seem terribly easy to ask the load balancer for a particular
255255 * connection by name.
 256+ * @return DatabaseBase
256257 */
257258 function backupDb() {
258259 $this->lb = wfGetLBFactory()->newMainLB();
Index: trunk/phase3/maintenance/importDump.php
@@ -57,7 +57,7 @@
5858 $this->stderr = fopen( "php://stderr", "wt" );
5959 $this->addOption( 'report',
6060 'Report position and speed after every n pages processed', false, true );
61 - $this->addOption( 'namespaces',
 61+ $this->addOption( 'namespaces',
6262 'Import only the pages from namespaces belonging to the list of ' .
6363 'pipe-separated namespace names or namespace indexes', false, true );
6464 $this->addOption( 'dry-run', 'Parse dump without actually importing pages' );
@@ -154,10 +154,14 @@
155155 }
156156 }
157157
 158+ /**
 159+ * @param $revision Revision
 160+ * @return bool
 161+ */
158162 function handleUpload( $revision ) {
159163 if ( $this->uploads ) {
160164 if ( $this->skippedNamespace( $revision ) ) {
161 - return;
 165+ return ;
162166 }
163167 $this->uploadCount++;
164168 // $this->report();
Index: trunk/phase3/maintenance/cleanupImages.php
@@ -73,8 +73,9 @@
7474 if ( is_null( $title ) ) {
7575 $this->output( "page $source ($cleaned) is illegal.\n" );
7676 $safe = $this->buildSafeTitle( $cleaned );
77 - if ( $safe === false )
 77+ if ( $safe === false ) {
7878 return $this->progress( 0 );
 79+ }
7980 $this->pokeFile( $source, $safe );
8081 return $this->progress( 1 );
8182 }
@@ -86,7 +87,7 @@
8788 return $this->progress( 1 );
8889 }
8990
90 - $this->progress( 0 );
 91+ return $this->progress( 0 );
9192 }
9293
9394 /**
@@ -123,7 +124,8 @@
124125 $path = $this->filePath( $orig );
125126 if ( !file_exists( $path ) ) {
126127 $this->output( "missing file: $path\n" );
127 - return $this->killRow( $orig );
 128+ $this->killRow( $orig );
 129+ return;
128130 }
129131
130132 $db = wfGetDB( DB_MASTER );
@@ -138,7 +140,7 @@
139141 $version = 0;
140142 $final = $new;
141143 $conflict = ( $this->imageExists( $final, $db ) ||
142 - ( $this->pageExists( $orig, $db ) && $this->pageExists( $final, $db ) ) );
 144+ ( $this->pageExists( $orig, $db ) && $this->pageExists( $final, $db ) ) );
143145
144146 while ( $conflict ) {
145147 $this->output( "Rename conflicts with '$final'...\n" );
@@ -170,7 +172,7 @@
171173 $dir = dirname( $finalPath );
172174 if ( !file_exists( $dir ) ) {
173175 if ( !wfMkdirParents( $dir, null, __METHOD__ ) ) {
174 - $this->log( "RENAME FAILED, COULD NOT CREATE $dir" );
 176+ $this->output( "RENAME FAILED, COULD NOT CREATE $dir" );
175177 $db->rollback();
176178 return;
177179 }
Index: trunk/phase3/maintenance/Maintenance.php
@@ -526,6 +526,7 @@
527527 * to allow sysadmins to explicitly set one if they'd prefer to override
528528 * defaults (or for people using Suhosin which yells at you for trying
529529 * to disable the limits)
 530+ * @return string
530531 */
531532 public function memoryLimit() {
532533 $limit = $this->getOption( 'memory-limit', 'max' );
@@ -852,6 +853,9 @@
853854 $wgDBpassword = $wgDBadminpassword;
854855
855856 if ( $wgDBservers ) {
 857+ /**
 858+ * @var $wgDBservers array
 859+ */
856860 foreach ( $wgDBservers as $i => $server ) {
857861 $wgDBservers[$i]['user'] = $wgDBuser;
858862 $wgDBservers[$i]['password'] = $wgDBpassword;
@@ -980,6 +984,7 @@
981985
982986 /**
983987 * Get the maintenance directory.
 988+ * @return string
984989 */
985990 protected function getDir() {
986991 return dirname( __FILE__ );
@@ -1127,6 +1132,7 @@
11281133 * Update the searchindex table for a given pageid
11291134 * @param $dbw Database: a database write handle
11301135 * @param $pageId Integer: the page ID to update.
 1136+ * @return null|string
11311137 */
11321138 public function updateSearchIndexForPage( $dbw, $pageId ) {
11331139 // Get current revision
Index: trunk/phase3/maintenance/benchmarks/benchmarkPurge.php
@@ -54,6 +54,7 @@
5555 * to benchmark Squid response times.
5656 * @param $urls array A bunch of URLs to purge
5757 * @param $trials int How many times to run the test?
 58+ * @return string
5859 */
5960 private function benchSquid( $urls, $trials = 1 ) {
6061 $start = wfTime();
@@ -70,6 +71,7 @@
7172 /**
7273 * Get an array of randomUrl()'s.
7374 * @param $length int How many urls to add to the array
 75+ * @return array
7476 */
7577 private function randomUrlList( $length ) {
7678 $list = array();
@@ -82,6 +84,7 @@
8385 /**
8486 * Return a random URL of the wiki. Not necessarily an actual title in the
8587 * database, but at least a URL that looks like one.
 88+ * @return string
8689 */
8790 private function randomUrl() {
8891 global $wgServer, $wgArticlePath;
@@ -91,6 +94,7 @@
9295 /**
9396 * Create a random title string (not necessarily a Title object).
9497 * For use with randomUrl().
 98+ * @return string
9599 */
96100 private function randomTitle() {
97101 $str = '';
Index: trunk/phase3/maintenance/cleanupCaps.php
@@ -88,9 +88,8 @@
8989 return $this->processRow( $row );
9090 }
9191 }
92 - } else {
93 - $this->progress( 0 );
9492 }
 93+ return $this->progress( 0 );
9594 }
9695 }
9796
Index: trunk/phase3/maintenance/dumpTextPass.php
@@ -66,6 +66,11 @@
6767 var $checkpointJustWritten = false;
6868 var $checkpointFiles = array();
6969
 70+ /**
 71+ * @var DatabaseBase
 72+ */
 73+ protected $db;
 74+
7075 function initProgress( $history ) {
7176 parent::initProgress();
7277 $this->timeOfCheckpoint = $this->startTime;
@@ -169,7 +174,8 @@
170175 */
171176 function showReport() {
172177 if ( !$this->prefetch ) {
173 - return parent::showReport();
 178+ parent::showReport();
 179+ return;
174180 }
175181
176182 if ( $this->reporting ) {
@@ -186,8 +192,7 @@
187193 $etats = wfTimestamp( TS_DB, intval( $eta ) );
188194 if ( $this->fetchCount ) {
189195 $fetchRate = 100.0 * $this->prefetchCount / $this->fetchCount;
190 - }
191 - else {
 196+ } else {
192197 $fetchRate = '-';
193198 }
194199 $pageRate = $this->pageCount / $deltaAll;
@@ -201,8 +206,7 @@
202207 if ( $deltaPart ) {
203208 if ( $this->fetchCountLast ) {
204209 $fetchRatePart = 100.0 * $this->prefetchCountLast / $this->fetchCountLast;
205 - }
206 - else {
 210+ } else {
207211 $fetchRatePart = '-';
208212 }
209213 $pageRatePart = $this->pageCountPart / $deltaPart;
@@ -228,9 +232,9 @@
229233
230234 function checkIfTimeExceeded() {
231235 if ( $this->maxTimeAllowed && ( $this->lastTime - $this->timeOfCheckpoint > $this->maxTimeAllowed ) ) {
232 - return True;
 236+ return true;
233237 }
234 - return False;
 238+ return false;
235239 }
236240
237241 function finalOptionCheck() {
@@ -286,7 +290,7 @@
287291 // we wrote some stuff after last checkpoint that needs renamed
288292 if (file_exists($filenameList[0])) {
289293 $newFilenames = array();
290 - # we might have just written the header and footer and had no
 294+ # we might have just written the header and footer and had no
291295 # pages or revisions written... perhaps they were all deleted
292296 # there's no pageID 0 so we use that. the caller is responsible
293297 # for deciding what to do with a file containing only the
@@ -332,7 +336,6 @@
333337 }
334338
335339 private function doGetText( $id ) {
336 -
337340 $id = intval( $id );
338341 $this->failures = 0;
339342 $ex = new MWException( "Graceful storage failure" );
@@ -345,9 +348,9 @@
346349 $this->closeSpawn();
347350 $this->openSpawn();
348351 }
349 - $text = $this->getTextSpawned( $id );
 352+ $text = $this->getTextSpawned( $id );
350353 } else {
351 - $text = $this->getTextDbSafe( $id );
 354+ $text = $this->getTextDbSafe( $id );
352355 }
353356 if ( $text === false ) {
354357 $this->failures++;
@@ -359,11 +362,10 @@
360363 $this->failedTextRetrievals++;
361364 if ($this->failedTextRetrievals > $this->maxConsecutiveFailedTextRetrievals) {
362365 throw $ex;
363 - }
364 - else {
 366+ } else {
365367 // would be nice to return something better to the caller someday,
366368 // log what we know about the failure and about the revision
367 - return("");
 369+ return "";
368370 }
369371 } else {
370372 $this->progress( "Error $this->failures " .
@@ -373,16 +375,18 @@
374376 }
375377 } else {
376378 $this->failedTextRetrievals= 0;
377 - return( $text );
 379+ return $text;
378380 }
379381 }
380 -
 382+ return '';
381383 }
382384
383385 /**
384386 * Fetch a text revision from the database, retrying in case of failure.
385387 * This may survive some transitory errors by reconnecting, but
386388 * may not survive a long-term server outage.
 389+ *
 390+ * FIXME: WTF? Why is it using a loop and then returning unconditionally?
387391 */
388392 private function getTextDbSafe( $id ) {
389393 while ( true ) {
@@ -397,6 +401,8 @@
398402
399403 /**
400404 * May throw a database error if, say, the server dies during query.
 405+ * @param $id
 406+ * @return bool|string
401407 */
402408 private function getTextDb( $id ) {
403409 global $wgContLang;
@@ -584,15 +590,15 @@
585591 $this->egress->writeClosePage( $this->buffer );
586592 // nasty hack, we can't just write the chardata after the
587593 // page tag, it will include leading blanks from the next line
588 - $this->egress->sink->write("\n");
589 -
 594+ $this->egress->sink->write("\n");
 595+
590596 $this->buffer = $this->xmlwriterobj->closeStream();
591597 $this->egress->writeCloseStream( $this->buffer );
592598
593599 $this->buffer = "";
594600 $this->thisPage = "";
595601 // this could be more than one file if we had more than one output arg
596 - $checkpointFilenames = array();
 602+
597603 $filenameList = (array)$this->egress->getFilenames();
598604 $newFilenames = array();
599605 $firstPageID = str_pad($this->firstPageWritten,9,"0",STR_PAD_LEFT);
@@ -669,10 +675,10 @@
670676 pressure on the database.
671677 (Requires the XMLReader extension)
672678 --maxtime=<minutes> Write out checkpoint file after this many minutes (writing
673 - out complete page, closing xml file properly, and opening new one
 679+ out complete page, closing xml file properly, and opening new one
674680 with header). This option requires the checkpointfile option.
675681 --checkpointfile=<filenamepattern> Use this string for checkpoint filenames,
676 - substituting first pageid written for the first %s (required) and the
 682+ substituting first pageid written for the first %s (required) and the
677683 last pageid written for the second %s if it exists.
678684 --quiet Don't dump status reports to stderr.
679685 --report=n Report position and speed after every n pages processed.
Index: trunk/phase3/maintenance/backupPrefetch.inc
@@ -133,6 +133,7 @@
134134
135135 /**
136136 * @access private
 137+ * @return string
137138 */
138139 function nextText() {
139140 $this->skipTo( 'text' );
@@ -141,6 +142,9 @@
142143
143144 /**
144145 * @access private
 146+ * @param $name string
 147+ * @param $parent string
 148+ * @return bool|null
145149 */
146150 function skipTo( $name, $parent = 'page' ) {
147151 if ( $this->atEnd ) {
@@ -192,6 +196,7 @@
193197
194198 /**
195199 * @access private
 200+ * @return null
196201 */
197202 function close() {
198203 $this->reader->close();

Status & tagging log