include_once -> require_once
[lhc/web/wiklou.git] / maintenance / compressOld.php
1 <?php
2
3 # Rebuild search index table from scratch. This takes several
4 # hours, depending on the database size and server configuration.
5
6 if ( ! is_readable( "../LocalSettings.php" ) ) {
7 print "A copy of your installation's LocalSettings.php\n" .
8 "must exist in the source directory.\n";
9 exit();
10 }
11
12 $wgCommandLineMode = true;
13 $DP = "../includes";
14 require_once( "../LocalSettings.php" );
15 require_once( "../AdminSettings.php" );
16
17 $sep = strchr( $include_path = ini_get( "include_path" ), ";" ) ? ";" : ":";
18 ini_set( "include_path", "$IP$sep$include_path" );
19
20 require_once( "Setup.php" );
21 require_once( "./compressOld.inc" );
22 $wgTitle = Title::newFromText( "Compress old pages script" );
23 set_time_limit(0);
24
25 $wgDBuser = $wgDBadminuser;
26 $wgDBpassword = $wgDBadminpassword;
27
28 if( !function_exists( "gzdeflate" ) ) {
29 print "You must enable zlib support in PHP to compress old revisions!\n";
30 print "Please see http://www.php.net/manual/en/ref.zlib.php\n\n";
31 die();
32 }
33
34 print "Depending on the size of your database this may take a while!\n";
35 print "If you abort the script while it's running it shouldn't harm anything,\n";
36 print "but if you haven't backed up your data, you SHOULD abort now!\n\n";
37 print "Press control-c to abort first (will proceed automatically in 5 seconds)\n";
38 sleep(5);
39
40 $n = 0;
41 if( !empty( $argv[1] ) ) {
42 $n = intval( $argv[1] );
43 }
44 compressOldPages( $n );
45
46 print "Done.\n";
47 exit();
48
49 ?>