MediaWiki master
DumpFilter.php
Go to the documentation of this file.
1<?php
14namespace MediaWiki\Export;
15
25 public $sink;
26
31
35 public function __construct( &$sink ) {
36 $this->sink =& $sink;
37 }
38
42 public function writeOpenStream( $string ) {
43 $this->sink->writeOpenStream( $string );
44 }
45
49 public function writeCloseStream( $string ) {
50 $this->sink->writeCloseStream( $string );
51 }
52
57 public function writeOpenPage( $page, $string ) {
58 $this->sendingThisPage = $this->pass( $page );
59 if ( $this->sendingThisPage ) {
60 $this->sink->writeOpenPage( $page, $string );
61 }
62 }
63
67 public function writeClosePage( $string ) {
68 if ( $this->sendingThisPage ) {
69 $this->sink->writeClosePage( $string );
70 $this->sendingThisPage = false;
71 }
72 }
73
78 public function writeRevision( $rev, $string ) {
79 if ( $this->sendingThisPage ) {
80 $this->sink->writeRevision( $rev, $string );
81 }
82 }
83
88 public function writeLogItem( $rev, $string ) {
89 $this->sink->writeRevision( $rev, $string );
90 }
91
96 public function closeRenameAndReopen( $newname ) {
97 $this->sink->closeRenameAndReopen( $newname );
98 }
99
105 public function closeAndRename( $newname, $open = false ) {
106 $this->sink->closeAndRename( $newname, $open );
107 }
108
112 public function getFilenames() {
113 return $this->sink->getFilenames() ?? [];
114 }
115
121 protected function pass( $page ) {
122 return true;
123 }
124}
125
127class_alias( DumpFilter::class, 'DumpFilter' );
DumpOutput $sink
FIXME will need to be made protected whenever legacy code is updated.
closeAndRename( $newname, $open=false)
writeLogItem( $rev, $string)
pass( $page)
Override for page-based filter types.
writeRevision( $rev, $string)
writeOpenPage( $page, $string)