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 $dbr =& wfGetDB( DB_SLAVE
);
25 $row = $dbr->selectRow( "cur", array("count(*) as c"), array("cur_namespace" => NS_MEDIAWIKI
) );
26 print "Current namespace size: {$row->c}\n";
28 print "1. Update messages to include latest additions to Language.php\n" .
29 "2. Delete all messages and reinitialise namespace\n" .
32 "Please enter a number: ";
35 $response = IntVal(readconsole());
36 if ( $response >= 1 && $response <= 3 ) {
40 print "Please type a number between 1 and 3: ";
45 switch ( $response ) {
47 initialiseMessages( false, $messages );
50 initialiseMessages( true, $messages );