r69569 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69568‎ | r69569 | r69570 >
Date:20:16, 19 July 2010
Author:nimishg
Status:deferred
Tags:
Comment:
switching to use STDIN
Modified paths:
  • /trunk/tools/analysis/StreamingXMLHistoryFilter.php (modified) (history)

Diff [purge]

Index: trunk/tools/analysis/StreamingXMLHistoryFilter.php
@@ -1,23 +1,21 @@
22 #!/usr/bin/php -q
33 <?php
4 -if(count($argv) != 3){
5 - print("\n\tUsage: $argv[0] <inputfile> <historyfile>\n");
 4+if(count($argv) != 2){
 5+ print("\n\tUsage: $argv[0] <inputfile> \n");
66 exit(-1);
77 }
88
9 -$parser = new StreamingXMLHistoryFilter($argv[1], $argv[2]);
 9+$parser = new StreamingXMLHistoryFilter($argv[1]);
1010 $parser->run();
1111
1212 class StreamingXMLHistoryFilter{
1313
1414 public $fileList;
1515 public $pageNameArray;
16 - public $historyFile;
1716
18 - public function __construct( $fileList, $historyFile){
 17+ public function __construct( $fileList ){
1918 $this->pageNameArray = array();
2019 $this->fileList = $fileList;
21 - $this->historyFile = $historyFile;
2220 }
2321
2422 public function writeOut($title, $pageText){
@@ -41,7 +39,7 @@
4240 $this->createFileList();
4341
4442 $reader = new XMLReader();
45 - $reader->open($this->historyFile);
 43+ $reader->open("php://stdin");
4644
4745 // NOTE: in the interests of a smaller memory footprint
4846 // this relies on the XML title being the next element after the page

Status & tagging log