Index: branches/wmf/1.16wmf4/includes/api/ApiBase.php |
— | — | @@ -57,6 +57,7 @@ |
58 | 58 | const LIMIT_SML2 = 500; // Slow query, bot/sysop limit |
59 | 59 | |
60 | 60 | private $mMainModule, $mModuleName, $mModulePrefix; |
| 61 | + private $mParamCache = array(); |
61 | 62 | |
62 | 63 | /** |
63 | 64 | * Constructor |
— | — | @@ -472,16 +473,20 @@ |
473 | 474 | * @return array |
474 | 475 | */ |
475 | 476 | public function extractRequestParams( $parseLimit = true ) { |
476 | | - $params = $this->getFinalParams(); |
477 | | - $results = array(); |
| 477 | + // Cache parameters, for performance and to avoid bug 24564. |
| 478 | + if ( !isset( $this->mParamCache[$parseLimit] ) ) { |
| 479 | + $params = $this->getFinalParams(); |
| 480 | + $results = array(); |
478 | 481 | |
479 | | - if($params) { /* getFinalParams() can return false */ |
480 | | - foreach ( $params as $paramName => $paramSettings ) { |
481 | | - $results[$paramName] = $this->getParameterFromSettings( $paramName, $paramSettings, $parseLimit ); |
| 482 | + if($params) { /* getFinalParams() can return false */ |
| 483 | + foreach ( $params as $paramName => $paramSettings ) { |
| 484 | + $results[$paramName] = $this->getParameterFromSettings( |
| 485 | + $paramName, $paramSettings, $parseLimit ); |
| 486 | + } |
482 | 487 | } |
| 488 | + $this->mParamCache[$parseLimit] = $results; |
483 | 489 | } |
484 | | - |
485 | | - return $results; |
| 490 | + return $this->mParamCache[$parseLimit]; |
486 | 491 | } |
487 | 492 | |
488 | 493 | /** |
Property changes on: branches/wmf/1.16wmf4/includes/api/ApiBase.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
489 | 494 | Merged /branches/wmf-deployment/includes/api/ApiBase.php:r53381,59952,60970 |
490 | 495 | Merged /branches/REL1_15/phase3/includes/api/ApiBase.php:r51646 |
491 | 496 | Merged /branches/sqlite/includes/api/ApiBase.php:r58211-58321 |
492 | 497 | Merged /trunk/phase3/includes/api/ApiBase.php:r63549,63764,63897-63901,64454,66486,70062 |