Index: trunk/phase3/includes/Export.php |
— | — | @@ -35,8 +35,6 @@ |
36 | 36 | var $author_list = "" ; |
37 | 37 | |
38 | 38 | var $dumpUploads = false; |
39 | | - var $multiPart = false; |
40 | | - var $files = array(); |
41 | 39 | |
42 | 40 | const FULL = 1; |
43 | 41 | const CURRENT = 2; |
— | — | @@ -88,23 +86,12 @@ |
89 | 87 | |
90 | 88 | public function openStream() { |
91 | 89 | $output = $this->writer->openStream(); |
92 | | - |
93 | | - if ( $this->multiPart ) { |
94 | | - $this->openMultipart(); |
95 | | - $this->sink->write( $output ); |
96 | | - } else { |
97 | | - $this->sink->writeOpenStream( $output ); |
98 | | - } |
| 90 | + $this->sink->writeOpenStream( $output ); |
99 | 91 | } |
100 | 92 | |
101 | 93 | public function closeStream() { |
102 | 94 | $output = $this->writer->closeStream(); |
103 | | - if ( $this->multiPart ) { |
104 | | - $this->sink->write( $output ); |
105 | | - $this->closeMultipart(); |
106 | | - } else { |
107 | | - $this->sink->writeCloseStream( $output ); |
108 | | - } |
| 95 | + $this->sink->writeCloseStream( $output ); |
109 | 96 | } |
110 | 97 | |
111 | 98 | /** |
— | — | @@ -327,7 +314,6 @@ |
328 | 315 | $output = ''; |
329 | 316 | if ( $this->dumpUploads ) { |
330 | 317 | $output .= $this->writer->writeUploads( $last ); |
331 | | - $this->attachUploads( $last ); |
332 | 318 | } |
333 | 319 | $output .= $this->writer->closePage(); |
334 | 320 | $this->sink->writeClosePage( $output ); |
— | — | @@ -343,7 +329,6 @@ |
344 | 330 | $output = ''; |
345 | 331 | if ( $this->dumpUploads ) { |
346 | 332 | $output .= $this->writer->writeUploads( $last ); |
347 | | - $this->attachUploads( $last ); |
348 | 333 | } |
349 | 334 | $output .= $this->author_list; |
350 | 335 | $output .= $this->writer->closePage(); |
— | — | @@ -357,38 +342,6 @@ |
358 | 343 | $this->sink->writeLogItem( $row, $output ); |
359 | 344 | } |
360 | 345 | } |
361 | | - |
362 | | - protected function attachUploads( $row ) { |
363 | | - $title = Title::newFromRow( $row ); |
364 | | - $file = wfLocalFile( $title ); |
365 | | - $this->files[] = $file; |
366 | | - $this->files = array_merge( $this->files, $file->getHistory() ); |
367 | | - } |
368 | | - |
369 | | - protected function openMultipart() { |
370 | | - # Multipart boundary purposely invalid XML |
371 | | - $this->boundary = '<' . dechex( mt_rand() ) . dechex( mt_rand() ) . '<'; |
372 | | - $this->sink->writeOpenStream( |
373 | | - "Content-Type: multipart/related; boundary={$this->boundary};" . |
374 | | - " type=text/xml\n\n" . |
375 | | - "--{$this->boundary}\nContent-Type: text/xml\n\n" |
376 | | - ); |
377 | | - } |
378 | | - |
379 | | - protected function closeMultipart() { |
380 | | - $output = ''; |
381 | | - |
382 | | - foreach ( $this->files as $file ) { |
383 | | - $output .= "\n--{$this->boundary}\n" . |
384 | | - 'Content-Type: ' . $file->getMimeType() . "\n" . |
385 | | - 'Content-ID: ' . $file->getRel() . "\n" . |
386 | | - 'Content-Length: ' . $file->getSize() . "\n" . |
387 | | - 'X-Sha1Base36: ' . $file->getSha1() . "\n\n"; |
388 | | - $this->sink->write( $output ); |
389 | | - $this->sink->write( file_get_contents( $file->getPath() ) ); |
390 | | - } |
391 | | - $this->sink->writeCloseStream( "\n--{$this->boundary}\n" ); |
392 | | - } |
393 | 346 | } |
394 | 347 | |
395 | 348 | /** |