r68154 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68153‎ | r68154 | r68155 >
Date:07:10, 17 June 2010
Author:aaron
Status:ok
Tags:
Comment:
(bug 22826) Make "under review" states show in the API for oldreviewedpages/unreviewedpages
Modified paths:
  • /trunk/extensions/FlaggedRevs/api/ApiQueryOldreviewedpages.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/api/ApiQueryUnreviewedpages.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/api/ApiQueryOldreviewedpages.php
@@ -41,7 +41,7 @@
4242 }
4343
4444 private function run( $resultPageSet = null ) {
45 - global $wgUser;
 45+ global $wgUser, $wgMemc;
4646 $params = $this->extractRequestParams();
4747
4848 // Construct SQL Query
@@ -122,6 +122,8 @@
123123
124124 if ( is_null( $resultPageSet ) ) {
125125 $title = Title::newFromRow( $row );
 126+ $key = wfMemcKey( 'stableDiffs', 'underReview',
 127+ $row->fp_stable, $row->page_latest );
126128 $data[] = array(
127129 'pageid' => intval( $row->page_id ),
128130 'ns' => intval( $title->getNamespace() ),
@@ -131,7 +133,8 @@
132134 'pending_since' => wfTimestamp( TS_ISO_8601, $row->fp_pending_since ),
133135 'flagged_level' => intval( $row->fp_quality ),
134136 'flagged_level_text' => FlaggedRevs::getQualityLevelText( $row->fp_quality ),
135 - 'diff_size' => (int)$row->page_len - (int)$row->rev_len
 137+ 'diff_size' => (int)$row->page_len - (int)$row->rev_len,
 138+ 'under_review' => (bool)$wgMemc->get( $key )
136139 );
137140 } else {
138141 $resultPageSet->processDbRow( $row );
Index: trunk/extensions/FlaggedRevs/api/ApiQueryUnreviewedpages.php
@@ -41,6 +41,7 @@
4242 }
4343
4444 private function run( $resultPageSet = null ) {
 45+ global $wgMemc;
4546 $params = $this->extractRequestParams();
4647
4748 // Construct SQL Query
@@ -95,11 +96,13 @@
9697
9798 if ( is_null( $resultPageSet ) ) {
9899 $title = Title::newFromRow( $row );
 100+ $key = wfMemcKey( 'unreviewedPages', 'underReview', $row->page_id );
99101 $data[] = array(
100 - 'pageid' => intval( $row->page_id ),
101 - 'ns' => intval( $title->getNamespace() ),
102 - 'title' => $title->getPrefixedText(),
103 - 'revid' => intval( $row->page_latest ),
 102+ 'pageid' => intval( $row->page_id ),
 103+ 'ns' => intval( $title->getNamespace() ),
 104+ 'title' => $title->getPrefixedText(),
 105+ 'revid' => intval( $row->page_latest ),
 106+ 'under_review' => (bool)$wgMemc->get( $key )
104107 );
105108 } else {
106109 $resultPageSet->processDbRow( $row );

Status & tagging log