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