// 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 ) );
// Deprecated parameters
if ( $params['watch'] ) {
- $this->logFeatureUsage( 'action=delete&watch' );
$watch = 'watch';
} elseif ( $params['unwatch'] ) {
- $this->logFeatureUsage( 'action=delete&unwatch' );
$watch = 'unwatch';
} else {
$watch = $params['watchlist'];
// Deprecated parameters
if ( $params['watch'] ) {
- $this->logFeatureUsage( 'action=edit&watch' );
$watch = true;
} elseif ( $params['unwatch'] ) {
- $this->logFeatureUsage( 'action=edit&unwatch' );
$watch = false;
}
$retval = array();
if ( isset( $prop['parsetree'] ) || $params['generatexml'] ) {
- if ( !isset( $prop['parsetree'] ) ) {
- $this->logFeatureUsage( 'action=expandtemplates&generatexml' );
- }
-
$wgParser->startExternalParse( $title_obj, $options, Parser::OT_PREPROCESS );
$dom = $wgParser->preprocessToDom( $params['text'] );
if ( is_callable( array( $dom, 'saveXML' ) ) ) {
$watch = $params['watchlist'];
} elseif ( $params['watch'] ) {
$watch = 'watch';
- $this->logFeatureUsage( 'action=move&watch' );
} elseif ( $params['unwatch'] ) {
$watch = 'unwatch';
- $this->logFeatureUsage( 'action=move&unwatch' );
}
// Watch pages
}
if ( is_array( $params['querymodules'] ) ) {
- $this->logFeatureUsage( 'action=paraminfo&querymodules' );
$queryModules = $params['querymodules'];
foreach ( $queryModules as $m ) {
$modules[] = 'query+' . $m;
}
if ( is_array( $params['formatmodules'] ) ) {
- $this->logFeatureUsage( 'action=paraminfo&formatmodules' );
$formatModules = $params['formatmodules'];
foreach ( $formatModules as $m ) {
$modules[] = $m;
}
if ( $params['mainmodule'] ) {
- $this->logFeatureUsage( 'action=paraminfo&mainmodule' );
$res['mainmodule'] = $this->getModuleInfo( $this->getMain() );
}
if ( $params['pagesetmodule'] ) {
- $this->logFeatureUsage( 'action=paraminfo&pagesetmodule' );
$pageSet = new ApiPageSet( $this->getMain()->getModuleManager()->getModule( 'query' ) );
$res['pagesetmodule'] = $this->getModuleInfo( $pageSet );
unset( $res['pagesetmodule']['name'] );
}
if ( isset( $prop['parsetree'] ) || $params['generatexml'] ) {
- if ( !isset( $prop['parsetree'] ) ) {
- $this->logFeatureUsage( 'action=parse&generatexml' );
- }
if ( $this->content->getModel() != CONTENT_MODEL_WIKITEXT ) {
$this->dieUsage( "parsetree is only supported for wikitext content", "notwikitext" );
}
$cascade = $params['cascade'];
- if ( $params['watch'] ) {
- $this->logFeatureUsage( 'action=protect&watch' );
- }
$watch = $params['watch'] ? 'watch' : $params['watchlist'];
$this->setWatch( $watch, $titleObj, 'watchdefault' );
}
$startsortkey = pack( 'H*', $params['starthexsortkey'] );
} else {
- if ( $params['startsortkey'] !== null ) {
- $this->logFeatureUsage( 'list=categorymembers&cmstartsortkey' );
- }
$startsortkey = $params['startsortkey'];
}
if ( $params['endsortkeyprefix'] !== null ) {
}
$endsortkey = pack( 'H*', $params['endhexsortkey'] );
} else {
- if ( $params['endsortkey'] !== null ) {
- $this->logFeatureUsage( 'list=categorymembers&cmendsortkey' );
- }
$endsortkey = $params['endsortkey'];
}
// Handle deprecated param
$this->requireMaxOneParameter( $params, 'url', 'prop' );
if ( $params['url'] ) {
- $this->logFeatureUsage( 'prop=iwlinks&iwurl' );
$prop = array( 'url' => 1 );
}
// Handle deprecated param
$this->requireMaxOneParameter( $params, 'url', 'prop' );
if ( $params['url'] ) {
- $this->logFeatureUsage( 'prop=langlinks&llurl' );
$prop = array( 'url' => 1 );
}
$this->requireMaxOneParameter( $params, 'filterredir', 'redirect' );
}
- if ( $params['redirect'] ) {
- $this->logFeatureUsage( "list=random&rnredirect=" );
- }
-
if ( isset( $params['continue'] ) ) {
$cont = explode( '|', $params['continue'] );
$this->dieContinueUsageIf( count( $cont ) != 4 );
}
}
if ( $this->fld_parsetree || ( $this->fld_content && $this->generateXML ) ) {
- if ( !$this->fld_parsetree ) {
- $this->logFeatureUsage( 'action=query&prop=revisions+base&generatexml' );
- }
if ( $content ) {
if ( $content->getModel() === CONTENT_MODEL_WIKITEXT ) {
$t = $content->getNativeData(); # note: don't set $text
// Alias sessionkey to filekey, but give an existing filekey precedence.
if ( !$params['filekey'] && $params['sessionkey'] ) {
- $this->logFeatureUsage( 'prop=stashimageinfo&siisessionkey' );
$params['filekey'] = $params['sessionkey'];
}
$show = $this->params['show'];
if ( $this->params['toponly'] ) { // deprecated/old param
- $this->logFeatureUsage( 'list=usercontribs&uctoponly' );
$show[] = 'top';
}
if ( !is_null( $show ) ) {
// Copy the session key to the file key, for backward compatibility.
if ( !$this->mParams['filekey'] && $this->mParams['sessionkey'] ) {
- $this->logFeatureUsage( 'action=upload&sessionkey' );
$this->mParams['filekey'] = $this->mParams['sessionkey'];
}
// Deprecated parameters
if ( $this->mParams['watch'] ) {
- $this->logFeatureUsage( 'action=upload&watch' );
$watch = true;
}
);
}
- $this->logFeatureUsage( 'action=watch&title' );
$title = Title::newFromText( $params['title'] );
if ( !$title || !$title->isWatchable() ) {
$this->dieUsageMsg( array( 'invalidtitle', $params['title'] ) );