From c8aa188e0736c2f9174a86457ec353773ced1912 Mon Sep 17 00:00:00 2001 From: Ariel Glenn Date: Wed, 2 Nov 2011 09:55:43 +0000 Subject: [PATCH] corrections for fixme in r96486 --- includes/Export.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/includes/Export.php b/includes/Export.php index 3dcd3baeb5..9dbb6059e5 100644 --- a/includes/Export.php +++ b/includes/Export.php @@ -871,11 +871,19 @@ class Dump7ZipOutput extends DumpPipeOutput { protected $filename; function __construct( $file ) { - $command = setup7zCommand( $file ); + $command = $this->setup7zCommand( $file ); parent::__construct( $command ); $this->filename = $file; } + function setup7zCommand( $file ) { + $command = "7za a -bd -si " . wfEscapeShellArg( $file ); + // Suppress annoying useless crap from p7zip + // Unfortunately this could suppress real error messages too + $command .= ' >' . wfGetNull() . ' 2>&1'; + return( $command ); + } + function closeRenameAndReopen( $newname ) { $this->closeAndRename( $newname, true ); } @@ -895,10 +903,7 @@ class Dump7ZipOutput extends DumpPipeOutput { throw new MWException( __METHOD__ . ": rename of file {$this->filename} to $newname failed\n" ); } elseif ( $open ) { - $command = "7za a -bd -si " . wfEscapeShellArg( $file ); - // Suppress annoying useless crap from p7zip - // Unfortunately this could suppress real error messages too - $command .= ' >' . wfGetNull() . ' 2>&1'; + $command = setup7zCommand( $file ); $this->startCommand( $command ); } } -- 2.20.1