r57685 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57684‎ | r57685 | r57686 >
Date:22:46, 13 October 2009
Author:aaron
Status:ok
Tags:
Comment:
bug 21122 Show when Special:ValidationStatistics was last updated
Modified paths:
  • /trunk/extensions/FlaggedRevs/language/ValidationStatistics.i18n.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/maintenance/updateStats.inc (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/ValidationStatistics_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/maintenance/updateStats.inc
@@ -232,6 +232,11 @@
233233 array('stat_id' => 1, 'ave_review_time' => $aveRT, 'med_review_time' => $medianRT, 'ave_pending_time' => $avePET),
234234 __METHOD__
235235 );
 236+ // Update timestamp
 237+ $dbw->replace( 'querycache_info', array('qci_type'),
 238+ array('qci_type' => 'validationstats', 'qci_timestamp' => $dbw->timestamp()),
 239+ __METHOD__
 240+ );
236241 $dbw->commit();
237242 // Stats are now up to date!
238243 $key = wfMemcKey( 'flaggedrevs', 'statsUpdated' );
Index: trunk/extensions/FlaggedRevs/language/ValidationStatistics.i18n.php
@@ -13,7 +13,7 @@
1414 and \'\'\'[[Special:ListUsers/reviewer|$2]]\'\'\' {{PLURAL:$2|user|users}} with [[{{MediaWiki:Validationpage}}|Reviewer]] rights.
1515
1616 Editors and Reviewers are established users that can spot check revisions to pages.',
17 - 'validationstatistics-time' => '\'\'The following data is cached and may not be up to date.\'\'
 17+ 'validationstatistics-time' => '\'\'The following data was last updated on $5.\'\'
1818
1919 Edits that have been checked by established users are considered to be reviewed.
2020
Index: trunk/extensions/FlaggedRevs/specialpages/ValidationStatistics_body.php
@@ -25,6 +25,10 @@
2626 $mt = $this->getMeanReviewWait();
2727 $mdt = $this->getMedianReviewWait();
2828 $pt = $this->getMeanPendingWait();
 29+ $timestamp = $this->getLastUpdate();
 30+ if( $timestamp != '-' ) {
 31+ $timestamp = $wgLang->timeanddate( $timestamp, true );
 32+ }
2933
3034 $wgOut->addWikiText( wfMsgExt( 'validationstatistics-users', array( 'parsemag' ),
3135 $wgLang->formatnum($ec), $wgLang->formatnum($rc) )
@@ -55,7 +59,7 @@
5660 # Show review/pending time stats
5761 $wgOut->addWikiText( '<hr/>' . wfMsgExt( 'validationstatistics-time', array( 'parsemag' ),
5862 $wgLang->formatTimePeriod($mt), $wgLang->formatTimePeriod($pt),
59 - $wgLang->formatTimePeriod($mdt), $reviewChart )
 63+ $wgLang->formatTimePeriod($mdt), $reviewChart, $timestamp )
6064 );
6165
6266 $wgOut->addWikiText( wfMsg('validationstatistics-table') );
@@ -202,6 +206,13 @@
203207 return ($val == false ? '-' : $val );
204208 }
205209
 210+ protected function getLastUpdate() {
 211+ if( !$this->db->tableExists( 'querycache_info' ) ) return '-';
 212+ $val = $this->db->selectField( 'querycache_info', 'qci_timestamp',
 213+ array('qci_type' => 'validationstats') );
 214+ return ($val == false ? '-' : $val );
 215+ }
 216+
206217 protected function getTopFiveReviewers() {
207218 $key = wfMemcKey( 'flaggedrevs', 'reviewTopUsers' );
208219 $dbCache = wfGetCache( CACHE_DB );

Follow-up revisions

RevisionCommit summaryAuthorDate
r57687Follow-up to r57685: split date and timesiebrand23:03, 13 October 2009

Status & tagging log