protected $pageCountLast = 0;
protected $revCountLast = 0;
- protected $outputTypes = array();
- protected $filterTypes = array();
+ protected $outputTypes = [];
+ protected $filterTypes = [];
protected $ID = 0;
$this->addOption( 'report', 'Report position and speed after every n pages processed. ' .
'Default: 100.', false, true );
$this->addOption( 'server', 'Force reading from MySQL server', false, true );
+ $this->addOption( '7ziplevel', '7zip compression level for all 7zip outputs. Used for ' .
+ '-mx option to 7za command.', false, true );
if ( $args ) {
// Args should be loaded and processed so that dump() can be called directly
if ( $file != '' ) {
require_once $file;
}
- $register = array( $class, 'register' );
- call_user_func_array( $register, array( &$this ) );
+ $register = [ $class, 'register' ];
+ call_user_func_array( $register, [ $this ] );
}
function execute() {
*/
function processOptions() {
$sink = null;
- $sinks = array();
+ $sinks = [];
$options = $this->orderedOptions;
foreach ( $options as $arg ) {
$this->fatalError( "Unrecognized output sink type '$type'" );
}
$class = $this->outputTypes[$type];
- $sink = new $class( $file );
+ if ( $type === "7zip" ) {
+ $sink = new $class( $file, intval( $this->getOption( '7ziplevel' ) ) );
+ } else {
+ $sink = new $class( $file );
+ }
break;
case 'filter':
// Discourage the server from disconnecting us if it takes a long time
// to read out the big ol' batch query.
- $db->setSessionOptions( array( 'connTimeout' => 3600 * 24 ) );
+ $db->setSessionOptions( [ 'connTimeout' => 3600 * 24 ] );
return $db;
}