MediaWiki master
DumpLatestFilter.php
Go to the documentation of this file.
1<?php
12namespace MediaWiki\Export;
13
19 public $page;
20
23
25 public $rev;
26
28 public $revString;
29
34 public function writeOpenPage( $page, $string ) {
35 $this->page = $page;
36 $this->pageString = $string;
37 }
38
42 public function writeClosePage( $string ) {
43 if ( $this->rev ) {
44 $this->sink->writeOpenPage( $this->page, $this->pageString );
45 $this->sink->writeRevision( $this->rev, $this->revString );
46 $this->sink->writeClosePage( $string );
47 }
48 $this->rev = null;
49 $this->revString = null;
50 $this->page = null;
51 $this->pageString = null;
52 }
53
58 public function writeRevision( $rev, $string ) {
59 if ( $rev->rev_id == $this->page->page_latest ) {
60 $this->rev = $rev;
61 $this->revString = $string;
62 }
63 }
64}
65
67class_alias( DumpLatestFilter::class, 'DumpLatestFilter' );