corrections for fixme in r96486
authorAriel Glenn <ariel@users.mediawiki.org>
Wed, 2 Nov 2011 09:55:43 +0000 (09:55 +0000)
committerAriel Glenn <ariel@users.mediawiki.org>
Wed, 2 Nov 2011 09:55:43 +0000 (09:55 +0000)
includes/Export.php

index 3dcd3ba..9dbb605 100644 (file)
@@ -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 );
                        }
                }