r101321 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101320‎ | r101321 | r101322 >
Date:22:37, 30 October 2011
Author:jamesur
Status:ok
Tags:
Comment:
adding caching for fundraiser landing page extension with default 5 minutes
Modified paths:
  • /trunk/extensions/FundraiserLandingPage/FundraiserLandingPage.body.php (modified) (history)
  • /trunk/extensions/FundraiserLandingPage/FundraiserLandingPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FundraiserLandingPage/FundraiserLandingPage.php
@@ -41,4 +41,8 @@
4242 'template' => 'Lp-wrapper',
4343 'appeal' => 'Appeal-default',
4444 'form' => 'Form-default'
45 -);
\ No newline at end of file
 45+);
 46+
 47+// Adding configurrable variable for caching time
 48+$wgFundraiserLandingPageMaxAge = 300; //5 minutes
 49+
Index: trunk/extensions/FundraiserLandingPage/FundraiserLandingPage.body.php
@@ -12,10 +12,11 @@
1313 }
1414
1515 function execute( $par ) {
16 - global $wgFundraiserLPDefaults;
17 -
 16+ global $wgFundraiserLPDefaults, $wgOut, $wgFundraiserLandingPageMaxAge;
 17+
 18+ #Set squid age
 19+ $wgOut->setSquidMaxage($wgFundraiserLandingPageMaxAge);
1820 $request = $this->getRequest();
19 - $this->setHeaders();
2021
2122 # clear output variable to be safe
2223 $output = '';
@@ -47,6 +48,7 @@
4849 $this->getOutput()->addWikiText( $output );
4950 }
5051
 52+
5153 /**
5254 * This function limits the possible charactes passed as template keys and
5355 * values to letters, numbers, hypens and underscores. The function also
@@ -64,4 +66,5 @@
6567 }
6668 return '';
6769 }
68 -}
\ No newline at end of file
 70+}
 71+

Follow-up revisions

RevisionCommit summaryAuthorDate
r101323followup from r101321 reset setHeaders()jamesur22:59, 30 October 2011

Status & tagging log