MediaWiki REL1_33
Dump7ZipOutput.php
Go to the documentation of this file.
1<?php
27
36
41 function __construct( $file, $cmpLevel = 4 ) {
42 $this->compressionLevel = $cmpLevel;
43 $command = $this->setup7zCommand( $file );
44 parent::__construct( $command );
45 $this->filename = $file;
46 }
47
52 function setup7zCommand( $file ) {
53 $command = "7za a -bd -si -mx=";
54 $command .= Shell::escape( $this->compressionLevel ) . ' ';
55 $command .= Shell::escape( $file );
56 // Suppress annoying useless crap from p7zip
57 // Unfortunately this could suppress real error messages too
58 $command .= ' >' . wfGetNull() . ' 2>&1';
59 return $command;
60 }
61
66 function closeAndRename( $newname, $open = false ) {
67 $newname = $this->checkRenameArgCount( $newname );
68 if ( $newname ) {
69 fclose( $this->handle );
70 proc_close( $this->procOpenResource );
71 $this->renameOrException( $newname );
72 if ( $open ) {
73 $command = $this->setup7zCommand( $this->filename );
74 $this->startCommand( $command );
75 }
76 }
77 }
78}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
wfGetNull()
Get a platform-independent path to the null file, e.g.
__construct( $file, $cmpLevel=4)
closeAndRename( $newname, $open=false)
checkRenameArgCount( $newname)
renameOrException( $newname)
startCommand( $command)
Executes shell commands.
Definition Shell.php:44
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Definition router.php:42