From: Roan Kattouw Date: Thu, 17 Sep 2009 19:39:34 +0000 (+0000) Subject: API: Per CR comments on r56091, make the timeout for the API help cache configurable X-Git-Tag: 1.31.0-rc.0~39664 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=commitdiff_plain;h=ef4886778ffa2fccb99e190f822c1191deafd16e;p=lhc%2Fweb%2Fwiklou.git API: Per CR comments on r56091, make the timeout for the API help cache configurable --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 3997a1fef3..5367619d12 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -3880,6 +3880,12 @@ $wgAPIRequestLog = false; */ $wgAPICacheHelp = true; +/** + * Set the timeout for the API help text cache. Ignored if $wgAPICacheHelp + * is false. + */ +$wgAPICacheHelpTimeout = 60*60; + /** * Parser test suite files to be run by parserTests.php when no specific * filename is passed to it. diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index 63f90dab43..6867193d25 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -555,7 +555,7 @@ class ApiMain extends ApiBase { * Override the parent to generate help messages for all available modules. */ public function makeHelpMsg() { - global $wgMemc, $wgAPICacheHelp; + global $wgMemc, $wgAPICacheHelp, $wgAPICacheHelpTimeout; $this->mPrinter->setHelp(); // Get help text from cache if present $key = wfMemcKey( 'apihelp', $this->getModuleName(), @@ -568,7 +568,7 @@ class ApiMain extends ApiBase { } $retval = $this->reallyMakeHelpMsg(); if ( $wgAPICacheHelp ) - $wgMemc->set( $key, $retval, 60*60 ); + $wgMemc->set( $key, $retval, $wgAPICacheHelpTimeout ); return $retval; }