MediaWiki  1.34.0
DumpMultiWriter.php
Go to the documentation of this file.
1 <?php
31  private $sinks;
33  private $count;
34 
38  function __construct( $sinks ) {
39  $this->sinks = $sinks;
40  $this->count = count( $sinks );
41  }
42 
46  function writeOpenStream( $string ) {
47  for ( $i = 0; $i < $this->count; $i++ ) {
48  $this->sinks[$i]->writeOpenStream( $string );
49  }
50  }
51 
55  function writeCloseStream( $string ) {
56  for ( $i = 0; $i < $this->count; $i++ ) {
57  $this->sinks[$i]->writeCloseStream( $string );
58  }
59  }
60 
65  function writeOpenPage( $page, $string ) {
66  for ( $i = 0; $i < $this->count; $i++ ) {
67  $this->sinks[$i]->writeOpenPage( $page, $string );
68  }
69  }
70 
74  function writeClosePage( $string ) {
75  for ( $i = 0; $i < $this->count; $i++ ) {
76  $this->sinks[$i]->writeClosePage( $string );
77  }
78  }
79 
84  function writeRevision( $rev, $string ) {
85  for ( $i = 0; $i < $this->count; $i++ ) {
86  $this->sinks[$i]->writeRevision( $rev, $string );
87  }
88  }
89 
93  function closeRenameAndReopen( $newnames ) {
94  $this->closeAndRename( $newnames, true );
95  }
96 
101  function closeAndRename( $newnames, $open = false ) {
102  for ( $i = 0; $i < $this->count; $i++ ) {
103  $this->sinks[$i]->closeAndRename( $newnames[$i], $open );
104  }
105  }
106 
110  function getFilenames() {
111  $filenames = [];
112  for ( $i = 0; $i < $this->count; $i++ ) {
113  $filenames[] = $this->sinks[$i]->getFilenames();
114  }
115  return $filenames;
116  }
117 }
DumpMultiWriter\$count
int $count
Definition: DumpMultiWriter.php:33
DumpMultiWriter
Definition: DumpMultiWriter.php:29
DumpMultiWriter\$sinks
array $sinks
Definition: DumpMultiWriter.php:31
DumpMultiWriter\writeOpenPage
writeOpenPage( $page, $string)
Definition: DumpMultiWriter.php:65
DumpMultiWriter\__construct
__construct( $sinks)
Definition: DumpMultiWriter.php:38
DumpMultiWriter\getFilenames
getFilenames()
Definition: DumpMultiWriter.php:110
DumpMultiWriter\writeOpenStream
writeOpenStream( $string)
Definition: DumpMultiWriter.php:46
DumpMultiWriter\closeAndRename
closeAndRename( $newnames, $open=false)
Definition: DumpMultiWriter.php:101
DumpMultiWriter\writeCloseStream
writeCloseStream( $string)
Definition: DumpMultiWriter.php:55
DumpMultiWriter\closeRenameAndReopen
closeRenameAndReopen( $newnames)
Definition: DumpMultiWriter.php:93
DumpMultiWriter\writeClosePage
writeClosePage( $string)
Definition: DumpMultiWriter.php:74
DumpMultiWriter\writeRevision
writeRevision( $rev, $string)
Definition: DumpMultiWriter.php:84