+ $first = true;
+ $sortedArray = ksort( $wgAllMessagesEn );
+
+ foreach ( $sortedArray as $key => $enMsg ) {
+ if ( $first ) {
+ $first = false;
+ } else {
+ $sql .= ",";
+ }
+
+ $message = wfMsgNoDB( $key );
+ $titleObj = Title::newFromText( $key );
+ $enctitle = wfStrencode($titleObj->getDBkey());
+ $sql .= "'$enctitle'";
+ }
+ $sql .= ")";
+ print "Reading...";
+ $res = wfQuery( $sql, DB_READ );
+ print ".";
+ $row = wfFetchObject( $res );
+ print "done\n";
+
+ print "Setting up...";
+ $exists = array();
+ while ( $row ) {
+ $exists[$row->cur_title] = 1;
+ $row = wfFetchObject( $res );
+ }
+ print ".";
+ $sql = "INSERT INTO cur (cur_namespace, cur_title, cur_text,
+ cur_user_text, cur_timestamp, cur_restrictions,
+ cur_is_new, inverse_timestamp, cur_touched) VALUES ";
+ $first = true;
+ $mwObj =& MagicWord::get( MAG_MSGNW );
+ $msgnw = $mwObj->getSynonym( 0 );
+ print "Done\n";
+
+ print "Processing...";
+
+ foreach ( $sortedArray as $key => $enMsg ) {