From: Domas Mituzas Date: Thu, 19 Aug 2004 12:59:57 +0000 (+0000) Subject: fixup database timestamps X-Git-Tag: 1.5.0alpha1~2294 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=facfb655f76ec06a8a8bf571d9c43fb57650e1c8;p=lhc%2Fweb%2Fwiklou.git fixup database timestamps --- diff --git a/includes/Article.php b/includes/Article.php index a00e5aa201..091083e17f 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -771,7 +771,7 @@ class Article { 'cur_text' => $text, 'cur_comment' => $summary, 'cur_user' => $wgUser->getID(), - 'cur_timestamp' => $now, + 'cur_timestamp' => $dbw->timestamp($now), 'cur_minor_edit' => $isminor, 'cur_counter' => 0, 'cur_restrictions' => '', @@ -779,7 +779,7 @@ class Article { 'cur_is_redirect' => $redir, 'cur_is_new' => 1, 'cur_random' => $rand, - 'cur_touched' => $now, + 'cur_touched' => $dbw->timestamp($now), 'inverse_timestamp' => $won, ), $fname ); @@ -799,7 +799,8 @@ class Article { # The talk page isn't in the regular link tables, so we need to update manually: $talkns = $ns ^ 1; # talk -> normal; normal -> talk - $dbw->updateArray( 'cur', array( 'cur_touched' => $now ), array( 'cur_namespace' => $talkns, 'cur_title' => $ttl ), $fname ); + $dbw->updateArray( 'cur', array('cur_touched' => $dbw->timestamp($now) ), + array( 'cur_namespace' => $talkns, 'cur_title' => $ttl ), $fname ); # standard deferred updates $this->editUpdates( $text ); diff --git a/includes/RecentChange.php b/includes/RecentChange.php index fbe1161e63..dfb5fe14f6 100644 --- a/includes/RecentChange.php +++ b/includes/RecentChange.php @@ -100,6 +100,10 @@ class RecentChange $this->mAttribs['rc_ip'] = ''; } + # Fixup database timestamps + $this->mAttribs['rc_timestamp']=$dbw->timestamp($this->mAttribs['rc_timestamp']); + $this->mAttribs['rc_cur_time']=$dbw->timestamp($this->mAttribs['rc_cur_time']); + # Insert new row $dbw->insertArray( "recentchanges", $this->mAttribs, $fname ); @@ -119,7 +123,7 @@ class RecentChange ), array( /* WHERE */ 'rc_namespace' => $ns, 'rc_title' => $title, - 'rc_timestamp' => $lastTime + 'rc_timestamp' => $dbw->timestamp($lastTime) ), $fname );