API: Log all deprecated parameter uses to api-feature-usage.log
[lhc/web/wiklou.git] / includes / api / ApiBase.php
index 1465543..4f9a94d 100644 (file)
@@ -986,6 +986,17 @@ abstract class ApiBase extends ContextSource {
                        // Set a warning if a deprecated parameter has been passed
                        if ( $deprecated && $value !== false ) {
                                $this->setWarning( "The $encParamName parameter has been deprecated." );
+
+                               $feature = $encParamName;
+                               $m = $this;
+                               while ( !$m->isMain() ) {
+                                       $p = $m->getParent();
+                                       $name = $m->getModuleName();
+                                       $param = $p->encodeParamName( $p->getModuleManager()->getModuleGroup( $name ) );
+                                       $feature = "{$param}={$name}&{$feature}";
+                                       $m = $p;
+                               }
+                               $this->logFeatureUsage( $feature );
                        }
                } elseif ( $required ) {
                        $this->dieUsageMsg( array( 'missingparam', $paramName ) );