Index: trunk/tools/analysis/StreamingXMLHistoryFilter.php |
— | — | @@ -1,23 +1,21 @@ |
2 | 2 | #!/usr/bin/php -q |
3 | 3 | <?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"); |
6 | 6 | exit(-1); |
7 | 7 | } |
8 | 8 | |
9 | | -$parser = new StreamingXMLHistoryFilter($argv[1], $argv[2]); |
| 9 | +$parser = new StreamingXMLHistoryFilter($argv[1]); |
10 | 10 | $parser->run(); |
11 | 11 | |
12 | 12 | class StreamingXMLHistoryFilter{ |
13 | 13 | |
14 | 14 | public $fileList; |
15 | 15 | public $pageNameArray; |
16 | | - public $historyFile; |
17 | 16 | |
18 | | - public function __construct( $fileList, $historyFile){ |
| 17 | + public function __construct( $fileList ){ |
19 | 18 | $this->pageNameArray = array(); |
20 | 19 | $this->fileList = $fileList; |
21 | | - $this->historyFile = $historyFile; |
22 | 20 | } |
23 | 21 | |
24 | 22 | public function writeOut($title, $pageText){ |
— | — | @@ -41,7 +39,7 @@ |
42 | 40 | $this->createFileList(); |
43 | 41 | |
44 | 42 | $reader = new XMLReader(); |
45 | | - $reader->open($this->historyFile); |
| 43 | + $reader->open("php://stdin"); |
46 | 44 | |
47 | 45 | // NOTE: in the interests of a smaller memory footprint |
48 | 46 | // this relies on the XML title being the next element after the page |