// Deprecated parameters
if ( isset( $prop['hasrelated'] ) ) {
- $this->logFeatureUsage( 'action=search&srprop=hasrelated' );
- $this->setWarning( 'srprop=hasrelated has been deprecated' );
+ $this->addDeprecation(
+ [ 'apiwarn-deprecation-parameter', 'srprop=hasrelated' ], 'action=search&srprop=hasrelated'
+ );
}
if ( isset( $prop['score'] ) ) {
- $this->logFeatureUsage( 'action=search&srprop=score' );
- $this->setWarning( 'srprop=score has been deprecated' );
+ $this->addDeprecation(
+ [ 'apiwarn-deprecation-parameter', 'srprop=score' ], 'action=search&srprop=score'
+ );
}
// Create search engine instance and set options
$status
);
} else {
- $this->dieUsage( $status->getWikiText( false, false, 'en' ), 'search-error' );
+ $this->dieStatus( $status );
}
} elseif ( is_null( $matches ) ) {
- $this->dieUsage( "{$what} search is disabled", "search-{$what}-disabled" );
+ $this->dieWithError( [ 'apierror-searchdisabled', $what ], "search-{$what}-disabled" );
}
if ( $resultPageSet === null ) {