API: Per CR comments on r56091, make the timeout for the API help cache configurable
authorRoan Kattouw <catrope@users.mediawiki.org>
Thu, 17 Sep 2009 19:39:34 +0000 (19:39 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Thu, 17 Sep 2009 19:39:34 +0000 (19:39 +0000)
includes/DefaultSettings.php
includes/api/ApiMain.php

index 3997a1f..5367619 100644 (file)
@@ -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.
index 63f90da..6867193 100644 (file)
@@ -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;
        }