[options...] * * Options are: * -t set compression type to either: * gzip: compress revisions independently * concat: concatenate revisions and compress in chunks (default) * -c maximum number of revisions in a concat chunk * -b earliest date to check for uncompressed revisions * -e latest revision date to compress * -s the old_id to start from * -f the maximum ratio of compressed chunk bytes to uncompressed avg. revision bytes * -h is a minimum number of KB, where cuts in * --extdb store specified revisions in an external cluster (untested) * */ $optionsWithArgs = array( 't', 'c', 's', 'f', 'h', 'extdb', 'endid', 'e' ); require_once( dirname(__FILE__) . '/../commandLine.inc' ); require_once( "compressOld.inc" ); if( !function_exists( "gzdeflate" ) ) { print "You must enable zlib support in PHP to compress old revisions!\n"; print "Please see http://www.php.net/manual/en/ref.zlib.php\n\n"; wfDie(); } $defaults = array( 't' => 'concat', 'c' => 20, 's' => 0, 'f' => 5, 'h' => 100, 'b' => '', 'e' => '', 'extdb' => '', 'endid' => false, ); $options = $options + $defaults; if ( $options['t'] != 'concat' && $options['t'] != 'gzip' ) { print "Type \"{$options['t']}\" not supported\n"; } if ( $options['extdb'] != '' ) { print "Compressing database $wgDBname to external cluster {$options['extdb']}\n" . str_repeat('-', 76) . "\n\n"; } else { print "Compressing database $wgDBname\n" . str_repeat('-', 76) . "\n\n"; } $success = true; if ( $options['t'] == 'concat' ) { $success = compressWithConcat( $options['s'], $options['c'], $options['f'], $options['h'], $options['b'], $options['e'], $options['extdb'], $options['endid'] ); } else { compressOldPages( $options['s'], $options['extdb'] ); } if ( $success ) { print "Done.\n"; } exit(); ?>