* (bug 11142) Improve file extension blacklist error reporting in API upload.
* (bug 39635) PostgreSQL LOCK IN SHARE MODE option is a syntax error.
* (bug 36329) Accesskey tooltips for Firefox 14 on Mac should use "ctrl-option-" prefix.
+* (bug 39665) Cache AllowedGenerator array so it doesn't autoload all query classes
+ on every request.
=== Languages updated in 1.20 ===
parent::__construct( $main, $action );
// Allow custom modules to be added in LocalSettings.php
- global $wgAPIPropModules, $wgAPIListModules, $wgAPIMetaModules;
+ global $wgAPIPropModules, $wgAPIListModules, $wgAPIMetaModules,
+ $wgMemc, $wgAPICacheHelpTimeout;
self::appendUserModules( $this->mQueryPropModules, $wgAPIPropModules );
self::appendUserModules( $this->mQueryListModules, $wgAPIListModules );
self::appendUserModules( $this->mQueryMetaModules, $wgAPIMetaModules );
$this->mListModuleNames = array_keys( $this->mQueryListModules );
$this->mMetaModuleNames = array_keys( $this->mQueryMetaModules );
+ // Get array of query generators from cache if present
+ $key = wfMemcKey( 'apiquerygenerators', SpecialVersion::getVersion( 'nodb' ) );
+
+ if ( $wgAPICacheHelpTimeout > 0 ) {
+ $cached = $wgMemc->get( $key );
+ if ( $cached ) {
+ $this->mAllowedGenerators = $cached;
+ return;
+ }
+ }
$this->makeGeneratorList( $this->mQueryPropModules );
$this->makeGeneratorList( $this->mQueryListModules );
+
+ if ( $wgAPICacheHelpTimeout > 0 ) {
+ $wgMemc->set( $key, $this->mAllowedGenerators, $wgAPICacheHelpTimeout );
+ }
}
/**