Better namespace 8 updating, and watchlist caching in memcached.doc
[lhc/web/wiklou.git] / maintenance / rebuildMessages.php
1 <?
2 $wgCommandLineMode = true;
3
4 if ( ! is_readable( "../LocalSettings.php" ) ) {
5 print "A copy of your installation's LocalSettings.php\n" .
6 "must exist in the source directory.\n";
7 exit();
8 }
9
10 $wgCommandLineMode = true;
11 $DP = "../includes";
12 include_once( "../LocalSettings.php" );
13 include_once( "../AdminSettings.php" );
14
15 $sep = strchr( $include_path = ini_get( "include_path" ), ";" ) ? ";" : ":";
16 ini_set( "include_path", "../includes$sep../languages$sep$include_path" );
17
18 include_once( "Setup.php" );
19 include_once( "./InitialiseMessages.inc" );
20 include_once( "../install-utils.inc" );
21 $wgTitle = Title::newFromText( "Rebuild messages script" );
22 $wgCommandLineMode = true;
23 set_time_limit(0);
24
25 print "1. Update messages to include latest additions to Language.php\n" .
26 "2. Delete all messages and reinitialise namespace\n" .
27 "3. Quit\n\n".
28
29 "Please enter a number: ";
30
31 do {
32 $response = IntVal(readconsole());
33 if ( $response >= 1 && $response <= 3 ) {
34 $good = true;
35 } else {
36 $good = false;
37 print "Please type a number between 1 and 3: ";
38 }
39 } while ( !$good );
40
41 switch ( $response ) {
42 case 1:
43 initialiseMessages( false );
44 break;
45 case 2:
46 initialiseMessages( true );
47 break;
48 }
49
50 exit();
51
52 ?>