MediaWiki  1.29.1
DumpMultiWriter.php
Go to the documentation of this file.
1 <?php
30 
34  function __construct( $sinks ) {
35  $this->sinks = $sinks;
36  $this->count = count( $sinks );
37  }
38 
42  function writeOpenStream( $string ) {
43  for ( $i = 0; $i < $this->count; $i++ ) {
44  $this->sinks[$i]->writeOpenStream( $string );
45  }
46  }
47 
51  function writeCloseStream( $string ) {
52  for ( $i = 0; $i < $this->count; $i++ ) {
53  $this->sinks[$i]->writeCloseStream( $string );
54  }
55  }
56 
61  function writeOpenPage( $page, $string ) {
62  for ( $i = 0; $i < $this->count; $i++ ) {
63  $this->sinks[$i]->writeOpenPage( $page, $string );
64  }
65  }
66 
70  function writeClosePage( $string ) {
71  for ( $i = 0; $i < $this->count; $i++ ) {
72  $this->sinks[$i]->writeClosePage( $string );
73  }
74  }
75 
80  function writeRevision( $rev, $string ) {
81  for ( $i = 0; $i < $this->count; $i++ ) {
82  $this->sinks[$i]->writeRevision( $rev, $string );
83  }
84  }
85 
89  function closeRenameAndReopen( $newnames ) {
90  $this->closeAndRename( $newnames, true );
91  }
92 
97  function closeAndRename( $newnames, $open = false ) {
98  for ( $i = 0; $i < $this->count; $i++ ) {
99  $this->sinks[$i]->closeAndRename( $newnames[$i], $open );
100  }
101  }
102 
106  function getFilenames() {
107  $filenames = [];
108  for ( $i = 0; $i < $this->count; $i++ ) {
109  $filenames[] = $this->sinks[$i]->getFilenames();
110  }
111  return $filenames;
112  }
113 }
captcha-old.count
count
Definition: captcha-old.py:225
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
DumpMultiWriter
Definition: DumpMultiWriter.php:29
$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
DumpMultiWriter\writeOpenPage
writeOpenPage( $page, $string)
Definition: DumpMultiWriter.php:61
DumpMultiWriter\__construct
__construct( $sinks)
Definition: DumpMultiWriter.php:34
DumpMultiWriter\getFilenames
getFilenames()
Definition: DumpMultiWriter.php:106
DumpMultiWriter\writeOpenStream
writeOpenStream( $string)
Definition: DumpMultiWriter.php:42
DumpMultiWriter\closeAndRename
closeAndRename( $newnames, $open=false)
Definition: DumpMultiWriter.php:97
$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
DumpMultiWriter\writeCloseStream
writeCloseStream( $string)
Definition: DumpMultiWriter.php:51
DumpMultiWriter\closeRenameAndReopen
closeRenameAndReopen( $newnames)
Definition: DumpMultiWriter.php:89
DumpMultiWriter\writeClosePage
writeClosePage( $string)
Definition: DumpMultiWriter.php:70
DumpMultiWriter\writeRevision
writeRevision( $rev, $string)
Definition: DumpMultiWriter.php:80