Index: trunk/phase3/maintenance/importDump.php |
— | — | @@ -115,7 +115,6 @@ |
116 | 116 | } |
117 | 117 | |
118 | 118 | function importFromFile( $filename ) { |
119 | | - $t = true; |
120 | 119 | if ( preg_match( '/\.gz$/', $filename ) ) { |
121 | 120 | $filename = 'compress.zlib://' . $filename; |
122 | 121 | } |
— | — | @@ -124,10 +123,9 @@ |
125 | 124 | } |
126 | 125 | elseif ( preg_match( '/\.7z$/', $filename ) ) { |
127 | 126 | $filename = 'mediawiki.compress.7z://' . $filename; |
128 | | - $t = false; |
129 | 127 | } |
130 | 128 | |
131 | | - $file = fopen( $filename, $t ? 'rt' : 't' ); // our 7zip wrapper uses popen, which seems not to like two-letter modes |
| 129 | + $file = fopen( $filename, 'rt' ); |
132 | 130 | return $this->importFromHandle( $file ); |
133 | 131 | } |
134 | 132 | |
Index: trunk/phase3/maintenance/7zip.inc |
— | — | @@ -35,7 +35,7 @@ |
36 | 36 | // Suppress the stupid messages on stderr |
37 | 37 | $command .= ' 2>/dev/null'; |
38 | 38 | } |
39 | | - $this->stream = popen( $command, $mode ); |
| 39 | + $this->stream = popen( $command, $mode[0] ); // popen() doesn't like two-letter modes |
40 | 40 | return ( $this->stream !== false ); |
41 | 41 | } |
42 | 42 | |
— | — | @@ -73,4 +73,4 @@ |
74 | 74 | return fseek( $this->stream, $offset, $whence ); |
75 | 75 | } |
76 | 76 | } |
77 | | -stream_wrapper_register( 'mediawiki.compress.7z', 'SevenZipStream' ); |
\ No newline at end of file |
| 77 | +stream_wrapper_register( 'mediawiki.compress.7z', 'SevenZipStream' ); |