2 $wgCommandLineMode = true;
3 # Turn off output buffering if it's on
6 $sep = strchr( $include_path = ini_get( "include_path" ), ";" ) ?
";" : ":";
7 if ( isset($argv[1]) && $argv[1] ) {
9 putenv( "wikilang=$lang");
10 $settingsFile = "/apache/htdocs/{$argv[1]}/w/LocalSettings.php";
11 $newpath = "/apache/common/php$sep";
13 $settingsFile = "../LocalSettings.php";
17 if ( isset($argv[2]) && $argv[2] == "update" ) {
19 } elseif ( isset($argv[2]) && $argv[2] == "reinitialise" ) {
25 if ( ! is_readable( $settingsFile ) ) {
26 print "A copy of your installation's LocalSettings.php\n" .
27 "must exist in the source directory.\n";
31 ini_set( "include_path", "../includes$sep../languages$sep$newpath$IP$sep$include_path" );
33 $wgCommandLineMode = true;
35 include_once( $settingsFile );
37 include_once( "Setup.php" );
38 include_once( "./InitialiseMessages.inc" );
39 include_once( "../install-utils.inc" );
40 $wgTitle = Title
::newFromText( "Rebuild messages script" );
41 $wgCommandLineMode = true;
44 if ( isset($argv) && count( $argv ) >= 3 ) {
45 $messages = loadArrayFromFile( $argv[3] );
50 if ( $response == 0 ) {
51 $row = wfGetArray( "cur", array("count(*) as c"), array("cur_namespace" => NS_MEDIAWIKI
) );
52 print "Current namespace size: {$row->c}\n";
54 print "1. Update messages to include latest additions to Language.php\n" .
55 "2. Delete all messages and reinitialise namespace\n" .
58 "Please enter a number: ";
61 $response = IntVal(readconsole());
62 if ( $response >= 1 && $response <= 3 ) {
66 print "Please type a number between 1 and 3: ";
71 switch ( $response ) {
73 initialiseMessages( false, $messages );
76 initialiseMessages( true, $messages );