r69928 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69927‎ | r69928 | r69929 >
Date:06:00, 26 July 2010
Author:tstarling
Status:ok
Tags:
Comment:
Fixes for r69784:
* Removed the attempt to make ApiFeedLQTThreads public: broken by incorrectly overriding setCacheMode() instead of getCacheMode(), but fixing that doesn't make it publically cache either. It turns out that all modules which use ApiFormatFeedWrapper are forced to be private, because ApiFormatFeedWrapper calls OutputPage::sendCacheControl(), which overrides any CC headers sent by ApiMain::sendCacheHeaders(), sending CC:private instead.
* In ApiQueryOldreviewedpages.php: Fixed typo "getCachedMode" instead of getCacheMode
* In ApiFlagConfig.php: only query modules have a getCacheMode() to override, base modules must call $this->getMain()->setCacheMode().
Modified paths:
  • /trunk/extensions/FlaggedRevs/api/ApiFlagConfig.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/api/ApiQueryOldreviewedpages.php (modified) (history)
  • /trunk/extensions/LiquidThreads/api/ApiFeedLQTThreads.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/api/ApiFeedLQTThreads.php
@@ -204,10 +204,6 @@
205205 return $conds;
206206 }
207207
208 - public function setCacheMode( $params ) {
209 - return 'public';
210 - }
211 -
212208 public function getAllowedParams() {
213209 global $wgFeedClasses;
214210 $feedFormatNames = array_keys( $wgFeedClasses );
Index: trunk/extensions/FlaggedRevs/api/ApiFlagConfig.php
@@ -29,6 +29,7 @@
3030 class ApiFlagConfig extends ApiBase {
3131
3232 public function execute() {
 33+ $this->getMain()->setCacheMode( 'public' );
3334 global $wgFlaggedRevTags;
3435 $data = array();
3536 foreach ( $wgFlaggedRevTags as $tag => $params ) {
@@ -44,10 +45,6 @@
4546 $result->addValue( null, $this->getModuleName(), $data );
4647 }
4748
48 - public function getCacheMode( $params ) {
49 - return 'public';
50 - }
51 -
5249 public function mustBePosted() {
5350 return false;
5451 }
Index: trunk/extensions/FlaggedRevs/api/ApiQueryOldreviewedpages.php
@@ -149,7 +149,7 @@
150150 }
151151 }
152152
153 - public function getCachedMode( $params ) {
 153+ public function getCacheMode( $params ) {
154154 if ( $params['filterwatched'] == 'watched' ) {
155155 // Private data
156156 return 'private';

Follow-up revisions

RevisionCommit summaryAuthorDate
r69932* MFT r69776, and followups r69784, r69928, r69931, and superseded base revis...tstarling08:03, 26 July 2010
r70061Brought the API cache header handling into sync with the REL1_16 branch, by r...tstarling02:01, 28 July 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r69784Followup to r69776: remove calls to setCachePrivate() and setVaryCookie() fro...catrope11:17, 23 July 2010

Status & tagging log