r87575 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87574‎ | r87575 | r87576 >
Date:20:47, 6 May 2011
Author:tparscal
Status:resolved (Comments)
Tags:
Comment:
Added squid updateer upon rating, which purges the API call made by the ArticleFeedback frontend to get ratings for a page. I'm pretty sure this is right, but I have not tested it on a squid yet.
Modified paths:
  • /trunk/extensions/ArticleFeedback/api/ApiArticleFeedback.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedback/api/ApiArticleFeedback.php
@@ -75,6 +75,16 @@
7676
7777 $this->insertProperties( $revisionId, $wgUser, $token, $params );
7878
 79+ $squidUpdate = new SquidUpdate( array( wfAppendQuery( 'api.php', array(
 80+ 'action' => 'query',
 81+ 'format' => 'json',
 82+ 'list' => 'articlefeedback',
 83+ 'afpageid' => $pageId,
 84+ 'afanontoken' => '',
 85+ 'afuserrating' => 0
 86+ ) ) ) );
 87+ $squidUpdate->doUpdate();
 88+
7989 wfRunHooks( 'ArticleFeedbackChangeRating', array( $params ) );
8090
8191 $r = array( 'result' => 'Success' );

Follow-up revisions

RevisionCommit summaryAuthorDate
r87585using wfScript() instead of hard-coding api.php, which also gets us the right...tparscal21:52, 6 May 2011

Comments

#Comment by Trevor Parscal (WMF) (talk | contribs)   21:04, 6 May 2011

I'm pretty sure I need to specify the server name and path to api.php, but getLocalURL() doesn't seem to support building local URLs for api.php. Also technically the php part is configurable, so that might need to get changed too.

#Comment by Brion VIBBER (talk | contribs)   21:06, 6 May 2011

wfScript( 'api' ) will do it...

which btw would probably be awesome if it took a second parameter that was a query string or array to build into a query string :D

Status & tagging log