MediaWiki  1.29.2
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, $string );
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 
107  function closeRenameAndReopen( $newname ) {
108  $this->sink->closeRenameAndReopen( $newname );
109  }
110 
115  function closeAndRename( $newname, $open = false ) {
116  $this->sink->closeAndRename( $newname, $open );
117  }
118 
122  function getFilenames() {
123  return $this->sink->getFilenames();
124  }
125 
131  function pass( $page ) {
132  return true;
133  }
134 }
DumpFilter\writeLogItem
writeLogItem( $rev, $string)
Definition: DumpFilter.php:100
DumpFilter\pass
pass( $page)
Override for page-based filter types.
Definition: DumpFilter.php:131
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
php
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
DumpFilter\writeOpenStream
writeOpenStream( $string)
Definition: DumpFilter.php:54
$page
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached $page
Definition: hooks.txt:2536
DumpOutput
Definition: DumpOutput.php:29
DumpFilter\closeRenameAndReopen
closeRenameAndReopen( $newname)
Definition: DumpFilter.php:107
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:115
DumpFilter\$sendingThisPage
bool $sendingThisPage
Definition: DumpFilter.php:42
$rev
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev
Definition: hooks.txt:1741
DumpFilter\writeCloseStream
writeCloseStream( $string)
Definition: DumpFilter.php:61
DumpFilter\getFilenames
getFilenames()
Definition: DumpFilter.php:122
DumpFilter\__construct
__construct(&$sink)
Definition: DumpFilter.php:47