adding cur_touched to inserted rows, setting wgCommandLineMode
authorTim Starling <tstarling@users.mediawiki.org>
Fri, 21 Nov 2003 05:12:22 +0000 (05:12 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Fri, 21 Nov 2003 05:12:22 +0000 (05:12 +0000)
maintenance/InitialiseMessages.inc
maintenance/rebuildMessages.php

index 0b9a689..b983bba 100755 (executable)
@@ -37,7 +37,7 @@ function initialiseMessages( $overwrite = false) {
                $titleObj = Title::newFromText( $key );
                $title = $titleObj->getDBkey();
                $dbencMsg = wfStrencode( $message );
-
+               
                if ( $overwrite ) {
                        $sql = "DELETE FROM cur WHERE cur_namespace=$ns AND cur_title='$title'";
                        wfQuery( $sql, DB_WRITE, $fname );
@@ -45,7 +45,7 @@ function initialiseMessages( $overwrite = false) {
                
                $sql = "INSERT INTO cur (cur_namespace, cur_title, cur_text,
                        cur_user_text, cur_timestamp, cur_restrictions,
-                       cur_is_new, inverse_timestamp) VALUES (
+                       cur_is_new, inverse_timestamp, cur_touched) VALUES (
                        $ns,
                        '$title',
                        '$dbencMsg',
@@ -53,7 +53,8 @@ function initialiseMessages( $overwrite = false) {
                        '$timestamp',
                        'sysop',
                        1,
-                       '$invTimestamp')";
+                       '$invTimestamp',
+                       '$timestamp')";
                wfQuery( $sql, DB_WRITE, $fname );
                $mwObj =& MagicWord::get( MAG_MSGNW );
                $mw = $mwObj->getSynonym( 0 );
@@ -71,16 +72,19 @@ function initialiseMessages( $overwrite = false) {
        }
        $navText .= "</table>";
        $navText = wfStrencode( $navText );
+
        $title = wfMsgNoDB( "allmessages" );
 
        if ( $overwrite ) {
                $sql = "DELETE FROM cur WHERE cur_namespace=$ns AND cur_title='$title'";
                wfQuery( $sql, DB_WRITE, $fname );
        }
-
+       #print $navText;
+       #$navText = substr($navText, 0, 1000);
+       $navText = str_repeat( "*", 1000 );
        $sql = "INSERT INTO cur (cur_namespace, cur_title, cur_text,
                cur_user_text, cur_timestamp, cur_restrictions,
-               cur_is_new, inverse_timestamp) VALUES (
+               cur_is_new, inverse_timestamp, cur_touched) VALUES (
                $ns,
                '$title',
                '$navText',
@@ -88,7 +92,8 @@ function initialiseMessages( $overwrite = false) {
                '$timestamp',
                'sysop',
                1,
-               '$invTimestamp')";
+               '$invTimestamp',
+               '$timestamp')";
        wfQuery( $sql, DB_WRITE, $fname );
        print "done \n";
 }
index c0f8aa0..2000a8d 100755 (executable)
@@ -1,4 +1,5 @@
 <?
+$wgCommandLineMode = true;
 
 if ( ! is_readable( "../LocalSettings.php" ) ) {
        print "A copy of your installation's LocalSettings.php\n" .
@@ -13,6 +14,7 @@ include_once( "../AdminSettings.php" );
 include_once( "{$IP}/Setup.php" );
 include_once( "./InitialiseMessages.inc" );
 $wgTitle = Title::newFromText( "Rebuild messages script" );
+$wgCommandLineMode = true;
 set_time_limit(0);
 
 initialiseMessages( true );