r81183 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81182‎ | r81183 | r81184 >
Date:07:12, 29 January 2011
Author:ariel
Status:ok
Tags:
Comment:
open a series of files for xml input if supplied (used for multiple xml prefetch files) (mft 81149, 81150)
Modified paths:
  • /branches/wmf/1.16wmf4/maintenance/backupPrefetch.inc (modified) (history)
  • /branches/wmf/1.16wmf4/maintenance/dumpTextPass.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.16wmf4/maintenance/dumpTextPass.php
@@ -107,18 +107,28 @@
108108 }
109109
110110 function processFileOpt( $val, $param ) {
111 - switch( $val ) {
112 - case "file":
113 - return $param;
114 - case "gzip":
115 - return "compress.zlib://$param";
116 - case "bzip2":
117 - return "compress.bzip2://$param";
118 - case "7zip":
119 - return "mediawiki.compress.7z://$param";
120 - default:
121 - return $val;
 111+ $fileURIs = explode(';',$param);
 112+ foreach ( $fileURIs as $URI ) {
 113+ switch( $val ) {
 114+ case "file":
 115+ $newURI = $URI;
 116+ break;
 117+ case "gzip":
 118+ $newURI = "compress.zlib://$URI";
 119+ break;
 120+ case "bzip2":
 121+ $newURI = "compress.bzip2://$URI";
 122+ break;
 123+ case "7zip":
 124+ $newURI = "mediawiki.compress.7z://$URI";
 125+ break;
 126+ default:
 127+ $newURI = $URI;
 128+ }
 129+ $newFileURIs[] = $newURI;
122130 }
 131+ $val = implode( ';', $newFileURIs );
 132+ return $val;
123133 }
124134
125135 /**
Property changes on: branches/wmf/1.16wmf4/maintenance/dumpTextPass.php
___________________________________________________________________
Modified: svn:mergeinfo
126136 Merged /trunk/phase3/maintenance/dumpTextPass.php:r81150
Index: branches/wmf/1.16wmf4/maintenance/backupPrefetch.inc
@@ -60,9 +60,12 @@
6161 var $atPageEnd = false;
6262 var $lastPage = 0;
6363 var $lastRev = 0;
 64+ var $infiles = null;
6465
6566 function BaseDump( $infile ) {
 67+ $this->infiles = explode(';',$infile);
6668 $this->reader = new XMLReader();
 69+ $infile = array_shift($this->infiles);
6770 $this->reader->open( $infile );
6871 }
6972
@@ -116,7 +119,12 @@
117120 $this->atPageEnd = false;
118121 }
119122 } else {
120 - $this->atEnd = true;
 123+ $this->close();
 124+ if (count($this->infiles)) {
 125+ $infile = array_shift($this->infiles);
 126+ $this->reader->open( $infile );
 127+ $this->atEnd = false;
 128+ }
121129 }
122130 }
123131
Property changes on: branches/wmf/1.16wmf4/maintenance/backupPrefetch.inc
___________________________________________________________________
Added: svn:mergeinfo
124132 Merged /trunk/phase3/maintenance/backupPrefetch.inc:r63545-63546,63549,63643,63764,63897-63901,63935,64113,64509,65387,65391,65555,65590,65650,65816,67596-67597,77555,77558-77560,77563-77565,77573,81149
125133 Merged /branches/wmf-deployment/maintenance/backupPrefetch.inc:r60970

Status & tagging log