r46909 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46908‎ | r46909 | r46910 >
Date:10:57, 6 February 2009
Author:aaron
Status:deferred
Tags:
Comment:
Avoid timestamp regeneration; just do it once and store it to a var
Modified paths:
  • /trunk/extensions/FlaggedRevs/specialpages/ReaderFeedback_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/specialpages/ReaderFeedback_body.php
@@ -254,7 +254,8 @@
255255 global $wgUser;
256256 $dbw = wfGetDB( DB_MASTER );
257257 # Get date timestamp...
258 - $date = str_pad( substr( wfTimestampNow(), 0, 8 ), 14, '0' );
 258+ $now = wfTimestampNow();
 259+ $date = str_pad( substr( $now, 0, 8 ), 14, '0' );
259260 if( count($this->dims) == 0 )
260261 return false;
261262 $ratings = $this->flattenRatings( $this->dims );
@@ -277,7 +278,7 @@
278279 'rfb_rev_id' => $this->oldid,
279280 'rfb_user' => $wgUser->getId(),
280281 'rfb_ip' => $ip,
281 - 'rfb_timestamp' => $dbw->timestamp(),
 282+ 'rfb_timestamp' => $dbw->timestamp( $now ),
282283 'rfb_ratings' => $ratings
283284 );
284285 # Make sure initial page data is there to begin with...
@@ -295,7 +296,7 @@
296297 $dbw->insert( 'reader_feedback', $insertRow, __METHOD__, 'IGNORE' );
297298 $dbw->insert( 'reader_feedback_history', $insertRows, __METHOD__, 'IGNORE' );
298299 # Update aggregate data for this page over time...
299 - $touched = $dbw->timestamp( wfTimestampNow() );
 300+ $touched = $dbw->timestamp( $now );
300301 $overall = 0;
301302 $insertRows = array();
302303 foreach( $this->dims as $tag => $val ) {

Status & tagging log