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