2 require_once( "commandLine.inc" );
3 include_once( "InitialiseMessages.inc" );
5 $wgTitle = Title
::newFromText( "Rebuild messages script" );
7 if ( isset( $args[0] ) ) {
8 $response = array_shift( $args );
9 if ( $response == "update" ) {
11 } elseif ( $response == "rebuild" ) {
17 if ( isset( $args[0] ) ) {
18 $messages = loadLanguageFile( array_shift( $args ) );
23 if ( $response == 0 ) {
24 $row = wfGetArray( "cur", array("count(*) as c"), array("cur_namespace" => NS_MEDIAWIKI
) );
25 print "Current namespace size: {$row->c}\n";
27 print "1. Update messages to include latest additions to Language.php\n" .
28 "2. Delete all messages and reinitialise namespace\n" .
31 "Please enter a number: ";
34 $response = IntVal(readconsole());
35 if ( $response >= 1 && $response <= 3 ) {
39 print "Please type a number between 1 and 3: ";
44 switch ( $response ) {
46 initialiseMessages( false, $messages );
49 initialiseMessages( true, $messages );