MediaWiki  1.34.0
DumpFilter.php
Go to the documentation of this file.
1 <?php
31 class DumpFilter {
37  public $sink;
38 
42  protected $sendingThisPage;
43 
47  function __construct( &$sink ) {
48  $this->sink =& $sink;
49  }
50 
54  function writeOpenStream( $string ) {
55  $this->sink->writeOpenStream( $string );
56  }
57 
61  function writeCloseStream( $string ) {
62  $this->sink->writeCloseStream( $string );
63  }
64 
69  function writeOpenPage( $page, $string ) {
70  $this->sendingThisPage = $this->pass( $page );
71  if ( $this->sendingThisPage ) {
72  $this->sink->writeOpenPage( $page, $string );
73  }
74  }
75 
79  function writeClosePage( $string ) {
80  if ( $this->sendingThisPage ) {
81  $this->sink->writeClosePage( $string );
82  $this->sendingThisPage = false;
83  }
84  }
85 
90  function writeRevision( $rev, $string ) {
91  if ( $this->sendingThisPage ) {
92  $this->sink->writeRevision( $rev, $string );
93  }
94  }
95 
100  function writeLogItem( $rev, $string ) {
101  $this->sink->writeRevision( $rev, $string );
102  }
103 
108  function closeRenameAndReopen( $newname ) {
109  $this->sink->closeRenameAndReopen( $newname );
110  }
111 
117  function closeAndRename( $newname, $open = false ) {
118  $this->sink->closeAndRename( $newname, $open );
119  }
120 
124  function getFilenames() {
125  return $this->sink->getFilenames();
126  }
127 
133  protected function pass( $page ) {
134  return true;
135  }
136 }
DumpFilter\writeLogItem
writeLogItem( $rev, $string)
Definition: DumpFilter.php:100
DumpFilter\pass
pass( $page)
Override for page-based filter types.
Definition: DumpFilter.php:133
DumpFilter\writeClosePage
writeClosePage( $string)
Definition: DumpFilter.php:79
DumpFilter\writeRevision
writeRevision( $rev, $string)
Definition: DumpFilter.php:90
DumpFilter\writeOpenPage
writeOpenPage( $page, $string)
Definition: DumpFilter.php:69
DumpFilter\writeOpenStream
writeOpenStream( $string)
Definition: DumpFilter.php:54
DumpOutput
Definition: DumpOutput.php:29
DumpFilter\closeRenameAndReopen
closeRenameAndReopen( $newname)
Definition: DumpFilter.php:108
DumpFilter
Definition: DumpFilter.php:31
DumpFilter\$sink
DumpOutput $sink
FIXME will need to be made protected whenever legacy code is updated.
Definition: DumpFilter.php:37
DumpFilter\closeAndRename
closeAndRename( $newname, $open=false)
Definition: DumpFilter.php:117
DumpFilter\$sendingThisPage
bool $sendingThisPage
Definition: DumpFilter.php:42
DumpFilter\writeCloseStream
writeCloseStream( $string)
Definition: DumpFilter.php:61
DumpFilter\getFilenames
getFilenames()
Definition: DumpFilter.php:124
DumpFilter\__construct
__construct(&$sink)
Definition: DumpFilter.php:47