Index: trunk/phase3/includes/api/ApiMain.php |
— | — | @@ -555,15 +555,19 @@ |
556 | 556 | * Override the parent to generate help messages for all available modules. |
557 | 557 | */ |
558 | 558 | public function makeHelpMsg() { |
559 | | - global $wgMemc; |
| 559 | + global $wgMemc, $wgAPICacheHelp; |
560 | 560 | $this->mPrinter->setHelp(); |
561 | 561 | // Get help text from cache if present |
562 | | - $key = wfMemcKey( 'apihelp', $this->getModuleName() ); |
563 | | - $cached = $wgMemc->get( $key ); |
564 | | - if ( $cached ) |
565 | | - return $cached; |
| 562 | + $key = wfMemcKey( 'apihelp', $this->getModuleName(), |
| 563 | + SpecialVersion::getVersion( 'nodb' ) ); |
| 564 | + if ( $wgAPICacheHelp ) { |
| 565 | + $cached = $wgMemc->get( $key ); |
| 566 | + if ( $cached ) |
| 567 | + return $cached; |
| 568 | + } |
566 | 569 | $retval = $this->reallyMakeHelpMsg(); |
567 | | - $wgMemc->set( $key, $retval, 60*60 ); |
| 570 | + if ( $wgAPICacheHelp ) |
| 571 | + $wgMemc->set( $key, $retval, 60*60 ); |
568 | 572 | return $retval; |
569 | 573 | } |
570 | 574 | |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -3846,6 +3846,12 @@ |
3847 | 3847 | $wgAPIRequestLog = false; |
3848 | 3848 | |
3849 | 3849 | /** |
| 3850 | + * Cache the API help text for up to an hour. Disable this during API |
| 3851 | + * debugging and development |
| 3852 | + */ |
| 3853 | +$wgAPICacheHelp = true; |
| 3854 | + |
| 3855 | +/** |
3850 | 3856 | * Parser test suite files to be run by parserTests.php when no specific |
3851 | 3857 | * filename is passed to it. |
3852 | 3858 | * |