Index: trunk/phase3/includes/Export.php |
— | — | @@ -871,11 +871,19 @@ |
872 | 872 | protected $filename; |
873 | 873 | |
874 | 874 | function __construct( $file ) { |
875 | | - $command = setup7zCommand( $file ); |
| 875 | + $command = $this->setup7zCommand( $file ); |
876 | 876 | parent::__construct( $command ); |
877 | 877 | $this->filename = $file; |
878 | 878 | } |
879 | 879 | |
| 880 | + function setup7zCommand( $file ) { |
| 881 | + $command = "7za a -bd -si " . wfEscapeShellArg( $file ); |
| 882 | + // Suppress annoying useless crap from p7zip |
| 883 | + // Unfortunately this could suppress real error messages too |
| 884 | + $command .= ' >' . wfGetNull() . ' 2>&1'; |
| 885 | + return( $command ); |
| 886 | + } |
| 887 | + |
880 | 888 | function closeRenameAndReopen( $newname ) { |
881 | 889 | $this->closeAndRename( $newname, true ); |
882 | 890 | } |
— | — | @@ -895,10 +903,7 @@ |
896 | 904 | throw new MWException( __METHOD__ . ": rename of file {$this->filename} to $newname failed\n" ); |
897 | 905 | } |
898 | 906 | elseif ( $open ) { |
899 | | - $command = "7za a -bd -si " . wfEscapeShellArg( $file ); |
900 | | - // Suppress annoying useless crap from p7zip |
901 | | - // Unfortunately this could suppress real error messages too |
902 | | - $command .= ' >' . wfGetNull() . ' 2>&1'; |
| 907 | + $command = setup7zCommand( $file ); |
903 | 908 | $this->startCommand( $command ); |
904 | 909 | } |
905 | 910 | } |