Add color to the output; assumes a more or less ANSI-flavored terminal.
[lhc/web/wiklou.git] / maintenance / compressOld.php
1 <?php
2 /**
3 * Compress the old table, old_flags=gzip
4 *
5 * @package MediaWiki
6 * @subpackage Maintenance
7 */
8
9 /** */
10 require_once( "commandLine.inc" );
11 require_once( "compressOld.inc" );
12
13 if( !function_exists( "gzdeflate" ) ) {
14 print "You must enable zlib support in PHP to compress old revisions!\n";
15 print "Please see http://www.php.net/manual/en/ref.zlib.php\n\n";
16 die();
17 }
18
19 print "Depending on the size of your database this may take a while!\n";
20 print "If you abort the script while it's running it shouldn't harm anything,\n";
21 print "but if you haven't backed up your data, you SHOULD abort now!\n\n";
22 print "Press control-c to abort first (will proceed automatically in 5 seconds)\n";
23 sleep(5);
24
25 $n = 0;
26 if( !empty( $argv[1] ) ) {
27 $n = intval( $argv[1] );
28 }
29 compressOldPages( $n );
30
31 print "Done.\n";
32 exit();
33
34 ?>