MediaWiki r56559 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r56558‎ | r56559 (on ViewVC)‎ | r56560 >
Date:19:39, 17 September 2009
Author:catrope
Status:ok (Comments)
Tags:todo 
Comment:
API: Per CR comments on r56091, make the timeout for the API help cache configurable
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/api/ApiMain.php
===================================================================
--- trunk/phase3/includes/api/ApiMain.php	(revision 56558)
+++ trunk/phase3/includes/api/ApiMain.php	(revision 56559)
@@ -555,7 +555,7 @@
 	 * 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 @@
 		}
 		$retval = $this->reallyMakeHelpMsg();
 		if ( $wgAPICacheHelp )
-			$wgMemc->set( $key, $retval, 60*60 );
+			$wgMemc->set( $key, $retval, $wgAPICacheHelpTimeout );
 		return $retval;
 	}
 	
Index: trunk/phase3/includes/DefaultSettings.php
===================================================================
--- trunk/phase3/includes/DefaultSettings.php	(revision 56558)
+++ trunk/phase3/includes/DefaultSettings.php	(revision 56559)
@@ -3881,6 +3881,12 @@
 $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.
  *

Comments

#Comment by Nikerabbit (Talk | contribs)   06:08, 18 September 2009

Can't we go with just one variable for this?

Status & tagging log

Personal tools
Namespaces
Variants
Views
Actions
Site
Support
Download
Development
Communication
Toolbox