From: Ariel Glenn Date: Wed, 2 Nov 2011 09:55:43 +0000 (+0000) Subject: corrections for fixme in r96486 X-Git-Tag: 1.31.0-rc.0~26763 X-Git-Url: http://git.cyclocoop.org//%22%22._DIR_PLUGIN_FULLCALENDAR.%22prive/themes/spip/images/event_edit.png/%22?a=commitdiff_plain;h=c8aa188e0736c2f9174a86457ec353773ced1912;p=lhc%2Fweb%2Fwiklou.git corrections for fixme in r96486 --- 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 ); } }