MediaWiki REL1_34
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}
writeOpenPage( $page, $string)
writeRevision( $rev, $string)
closeAndRename( $newnames, $open=false)
closeRenameAndReopen( $newnames)
writeClosePage( $string)
writeCloseStream( $string)
writeOpenStream( $string)