r87730 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87729‎ | r87730 | r87731 >
Date:16:37, 9 May 2011
Author:tparscal
Status:ok (Comments)
Tags:
Comment:
Added maxage=0 and smaxage= to the ApiQueryArticleFeedback call and cache purge.
Modified paths:
  • /trunk/extensions/ArticleFeedback/ArticleFeedback.hooks.php (modified) (history)
  • /trunk/extensions/ArticleFeedback/ArticleFeedback.php (modified) (history)
  • /trunk/extensions/ArticleFeedback/api/ApiArticleFeedback.php (modified) (history)
  • /trunk/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedback/ArticleFeedback.hooks.php
@@ -230,11 +230,13 @@
231231 * ResourceLoaderGetConfigVars hook
232232 */
233233 public static function resourceLoaderGetConfigVars( &$vars ) {
234 - global $wgArticleFeedbackCategories,
 234+ global $wgArticleFeedbackSMaxage,
 235+ $wgArticleFeedbackCategories,
235236 $wgArticleFeedbackLotteryOdds,
236237 $wgArticleFeedbackTracking,
237238 $wgArticleFeedbackOptions,
238239 $wgArticleFeedbackNamespaces;
 240+ $vars['wgArticleFeedbackSMaxage'] = $wgArticleFeedbackSMaxage;
239241 $vars['wgArticleFeedbackCategories'] = $wgArticleFeedbackCategories;
240242 $vars['wgArticleFeedbackLotteryOdds'] = $wgArticleFeedbackLotteryOdds;
241243 $vars['wgArticleFeedbackTracking'] = $wgArticleFeedbackTracking;
Index: trunk/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js
@@ -338,7 +338,9 @@
339339 'list': 'articlefeedback',
340340 'afpageid': mw.config.get( 'wgArticleId' ),
341341 'afanontoken': userrating ? mw.user.id() : '',
342 - 'afuserrating': Number( userrating )
 342+ 'afuserrating': Number( userrating ),
 343+ 'maxage': 0,
 344+ 'smaxage': mw.config.get( 'wgArticleFeedbackSMaxage' )
343345 },
344346 'success': function( data ) {
345347 var context = this;
Index: trunk/extensions/ArticleFeedback/api/ApiArticleFeedback.php
@@ -5,7 +5,7 @@
66 }
77
88 public function execute() {
9 - global $wgUser, $wgArticleFeedbackRatings;
 9+ global $wgUser, $wgArticleFeedbackRatings, $wgArticleFeedbackSMaxage;
1010 $params = $this->extractRequestParams();
1111
1212 if ( $wgUser->isAnon() ) {
@@ -80,7 +80,9 @@
8181 'list' => 'articlefeedback',
8282 'afpageid' => $pageId,
8383 'afanontoken' => '',
84 - 'afuserrating' => 0
 84+ 'afuserrating' => 0,
 85+ 'maxage' => 0,
 86+ 'smaxage' => $wgArticleFeedbackSMaxage
8587 ) ) ) );
8688 $squidUpdate->doUpdate();
8789
Index: trunk/extensions/ArticleFeedback/ArticleFeedback.php
@@ -15,6 +15,9 @@
1616
1717 /* Configuration */
1818
 19+// How long to keep ratings in the squids (they will also be purged when needed)
 20+$wgArticleFeedbackSMaxage = 25920000;
 21+
1922 // Enable/disable dashboard page
2023 $wgArticleFeedbackDashboard = false;
2124

Follow-up revisions

RevisionCommit summaryAuthorDate
r87732ArticleFeedback: Fix r87730, set smaxage to 30 days not 300catrope16:42, 9 May 2011

Comments

#Comment by Awjrichards (talk | contribs)   16:41, 9 May 2011

+$wgArticleFeedbackSMaxage = 25920000;

Should be: $wgArticleFeedbackSMaxage = 2592000;

Status & tagging log