* @return array
*/
public function extractRequestParams( $parseLimit = true ) {
- $params = $this->getFinalParams();
- $results = array();
+ if ( !isset( $this->mCachedRequestParams ) ) {
+ $params = $this->getFinalParams();
+ $this->mCachedRequestParams = array();
- if ( $params ) { // getFinalParams() can return false
- foreach ( $params as $paramName => $paramSettings ) {
- $results[$paramName] = $this->getParameterFromSettings( $paramName, $paramSettings, $parseLimit );
+ if ( $params ) { // getFinalParams() can return false
+ foreach ( $params as $paramName => $paramSettings ) {
+ $this->mCachedRequestParams[$paramName] = $this->getParameterFromSettings( $paramName, $paramSettings, $parseLimit );
+ }
}
}
- return $results;
+ return $this->mCachedRequestParams;
}
/**
/**
* Create a generator object of the given type and return it
+ * @param $generatorName string Module name
*/
public function newGenerator( $generatorName ) {
// Find class that implements requested generator
}
/**
- * Get the cache mode for the data generated by this module. Override this
- * in the module subclass.
+ * Get the cache mode for the data generated by this module. Override
+ * this in the module subclass. For possible return values and other
+ * details about cache modes, see ApiMain::setCacheMode()
*
* Public caching will only be allowed if *all* the modules that supply
* data for a given request return a cache mode of public.