r84446 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84445‎ | r84446 | r84447 >
Date:14:32, 21 March 2011
Author:aaron
Status:resolved
Tags:
Comment:
* Pass pager->getNumRows() into explanatory message
* Use link() function for links (some pages now use linkbatch for this)
* Use HTML functions a bit more
* Don't call purgeExpiredConfigurations() so much
* Other random cleanups
Modified paths:
  • /trunk/extensions/FlaggedRevs/specialpages/ConfiguredPages_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/PendingChanges_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/ProblemChanges_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/ReviewedPages_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/StablePages_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/UnreviewedPages_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/specialpages/PendingChanges_body.php
@@ -6,6 +6,8 @@
77
88 class PendingChanges extends SpecialPage
99 {
 10+ protected $pager = null;
 11+
1012 public function __construct() {
1113 parent::__construct( 'PendingChanges' );
1214 $this->includable( true );
@@ -13,28 +15,38 @@
1416
1517 public function execute( $par ) {
1618 global $wgRequest, $wgUser;
 19+
1720 $this->setHeaders();
1821 $this->skin = $wgUser->getSkin();
1922 $this->currentUnixTS = wfTimestamp( TS_UNIX ); // now
20 - # Read params
 23+
2124 $this->namespace = $wgRequest->getIntOrNull( 'namespace' );
2225 $this->level = $wgRequest->getInt( 'level', - 1 );
23 - $this->category = trim( $wgRequest->getVal( 'category' ) );
24 - $catTitle = Title::makeTitleSafe( NS_CATEGORY, $this->category );
 26+ $category = trim( $wgRequest->getVal( 'category' ) );
 27+ $catTitle = Title::makeTitleSafe( NS_CATEGORY, $category );
2528 $this->category = is_null( $catTitle ) ? '' : $catTitle->getText();
2629 $this->size = $wgRequest->getIntOrNull( 'size' );
2730 $this->watched = $wgRequest->getCheck( 'watched' );
2831 $this->stable = $wgRequest->getCheck( 'stable' );
2932 $feedType = $wgRequest->getVal( 'feed' );
 33+ if ( $this->including() ) {
 34+ $incLimit = $this->parseParams( $par ); // apply non-URL params
 35+ }
 36+
 37+ $this->pager = new PendingChangesPager( $this, $this->namespace,
 38+ $this->level, $this->category, $this->size, $this->watched, $this->stable );
 39+
3040 # Output appropriate format...
3141 if ( $feedType != null ) {
3242 $this->feed( $feedType );
3343 } else {
34 - if ( !$this->including() ) {
 44+ if ( $this->including() ) {
 45+ $this->pager->setLimit( $incLimit ); // apply non-URL limit
 46+ } else {
3547 $this->setSyndicated();
3648 $this->showForm();
3749 }
38 - $this->showList( $par );
 50+ $this->showPageList();
3951 }
4052 }
4153
@@ -51,14 +63,14 @@
5264
5365 public function showForm() {
5466 global $wgUser, $wgOut, $wgScript;
55 - $action = htmlspecialchars( $wgScript );
56 - # Explanation text...
57 - $wgOut->addWikiMsg( 'pendingchanges-list' );
58 - $form =
59 - "<form action=\"$action\" method=\"get\">\n" .
60 - '<fieldset><legend>' . wfMsg( 'pendingchanges-legend' ) . '</legend>' .
61 - Html::hidden( 'title', $this->getTitle()->getPrefixedDBKey() );
 67+ # Explanatory text
 68+ $wgOut->addWikiMsg( 'pendingchanges-list', $this->pager->getNumRows() );
6269
 70+ $form = Html::openElement( 'form', array( 'name' => 'pendingchanges',
 71+ 'action' => $wgScript, 'method' => 'get' ) ) . "\n";
 72+ $form .= "<fieldset><legend>" . wfMsgHtml( 'pendingchanges-legend' ) . "</legend>\n";
 73+ $form .= Html::hidden( 'title', $this->getTitle()->getPrefixedDBKey() ) . "\n";
 74+
6375 $items = array();
6476 if ( count( FlaggedRevs::getReviewNamespaces() ) > 1 ) {
6577 $items[] = "<span style='white-space: nowrap;'>" .
@@ -77,6 +89,7 @@
7890 if ( $items ) {
7991 $form .= implode( ' ', $items ) . '<br />';
8092 }
 93+
8194 $items = array();
8295 $items[] =
8396 Xml::label( wfMsg( "pendingchanges-category" ), 'wpCategory' ) . '&#160;' .
@@ -89,42 +102,35 @@
90103 $form .=
91104 Xml::label( wfMsg( 'pendingchanges-size' ), 'wpSize' ) .
92105 Xml::input( 'size', 4, $this->size, array( 'id' => 'wpSize' ) ) . ' ' .
93 - Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" .
94 - "</fieldset></form>";
 106+ Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n";
 107+ $form .= "</fieldset>";
 108+ $form .= Html::closeElement( 'form' ) . "\n";
 109+
95110 $wgOut->addHTML( $form );
96111 }
97112
98 - public function showList( $par ) {
 113+ public function showPageList() {
99114 global $wgOut;
100 - $limit = false; // defer to Pager
101 - if ( $this->including() ) {
102 - $limit = $this->parseParams( $par );
103 - }
104 - $pager = new PendingChangesPager( $this, $this->namespace, $this->level,
105 - $this->category, $this->size, $this->watched, $this->stable );
106 - // Apply limit if transcluded
107 - if ( $limit ) $pager->mLimit = $limit;
108115 // Viewing the list normally...
109116 if ( !$this->including() ) {
110 - if ( $pager->getNumRows() ) {
111 - $wgOut->addHTML( $pager->getNavigationBar() );
112 - $wgOut->addHTML( $pager->getBody() );
113 - $wgOut->addHTML( $pager->getNavigationBar() );
 117+ if ( $this->pager->getNumRows() ) {
 118+ $wgOut->addHTML( $this->pager->getNavigationBar() );
 119+ $wgOut->addHTML( $this->pager->getBody() );
 120+ $wgOut->addHTML( $this->pager->getNavigationBar() );
114121 } else {
115122 $wgOut->addWikiMsg( 'pendingchanges-none' );
116123 }
117124 // If this list is transcluded...
118125 } else {
119 - if ( $pager->getNumRows() ) {
120 - $wgOut->addHTML( $pager->getBody() );
 126+ if ( $this->pager->getNumRows() ) {
 127+ $wgOut->addHTML( $this->pager->getBody() );
121128 } else {
122129 $wgOut->addWikiMsg( 'pendingchanges-none' );
123130 }
124131 }
125132 }
126133
127 - // set namespace and category fields of $this
128 - // @returns int paging limit
 134+ // set pager parameters from $par, return pager limit
129135 protected function parseParams( $par ) {
130136 global $wgLang;
131137 $bits = preg_split( '/\s*,\s*/', trim( $par ) );
@@ -155,7 +161,7 @@
156162 * @param string $type
157163 */
158164 protected function feed( $type ) {
159 - global $wgFeed, $wgFeedClasses, $wgFeedLimit, $wgOut, $wgRequest;
 165+ global $wgFeed, $wgFeedClasses, $wgFeedLimit, $wgOut;
160166 if ( !$wgFeed ) {
161167 $wgOut->addWikiMsg( 'feed-unavailable' );
162168 return;
@@ -169,13 +175,11 @@
170176 wfMsg( 'tagline' ),
171177 $this->getTitle()->getFullUrl()
172178 );
173 - $pager = new PendingChangesPager( $this, $this->namespace, $this->category );
174 - $limit = $wgRequest->getInt( 'limit', 50 );
175 - $pager->mLimit = min( $wgFeedLimit, $limit );
 179+ $this->pager->mLimit = min( $wgFeedLimit, $this->pager->mLimit );
176180
177181 $feed->outHeader();
178 - if ( $pager->getNumRows() > 0 ) {
179 - foreach ( $pager->mResult as $row ) {
 182+ if ( $this->pager->getNumRows() > 0 ) {
 183+ foreach ( $this->pager->mResult as $row ) {
180184 $feed->outItem( $this->feedItem( $row ) );
181185 }
182186 }
@@ -211,14 +215,15 @@
212216 public function formatRow( $row ) {
213217 global $wgLang, $wgUser;
214218 $css = $quality = $underReview = '';
215 -
216219 $title = Title::newFromRow( $row );
217 - $link = $this->skin->makeKnownLinkObj( $title );
218 - $hist = $this->skin->makeKnownLinkObj( $title,
219 - wfMsgHtml( 'hist' ), 'action=history' );
220220 $stxt = ChangesList::showCharacterDifference( $row->rev_len, $row->page_len );
221 - $review = $this->skin->makeKnownLinkObj( $title,
 221+ # Page links...
 222+ $link = $this->skin->link( $title );
 223+ $hist = $this->skin->linkKnown( $title,
 224+ wfMsgHtml( 'hist' ), array(), 'action=history' );
 225+ $review = $this->skin->linkKnown( $title,
222226 wfMsg( 'pendingchanges-diff' ),
 227+ array(),
223228 'diff=cur&oldid='.intval($row->stable).'&diffonly=0' );
224229 # Show quality level if there are several
225230 if ( FlaggedRevs::qualityVersions() ) {
@@ -283,9 +288,11 @@
284289 * Query to list out outdated reviewed pages
285290 */
286291 class PendingChangesPager extends AlphabeticPager {
287 - public $mForm, $mConds;
288 - private $category, $namespace;
 292+ public $mForm;
 293+ protected $category, $namespace;
289294
 295+ const PAGE_LIMIT = 100; // Don't get too expensive
 296+
290297 function __construct( $form, $namespace, $level = - 1, $category = '',
291298 $size = null, $watched = false, $stable = false )
292299 {
@@ -309,12 +316,17 @@
310317 $this->watched = (bool)$watched;
311318 $this->stable = $stable && !FlaggedRevs::isStableShownByDefault()
312319 && !FlaggedRevs::useOnlyIfProtected();
 320+
313321 parent::__construct();
314 - // Don't get too expensive
 322+ # Don't get too expensive
315323 $this->mLimitsShown = array( 20, 50, 100 );
316 - $this->mLimit = min( $this->mLimit, 100 );
 324+ $this->setLimit( $this->mLimit ); // apply max limit
317325 }
318326
 327+ function setLimit( $limit ) {
 328+ $this->mLimit = min( $limit, self::PAGE_LIMIT );
 329+ }
 330+
319331 function formatRow( $row ) {
320332 return $this->mForm->formatRow( $row );
321333 }
@@ -331,7 +343,6 @@
332344
333345 function getQueryInfo() {
334346 global $wgUser;
335 - $conds = $this->mConds;
336347 $tables = array( 'page', 'revision' );
337348 $fields = array( 'page_namespace', 'page_title', 'page_len', 'rev_len', 'page_latest' );
338349 # Show outdated "stable" versions
@@ -411,6 +422,14 @@
412423 }
413424
414425 function getStartBody() {
 426+ wfProfileIn( __METHOD__ );
 427+ # Do a link batch query
 428+ $lb = new LinkBatch();
 429+ foreach ( $this->mResult as $row ) {
 430+ $lb->add( $row->page_namespace, $row->page_title );
 431+ }
 432+ $lb->execute();
 433+ wfProfileOut( __METHOD__ );
415434 return '<ul>';
416435 }
417436
Index: trunk/extensions/FlaggedRevs/specialpages/UnreviewedPages_body.php
@@ -6,99 +6,115 @@
77
88 class UnreviewedPages extends SpecialPage
99 {
 10+ protected $pager = null;
 11+
1012 public function __construct() {
1113 parent::__construct( 'UnreviewedPages', 'unreviewedpages' );
1214 }
1315
1416 public function execute( $par ) {
1517 global $wgRequest, $wgUser, $wgOut;
 18+
1619 $this->setHeaders();
1720 if ( !$wgUser->isAllowed( 'unreviewedpages' ) ) {
1821 $wgOut->permissionRequired( 'unreviewedpages' );
1922 return;
2023 }
2124 $this->skin = $wgUser->getSkin();
22 - $this->showList( $wgRequest );
23 - }
2425
25 - protected function showList( $wgRequest ) {
26 - global $wgOut, $wgScript;
 26+ # Get default namespace
2727 $namespaces = FlaggedRevs::getReviewNamespaces();
2828 $defaultNS = !$namespaces ? NS_MAIN : $namespaces[0];
29 -
30 - $namespace = $wgRequest->getIntOrNull( 'namespace', $defaultNS );
 29+
 30+ $this->namespace = $wgRequest->getIntOrNull( 'namespace', $defaultNS );
3131 $category = trim( $wgRequest->getVal( 'category' ) );
3232 $catTitle = Title::makeTitleSafe( NS_CATEGORY, $category );
33 - $category = is_null( $catTitle ) ? '' : $catTitle->getText();
34 - $level = $wgRequest->getInt( 'level' );
35 - $hideRedirs = $wgRequest->getBool( 'hideredirs', true );
36 -
37 - // show/hide links
 33+ $this->category = is_null( $catTitle ) ? '' : $catTitle->getText();
 34+ $this->level = $wgRequest->getInt( 'level' );
 35+ $this->hideRedirs = $wgRequest->getBool( 'hideredirs', true );
 36+ $this->live = self::generalQueryOK();
 37+
 38+ $this->pager = new UnreviewedPagesPager( $this, $this->live,
 39+ $this->namespace, !$this->hideRedirs, $this->category, $this->level );
 40+
 41+ $this->showForm();
 42+ $this->showPageList();
 43+ }
 44+
 45+ protected function showForm() {
 46+ global $wgOut, $wgLang, $wgScript;
 47+ # Add explanatory text
 48+ $wgOut->addWikiMsg( 'unreviewedpages-list', $this->pager->getNumRows() );
 49+
 50+ # show/hide links
3851 $showhide = array( wfMsgHtml( 'show' ), wfMsgHtml( 'hide' ) );
39 - $onoff = 1 - $hideRedirs;
 52+ $onoff = 1 - $this->hideRedirs;
4053 $link = $this->skin->link( $this->getTitle(), $showhide[$onoff], array(),
41 - array( 'hideredirs' => $onoff, 'category' => $category, 'namespace' => $namespace )
 54+ array( 'hideredirs' => $onoff, 'category' => $this->category,
 55+ 'namespace' => $this->namespace )
4256 );
4357 $showhideredirs = wfMsgHtml( 'whatlinkshere-hideredirs', $link );
4458
45 - # Add explanatory text
46 - $wgOut->addWikiMsg( 'unreviewedpages-list' );
4759 # Add form...
48 - $action = htmlspecialchars( $wgScript );
49 - $wgOut->addHTML( "<form action=\"$action\" method=\"get\">\n" .
50 - '<fieldset><legend>' . wfMsg( 'unreviewedpages-legend' ) . '</legend>' .
51 - Html::hidden( 'title', $this->getTitle()->getPrefixedDBKey() ) . '<p>' );
 60+ $form = Html::openElement( 'form', array( 'name' => 'unreviewedpages',
 61+ 'action' => $wgScript, 'method' => 'get' ) ) . "\n";
 62+ $form .= "<fieldset><legend>" . wfMsg( 'unreviewedpages-legend' ) . "</legend>\n";
 63+ $form .= Html::hidden( 'title', $this->getTitle()->getPrefixedDBKey() ) . "\n";
5264 # Add dropdowns as needed
53 - if ( count( $namespaces ) > 1 ) {
54 - $wgOut->addHTML( FlaggedRevsXML::getNamespaceMenu( $namespace ) . '&#160;' );
 65+ if ( count( FlaggedRevs::getReviewNamespaces() ) > 1 ) {
 66+ $form .= FlaggedRevsXML::getNamespaceMenu( $this->namespace ) . '&#160;';
5567 }
5668 if ( FlaggedRevs::qualityVersions() ) {
57 - $wgOut->addHTML( FlaggedRevsXML::getLevelMenu( $level, false, 1 ) . '&#160;' );
 69+ $form .= FlaggedRevsXML::getLevelMenu( $this->level, false, 1 ) . '&#160;';
5870 }
59 - $wgOut->addHTML(
 71+ $form .=
6072 "<span style='white-space: nowrap;'>" .
6173 Xml::label( wfMsg( "unreviewedpages-category" ), 'category' ) . '&#160;' .
62 - Xml::input( 'category', 30, $category, array( 'id' => 'category' ) ) .
63 - '</span><br />' .
64 - $showhideredirs . '&#160;&#160;' .
65 - Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "</p>\n" .
66 - "</fieldset></form>"
67 - );
68 - # This will start to get slower if live...
69 - if ( !$live = self::generalQueryOK() ) {
 74+ Xml::input( 'category', 30, $this->category, array( 'id' => 'category' ) ) .
 75+ '</span><br />';
 76+ $form .= $showhideredirs . '&#160;&#160;';
 77+ $form .= Xml::submitButton( wfMsg( 'allpagessubmit' ) );
 78+ $form .= '</fieldset>';
 79+ $form .= Html::closeElement( 'form' ) . "\n";
 80+
 81+ # Query may get too slow to be live...
 82+ if ( !$this->live ) {
7083 $dbr = wfGetDB( DB_SLAVE );
7184 $ts = $dbr->selectField( 'querycache_info', 'qci_timestamp',
7285 array( 'qci_type' => 'fr_unreviewedpages' ), __METHOD__ );
7386 if ( $ts ) {
74 - global $wgLang;
7587 $ts = wfTimestamp( TS_MW, $ts );
7688 $td = $wgLang->timeanddate( $ts );
7789 $d = $wgLang->date( $ts );
7890 $t = $wgLang->time( $ts );
79 - $wgOut->addHTML( wfMsg( 'perfcachedts', $td, $d, $t ) );
 91+ $form .= wfMsgExt( 'perfcachedts', 'parse', $td, $d, $t );
8092 } else {
81 - $wgOut->addHTML( wfMsg( 'perfcached' ) );
 93+ $form .= wfMsgExt( 'perfcached', 'parse' );
8294 }
8395 }
84 - $pager = new UnreviewedPagesPager(
85 - $this, $live, $namespace, !$hideRedirs, $category, $level );
86 - if ( $pager->getNumRows() ) {
87 - $wgOut->addHTML( $pager->getNavigationBar() );
88 - $wgOut->addHTML( $pager->getBody() );
89 - $wgOut->addHTML( $pager->getNavigationBar() );
 96+
 97+ $wgOut->addHTML( $form );
 98+ }
 99+
 100+ protected function showPageList() {
 101+ global $wgOut;
 102+ if ( $this->pager->getNumRows() ) {
 103+ $wgOut->addHTML( $this->pager->getNavigationBar() );
 104+ $wgOut->addHTML( $this->pager->getBody() );
 105+ $wgOut->addHTML( $this->pager->getNavigationBar() );
90106 } else {
91107 $wgOut->addWikiMsg( 'unreviewedpages-none' );
92108 }
93109 }
94 -
 110+
95111 public function formatRow( $row ) {
96112 global $wgLang, $wgUser;
 113+ $title = Title::newFromRow( $row );
97114
98115 $stxt = $underReview = $watching = '';
99 - $title = Title::newFromRow( $row );
100 - $link = $this->skin->makeKnownLinkObj( $title, null, 'redirect=no&reviewing=1' );
101 - $hist = $this->skin->makeKnownLinkObj( $title, wfMsgHtml( 'hist' ),
102 - 'action=history&reviewing=1' );
 116+ $link = $this->skin->link( $title, null, array(), 'redirect=no&reviewing=1' );
 117+ $hist = $this->skin->linkKnown( $title, wfMsgHtml( 'hist' ),
 118+ array(), 'action=history&reviewing=1' );
103119 if ( !is_null( $size = $row->page_len ) ) {
104120 $stxt = ( $size == 0 )
105121 ? wfMsgHtml( 'historyempty' )
@@ -113,11 +129,13 @@
114130 // After three days, just use days
115131 if ( $hours > ( 3 * 24 ) ) {
116132 $days = round( $hours / 24, 0 );
117 - $age = ' ' . wfMsgExt( 'unreviewedpages-days', 'parsemag', $wgLang->formatNum( $days ) );
 133+ $age = ' ' . wfMsgExt( 'unreviewedpages-days',
 134+ 'parsemag', $wgLang->formatNum( $days ) );
118135 // If one or more hours, use hours
119136 } elseif ( $hours >= 1 ) {
120137 $hours = round( $hours, 0 );
121 - $age = ' ' . wfMsgExt( 'unreviewedpages-hours', 'parsemag', $wgLang->formatNum( $hours ) );
 138+ $age = ' ' . wfMsgExt( 'unreviewedpages-hours',
 139+ 'parsemag', $wgLang->formatNum( $hours ) );
122140 } else {
123141 $age = ' ' . wfMsg( 'unreviewedpages-recent' ); // hot off the press :)
124142 }
@@ -180,9 +198,11 @@
181199 * Query to list out unreviewed pages
182200 */
183201 class UnreviewedPagesPager extends AlphabeticPager {
184 - public $mForm, $mConds;
185 - private $live, $namespace, $category, $showredirs;
 202+ public $mForm;
 203+ protected $live, $namespace, $category, $showredirs;
186204
 205+ const PAGE_LIMIT = 50; // Don't get too expensive
 206+
187207 function __construct(
188208 $form, $live, $namespace, $redirs = false, $category = null, $level = 0
189209 ) {
@@ -204,9 +224,13 @@
205225 parent::__construct();
206226 // Don't get too expensive
207227 $this->mLimitsShown = array( 20, 50 );
208 - $this->mLimit = min( $this->mLimit, 50 );
 228+ $this->setLimit( $this->mLimit ); // apply max limit
209229 }
210230
 231+ function setLimit( $limit ) {
 232+ $this->mLimit = min( $limit, self::PAGE_LIMIT );
 233+ }
 234+
211235 function formatRow( $row ) {
212236 return $this->mForm->formatRow( $row );
213237 }
@@ -215,7 +239,6 @@
216240 if ( !$this->live ) {
217241 return $this->getQueryCacheInfo();
218242 }
219 - $conds = $this->mConds;
220243 $fields = array( 'page_namespace', 'page_title', 'page_len', 'page_id',
221244 'MIN(rev_timestamp) AS creation' );
222245 # Filter by level
@@ -325,6 +348,14 @@
326349 }
327350
328351 function getStartBody() {
 352+ wfProfileIn( __METHOD__ );
 353+ # Do a link batch query
 354+ $lb = new LinkBatch();
 355+ foreach ( $this->mResult as $row ) {
 356+ $lb->add( $row->page_namespace, $row->page_title );
 357+ }
 358+ $lb->execute();
 359+ wfProfileOut( __METHOD__ );
329360 return '<ul>';
330361 }
331362
Index: trunk/extensions/FlaggedRevs/specialpages/ConfiguredPages_body.php
@@ -7,6 +7,8 @@
88 // Assumes $wgFlaggedRevsProtection is off
99 class ConfiguredPages extends SpecialPage
1010 {
 11+ protected $pager = null;
 12+
1113 public function __construct() {
1214 parent::__construct( 'ConfiguredPages' );
1315 }
@@ -21,13 +23,18 @@
2224 $this->override = $wgRequest->getIntOrNull( 'stable' );
2325 $this->autoreview = $wgRequest->getVal( 'restriction', '' );
2426
 27+ $this->pager = new ConfiguredPagesPager(
 28+ $this, array(), $this->namespace, $this->override, $this->autoreview );
 29+
2530 $this->showForm();
2631 $this->showPageList();
2732 }
2833
2934 protected function showForm() {
3035 global $wgOut, $wgScript;
31 - $wgOut->addWikiMsg( 'configuredpages-list' );
 36+ # Explanatory text
 37+ $wgOut->addWikiMsg( 'configuredpages-list', $this->pager->getNumRows() );
 38+
3239 $fields = array();
3340 # Namespace selector
3441 if ( count( FlaggedRevs::getReviewNamespaces() ) > 1 ) {
@@ -36,46 +43,47 @@
3744 # Default version selector
3845 $fields[] = FlaggedRevsXML::getDefaultFilterMenu( $this->override );
3946 # Restriction level selector
40 - if( FlaggedRevs::getRestrictionLevels() ) {
 47+ if ( FlaggedRevs::getRestrictionLevels() ) {
4148 $fields[] = FlaggedRevsXML::getRestrictionFilterMenu( $this->autoreview );
4249 }
43 - if ( count( $fields ) ) {
44 - $form = Xml::openElement( 'form',
45 - array( 'name' => 'configuredpages', 'action' => $wgScript, 'method' => 'get' ) );
46 - $form .= Html::hidden( 'title', $this->getTitle()->getPrefixedDBKey() );
47 - $form .= "<fieldset><legend>" . wfMsg( 'configuredpages' ) . "</legend>\n";
48 - $form .= implode( '&#160;', $fields ) . '<br/>';
49 - $form .= Xml::submitButton( wfMsg( 'go' ) );
50 - $form .= "</fieldset>\n";
51 - $form .= Xml::closeElement( 'form' );
52 - $wgOut->addHTML( $form );
53 - }
 50+
 51+ $form = Html::openElement( 'form',
 52+ array( 'name' => 'configuredpages', 'action' => $wgScript, 'method' => 'get' ) );
 53+ $form .= Html::hidden( 'title', $this->getTitle()->getPrefixedDBKey() );
 54+ $form .= "<fieldset><legend>" . wfMsg( 'configuredpages' ) . "</legend>\n";
 55+ $form .= implode( '&#160;', $fields ) . '<br/>';
 56+ $form .= Xml::submitButton( wfMsg( 'go' ) );
 57+ $form .= "</fieldset>\n";
 58+ $form .= Html::closeElement( 'form' ) . "\n";
 59+
 60+ $wgOut->addHTML( $form );
5461 }
5562
5663 protected function showPageList() {
5764 global $wgOut;
58 - $pager = new ConfiguredPagesPager( $this, array(),
59 - $this->namespace, $this->override, $this->autoreview );
60 - if ( $pager->getNumRows() ) {
61 - $wgOut->addHTML( $pager->getNavigationBar() );
62 - $wgOut->addHTML( $pager->getBody() );
63 - $wgOut->addHTML( $pager->getNavigationBar() );
 65+ if ( $this->pager->getNumRows() ) {
 66+ $wgOut->addHTML( $this->pager->getNavigationBar() );
 67+ $wgOut->addHTML( $this->pager->getBody() );
 68+ $wgOut->addHTML( $this->pager->getNavigationBar() );
6469 } else {
6570 $wgOut->addWikiMsg( 'configuredpages-none' );
6671 }
67 - # Take this opportunity to purge out expired configurations
68 - FlaggedPageConfig::purgeExpiredConfigurations();
 72+ # Purge expired entries on one in every 10 queries
 73+ if ( !mt_rand( 0, 10 ) ) {
 74+ FlaggedPageConfig::purgeExpiredConfigurations();
 75+ }
6976 }
7077
7178 public function formatRow( $row ) {
7279 global $wgLang;
73 - $title = Title::makeTitle( $row->page_namespace, $row->page_title );
 80+ $title = Title::newFromRow( $row );
7481 # Link to page
75 - $link = $this->skin->makeKnownLinkObj( $title, $title->getPrefixedText() );
 82+ $link = $this->skin->link( $title );
7683 # Link to page configuration
77 - $config = $this->skin->makeKnownLinkObj(
 84+ $config = $this->skin->linkKnown(
7885 SpecialPage::getTitleFor( 'Stabilization' ),
7986 wfMsgHtml( 'configuredpages-config' ),
 87+ array(),
8088 'page=' . $title->getPrefixedUrl()
8189 );
8290 # Show which version is the default (stable or draft)
@@ -101,7 +109,8 @@
102110 } else {
103111 $expiry_description = "";
104112 }
105 - return "<li>{$link} ({$config}) <b>[$default]</b> {$restr}<i>{$expiry_description}</i></li>";
 113+ return "<li>{$link} ({$config}) <b>[$default]</b> " .
 114+ "{$restr}<i>{$expiry_description}</i></li>";
106115 }
107116 }
108117
@@ -111,12 +120,12 @@
112121 class ConfiguredPagesPager extends AlphabeticPager {
113122 public $mForm, $mConds, $namespace, $override, $autoreview;
114123
115 - // @param int $namespace (null for "all")
116 - // @param int $override (null for "either")
117 - // @param string $autoreview ('' for "all", 'none' for no restriction)
118 - function __construct(
119 - $form, $conds = array(), $namespace, $override, $autoreview
120 - ) {
 124+ /*
 125+ * @param int $namespace (null for "all")
 126+ * @param int $override (null for "either")
 127+ * @param string $autoreview ('' for "all", 'none' for no restriction)
 128+ */
 129+ function __construct( $form, $conds = array(), $namespace, $override, $autoreview ) {
121130 $this->mForm = $form;
122131 $this->mConds = $conds;
123132 # Must be content pages...
@@ -171,7 +180,7 @@
172181 function getIndexField() {
173182 return 'fpc_page_id';
174183 }
175 -
 184+
176185 function getStartBody() {
177186 wfProfileIn( __METHOD__ );
178187 # Do a link batch query
Index: trunk/extensions/FlaggedRevs/specialpages/ProblemChanges_body.php
@@ -6,6 +6,8 @@
77
88 class ProblemChanges extends SpecialPage
99 {
 10+ protected $pager = null;
 11+
1012 public function __construct() {
1113 parent::__construct( 'ProblemChanges' );
1214 $this->includable( true );
@@ -13,19 +15,34 @@
1416
1517 public function execute( $par ) {
1618 global $wgRequest, $wgUser;
 19+
1720 $this->setHeaders();
1821 $this->skin = $wgUser->getSkin();
1922 $this->level = $wgRequest->getInt( 'level', - 1 );
2023 $this->tag = trim( $wgRequest->getVal( 'tagfilter' ) );
21 - $this->category = trim( $wgRequest->getVal( 'category' ) );
22 - $catTitle = Title::newFromText( $this->category );
 24+ $category = trim( $wgRequest->getVal( 'category' ) );
 25+ $catTitle = Title::newFromText( $category );
2326 $this->category = is_null( $catTitle ) ? '' : $catTitle->getText();
2427 $feedType = $wgRequest->getVal( 'feed' );
25 - if ( $feedType ) {
26 - return $this->feed( $feedType );
 28+ if ( $this->including() ) {
 29+ $incLimit = $this->parseParams( $par ); // apply non-URL params
2730 }
28 - $this->setSyndicated();
29 - $this->showList( $par );
 31+
 32+ $this->pager = new ProblemChangesPager(
 33+ $this, $this->level, $this->category, $this->tag );
 34+
 35+ # Output appropriate format...
 36+ if ( $feedType != null ) {
 37+ $this->feed( $feedType );
 38+ } else {
 39+ if ( $this->including() ) {
 40+ $this->pager->setLimit( $incLimit ); // apply non-URL limit
 41+ } else {
 42+ $this->setSyndicated();
 43+ $this->showForm();
 44+ }
 45+ $this->showPageList();
 46+ }
3047 }
3148
3249 protected function setSyndicated() {
@@ -39,60 +56,59 @@
4057 $wgOut->setFeedAppendQuery( wfArrayToCGI( $queryParams ) );
4158 }
4259
43 - public function showList( $par ) {
 60+ public function showForm() {
4461 global $wgOut, $wgScript;
4562 // Add explanatory text
46 - $wgOut->addWikiMsg( 'problemchanges-list' );
47 - $limit = $this->parseParams( $par );
48 - $pager = new ProblemChangesPager( $this, $this->level, $this->category, $this->tag );
49 - // Apply limit if transcluded
50 - $pager->mLimit = $limit ? $limit : $pager->mLimit;
 63+ $wgOut->addWikiMsg( 'problemchanges-list', $this->pager->getNumRows() );
 64+
 65+ $form = Html::openElement( 'form', array( 'name' => 'problemchanges',
 66+ 'action' => $wgScript, 'method' => 'get' ) ) . "\n";
 67+ $form .= "<fieldset><legend>" . wfMsg( 'problemchanges-legend' ) . "</legend>\n";
 68+ $form .= Html::hidden( 'title', $this->getTitle()->getPrefixedDBKey() ) . "\n";
 69+ $form .=
 70+ ( FlaggedRevs::qualityVersions()
 71+ ? "<span style='white-space: nowrap;'>" .
 72+ FlaggedRevsXML::getLevelMenu( $this->level, 'revreview-filter-stable' ) .
 73+ '</span> '
 74+ : ""
 75+ );
 76+ $tagForm = ChangeTags::buildTagFilterSelector( $this->tag );
 77+ if ( count( $tagForm ) ) {
 78+ $form .= Xml::tags( 'td', array( 'class' => 'mw-label' ), $tagForm[0] );
 79+ $form .= Xml::tags( 'td', array( 'class' => 'mw-input' ), $tagForm[1] );
 80+ }
 81+ $form .= '<br />' .
 82+ Xml::label( wfMsg( "problemchanges-category" ), 'wpCategory' ) . '&#160;' .
 83+ Xml::input( 'category', 30, $this->category, array( 'id' => 'wpCategory' ) ) . ' ';
 84+ $form .= Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n";
 85+ $form .= '</fieldset>';
 86+ $form .= Html::closeElement( 'form' ) . "\n";
 87+
 88+ $wgOut->addHTML( $form );
 89+ }
 90+
 91+ public function showPageList() {
 92+ global $wgOut;
5193 // Viewing the page normally...
5294 if ( !$this->including() ) {
53 - $action = htmlspecialchars( $wgScript );
54 - $tagForm = ChangeTags::buildTagFilterSelector( $this->tag );
55 - $wgOut->addHTML(
56 - "<form action=\"$action\" method=\"get\">\n" .
57 - '<fieldset><legend>' . wfMsg( 'problemchanges-legend' ) . '</legend>' .
58 - Html::hidden( 'title', $this->getTitle()->getPrefixedDBKey() )
59 - );
60 - $form =
61 - ( FlaggedRevs::qualityVersions()
62 - ? "<span style='white-space: nowrap;'>" .
63 - FlaggedRevsXML::getLevelMenu( $this->level, 'revreview-filter-stable' ) .
64 - '</span> '
65 - : ""
66 - );
67 - if ( count( $tagForm ) ) {
68 - $form .= Xml::tags( 'td', array( 'class' => 'mw-label' ), $tagForm[0] );
69 - $form .= Xml::tags( 'td', array( 'class' => 'mw-input' ), $tagForm[1] );
70 - }
71 - $form .= '<br />' .
72 - Xml::label( wfMsg( "problemchanges-category" ), 'wpCategory' ) . '&#160;' .
73 - Xml::input( 'category', 30, $this->category,
74 - array( 'id' => 'wpCategory' ) ) . ' ';
75 - $form .= Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" .
76 - "</fieldset></form>";
77 - # Add filter options
78 - $wgOut->addHTML( $form );
79 - # Add list output
80 - if ( $pager->getNumRows() ) {
81 - $wgOut->addHTML( $pager->getNavigationBar() );
82 - $wgOut->addHTML( $pager->getBody() );
83 - $wgOut->addHTML( $pager->getNavigationBar() );
 95+ if ( $this->pager->getNumRows() ) {
 96+ $wgOut->addHTML( $this->pager->getNavigationBar() );
 97+ $wgOut->addHTML( $this->pager->getBody() );
 98+ $wgOut->addHTML( $this->pager->getNavigationBar() );
8499 } else {
85100 $wgOut->addWikiMsg( 'problemchanges-none' );
86101 }
87102 // If this page is transcluded...
88103 } else {
89 - if ( $pager->getNumRows() ) {
90 - $wgOut->addHTML( $pager->getBody() );
 104+ if ( $this->pager->getNumRows() ) {
 105+ $wgOut->addHTML( $this->pager->getBody() );
91106 } else {
92107 $wgOut->addWikiMsg( 'problemchanges-none' );
93108 }
94109 }
95110 }
96 -
 111+
 112+ // set pager parameters from $par, return pager limit
97113 protected function parseParams( $par ) {
98114 $bits = preg_split( '/\s*,\s*/', trim( $par ) );
99115 $limit = false;
@@ -115,30 +131,25 @@
116132 * @param string $type
117133 */
118134 protected function feed( $type ) {
119 - global $wgFeed, $wgFeedClasses, $wgRequest;
 135+ global $wgFeed, $wgFeedClasses, $wgFeedLimit, $wgOut;
120136 if ( !$wgFeed ) {
121 - global $wgOut;
122137 $wgOut->addWikiMsg( 'feed-unavailable' );
123138 return;
124139 }
125140 if ( !isset( $wgFeedClasses[$type] ) ) {
126 - global $wgOut;
127141 $wgOut->addWikiMsg( 'feed-invalid' );
128142 return;
129143 }
130144 $feed = new $wgFeedClasses[$type](
131145 $this->feedTitle(),
132146 wfMsg( 'tagline' ),
133 - $this->getTitle()->getFullUrl() );
 147+ $this->getTitle()->getFullUrl()
 148+ );
 149+ $this->pager->mLimit = min( $wgFeedLimit, $this->pager->mLimit );
134150
135 - $pager = new ProblemChangesPager( $this, $this->category );
136 - $limit = $wgRequest->getInt( 'limit', 50 );
137 - global $wgFeedLimit;
138 - $pager->mLimit = min( $wgFeedLimit, $limit );
139 -
140151 $feed->outHeader();
141 - if ( $pager->getNumRows() > 0 ) {
142 - foreach ( $pager->mResult as $row ) {
 152+ if ( $this->pager->getNumRows() > 0 ) {
 153+ foreach ( $this->pager->mResult as $row ) {
143154 $feed->outItem( $this->feedItem( $row ) );
144155 }
145156 }
@@ -177,9 +188,10 @@
178189 $css = $quality = $tags = $underReview = '';
179190
180191 $title = Title::newFromRow( $row );
181 - $link = $this->skin->makeKnownLinkObj( $title );
182 - $review = $this->skin->makeKnownLinkObj( $title,
 192+ $link = $this->skin->link( $title );
 193+ $review = $this->skin->knownLink( $title,
183194 wfMsg( 'pendingchanges-diff' ),
 195+ array(),
184196 'diff=cur&oldid=' . intval($row->stable) . '&diffonly=0' );
185197 # Show quality level if there are several
186198 if ( FlaggedRevs::qualityVersions() ) {
@@ -272,9 +284,11 @@
273285 * Query to list out outdated reviewed pages
274286 */
275287 class ProblemChangesPager extends AlphabeticPager {
276 - public $mForm, $mConds;
277 - private $category, $namespace, $tag;
 288+ public $mForm;
 289+ protected $category, $namespace, $tag;
278290
 291+ const PAGE_LIMIT = 100; // Don't get too expensive
 292+
279293 function __construct( $form, $level = - 1, $category = '', $tag = '' )
280294 {
281295 $this->mForm = $form;
@@ -287,9 +301,13 @@
288302 parent::__construct();
289303 // Don't get to expensive
290304 $this->mLimitsShown = array( 20, 50, 100 );
291 - $this->mLimit = min( $this->mLimit, 100 );
 305+ $this->setLimit( $this->mLimit ); // apply max limit
292306 }
293307
 308+ function setLimit( $limit ) {
 309+ $this->mLimit = min( $limit, self::PAGE_LIMIT );
 310+ }
 311+
294312 function formatRow( $row ) {
295313 return $this->mForm->formatRow( $row );
296314 }
@@ -300,7 +318,6 @@
301319
302320 function getQueryInfo() {
303321 global $wgOldChangeTagsIndex;
304 - $conds = $this->mConds;
305322 $tables = array( 'revision', 'change_tag', 'page' );
306323 $fields = array( 'page_namespace' , 'page_title', 'page_latest' );
307324 $ctIndex = $wgOldChangeTagsIndex ?
Index: trunk/extensions/FlaggedRevs/specialpages/ReviewedPages_body.php
@@ -6,6 +6,8 @@
77
88 class ReviewedPages extends SpecialPage
99 {
 10+ protected $pager = null;
 11+
1012 public function __construct() {
1113 parent::__construct( 'ReviewedPages' );
1214 }
@@ -18,11 +20,15 @@
1921
2022 # Check if there is a featured level
2123 $maxType = FlaggedRevs::pristineVersions() ? 2 : 1;
 24+
2225 $this->namespace = $wgRequest->getInt( 'namespace' );
2326 $this->type = $wgRequest->getInt( 'level', - 1 );
2427 $this->type = min( $this->type, $maxType );
2528 $this->hideRedirs = $wgRequest->getBool( 'hideredirs', true );
26 -
 29+
 30+ $this->pager = new ReviewedPagesPager(
 31+ $this, array(), $this->type, $this->namespace, $this->hideRedirs );
 32+
2733 $this->showForm();
2834 $this->showPageList();
2935 }
@@ -32,9 +38,9 @@
3339
3440 // Text to explain level select (if there are several levels)
3541 if ( FlaggedRevs::qualityVersions() ) {
36 - $wgOut->addWikiMsg( 'reviewedpages-list' );
 42+ $wgOut->addWikiMsg( 'reviewedpages-list', $this->pager->getNumRows() );
3743 }
38 - $form = Xml::openElement( 'form',
 44+ $form = Html::openElement( 'form',
3945 array( 'name' => 'reviewedpages', 'action' => $wgScript, 'method' => 'get' ) );
4046 $form .= "<fieldset><legend>" . wfMsgHtml( 'reviewedpages-leg' ) . "</legend>\n";
4147
@@ -60,22 +66,20 @@
6167 if ( count( $fields ) ) {
6268 $form .= " " . Xml::submitButton( wfMsg( 'go' ) );
6369 }
64 - $form .= Html::hidden( 'title', $this->getTitle()->getPrefixedDBKey() );
65 - $form .= "</fieldset></form>\n";
 70+ $form .= Html::hidden( 'title', $this->getTitle()->getPrefixedDBKey() ) . "\n";
 71+ $form .= "</fieldset>";
 72+ $form .= Html::closeElement( 'form ' ) . "\n";
6673
6774 $wgOut->addHTML( $form );
6875 }
6976
7077 protected function showPageList() {
7178 global $wgOut;
72 -
73 - $pager = new ReviewedPagesPager( $this, array(), $this->type,
74 - $this->namespace, $this->hideRedirs );
75 - $num = $pager->getNumRows();
 79+ $num = $this->pager->getNumRows();
7680 if ( $num ) {
77 - $wgOut->addHTML( $pager->getNavigationBar() );
78 - $wgOut->addHTML( $pager->getBody() );
79 - $wgOut->addHTML( $pager->getNavigationBar() );
 81+ $wgOut->addHTML( $this->pager->getNavigationBar() );
 82+ $wgOut->addHTML( $this->pager->getBody() );
 83+ $wgOut->addHTML( $this->pager->getNavigationBar() );
8084 } else {
8185 $wgOut->addHTML( wfMsgExt( 'reviewedpages-none', array( 'parse' ) ) );
8286 }
@@ -83,30 +87,34 @@
8488
8589 public function formatRow( $row ) {
8690 global $wgLang;
87 -
88 - $title = Title::makeTitle( $row->page_namespace, $row->page_title );
89 - $link = $this->skin->makeKnownLinkObj( $title, $title->getPrefixedText() );
90 -
 91+ $title = Title::newFromRow( $row );
 92+ # Link to page
 93+ $link = $this->skin->link( $title );
 94+ # Size (bytes)
9195 $stxt = '';
9296 if ( !is_null( $size = $row->page_len ) ) {
93 - if ( $size == 0 )
 97+ if ( $size == 0 ) {
9498 $stxt = ' <small>' . wfMsgHtml( 'historyempty' ) . '</small>';
95 - else
96 - $stxt = ' <small>' . wfMsgExt( 'historysize', 'parsemag',
97 - $wgLang->formatNum( $size ) ) . '</small>';
 99+ } else {
 100+ $stxt = ' <small>' .
 101+ wfMsgExt( 'historysize', 'parsemag', $wgLang->formatNum( $size ) ) .
 102+ '</small>';
 103+ }
98104 }
99 -
100 - $list = $this->skin->makeKnownLinkObj(
 105+ # Link to list of reviewed versions for page
 106+ $list = $this->skin->linkKnown(
101107 SpecialPage::getTitleFor( 'ReviewedVersions' ),
102108 wfMsgHtml( 'reviewedpages-all' ),
 109+ array(),
103110 'page=' . $title->getPrefixedUrl()
104111 );
105 -
 112+ # Link to highest tier rev
106113 $best = '';
107114 if ( FlaggedRevs::qualityVersions() ) {
108 - $best = $this->skin->makeKnownLinkObj(
 115+ $best = $this->skin->linkKnown(
109116 $title,
110117 wfMsgHtml( 'reviewedpages-best' ),
 118+ array(),
111119 'stableid=best'
112120 );
113121 $best = " [$best]";
Index: trunk/extensions/FlaggedRevs/specialpages/StablePages_body.php
@@ -7,6 +7,8 @@
88 // Assumes $wgFlaggedRevsProtection is on
99 class StablePages extends SpecialPage
1010 {
 11+ protected $pager = null;
 12+
1113 public function __construct() {
1214 parent::__construct( 'StablePages' );
1315 }
@@ -21,51 +23,53 @@
2224 $this->autoreview = $wgRequest->getVal( 'restriction', '' );
2325 $this->indef = $wgRequest->getBool( 'indef', false );
2426
 27+ $this->pager = new StablePagesPager( $this, array(),
 28+ $this->namespace, $this->autoreview, $this->indef );
 29+
2530 $this->showForm();
2631 $this->showPageList();
2732 }
2833
2934 protected function showForm() {
3035 global $wgOut, $wgScript;
31 - $wgOut->addWikiMsg( 'stablepages-list' );
 36+ $wgOut->addWikiMsg( 'stablepages-list', $this->pager->getNumRows() );
3237 $fields = array();
3338 # Namespace selector
3439 if ( count( FlaggedRevs::getReviewNamespaces() ) > 1 ) {
3540 $fields[] = FlaggedRevsXML::getNamespaceMenu( $this->namespace, '' );
3641 }
3742 # Restriction level selector
38 - if( FlaggedRevs::getRestrictionLevels() ) {
 43+ if ( FlaggedRevs::getRestrictionLevels() ) {
3944 $fields[] = FlaggedRevsXML::getRestrictionFilterMenu( $this->autoreview );
4045 }
4146 $fields[] = Xml::checkLabel( wfMsg( 'stablepages-indef' ), 'indef',
4247 'stablepages-indef', $this->indef );
43 - # Use form if it has options
44 - if ( count( $fields ) ) {
45 - $form = Xml::openElement( 'form',
46 - array( 'name' => 'stablepages', 'action' => $wgScript, 'method' => 'get' ) );
47 - $form .= Html::hidden( 'title', $this->getTitle()->getPrefixedDBKey() );
48 - $form .= "<fieldset><legend>" . wfMsg( 'stablepages' ) . "</legend>\n";
49 - $form .= implode( '&#160;', $fields ) . '&nbsp';
50 - $form .= " " . Xml::submitButton( wfMsg( 'go' ) );
51 - $form .= "</fieldset>\n";
52 - $form .= Xml::closeElement( 'form' );
53 - $wgOut->addHTML( $form );
54 - }
 48+
 49+ $form = Html::openElement( 'form',
 50+ array( 'name' => 'stablepages', 'action' => $wgScript, 'method' => 'get' ) );
 51+ $form .= Html::hidden( 'title', $this->getTitle()->getPrefixedDBKey() );
 52+ $form .= "<fieldset><legend>" . wfMsg( 'stablepages' ) . "</legend>\n";
 53+ $form .= implode( '&#160;', $fields ) . '&nbsp';
 54+ $form .= " " . Xml::submitButton( wfMsg( 'go' ) );
 55+ $form .= "</fieldset>\n";
 56+ $form .= Html::closeElement( 'form' ) . "\n";
 57+
 58+ $wgOut->addHTML( $form );
5559 }
5660
5761 protected function showPageList() {
5862 global $wgOut;
59 - $pager = new StablePagesPager(
60 - $this, array(), $this->namespace, $this->autoreview, $this->indef );
61 - if ( $pager->getNumRows() ) {
62 - $wgOut->addHTML( $pager->getNavigationBar() );
63 - $wgOut->addHTML( $pager->getBody() );
64 - $wgOut->addHTML( $pager->getNavigationBar() );
 63+ if ( $this->pager->getNumRows() ) {
 64+ $wgOut->addHTML( $this->pager->getNavigationBar() );
 65+ $wgOut->addHTML( $this->pager->getBody() );
 66+ $wgOut->addHTML( $this->pager->getNavigationBar() );
6567 } else {
6668 $wgOut->addWikiMsg( 'stablepages-none' );
6769 }
68 - # Take this opportunity to purge out expired configurations
69 - FlaggedPageConfig::purgeExpiredConfigurations();
 70+ # Purge expired entries on one in every 10 queries
 71+ if ( !mt_rand( 0, 10 ) ) {
 72+ FlaggedPageConfig::purgeExpiredConfigurations();
 73+ }
7074 }
7175
7276 public function formatRow( $row ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r84447* Follow-up r84446: use formatNum()...aaron14:49, 21 March 2011
r84539Followup for r84446 and r84447 making some check for variables optional.purodha17:31, 22 March 2011

Status & tagging log