X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryStashImageInfo.php;h=be6f66968b07a27ab37fde06e00ba7dc40b7a5b2;hb=239b0c772a3cf4dc2160e2c36c2813cd705adb50;hp=d7904d4ad98b3226b1f87a6818ba6f2bcb8ddb8b;hpb=3b07da886220352c3e393ec09b0c674b3968d5ad;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryStashImageInfo.php b/includes/api/ApiQueryStashImageInfo.php index d7904d4ad9..be6f66968b 100644 --- a/includes/api/ApiQueryStashImageInfo.php +++ b/includes/api/ApiQueryStashImageInfo.php @@ -47,6 +47,7 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo { // Alias sessionkey to filekey, but give an existing filekey precedence. if ( !$params['filekey'] && $params['sessionkey'] ) { + $this->logFeatureUsage( 'prop=stashimageinfo&siisessionkey' ); $params['filekey'] = $params['sessionkey']; } @@ -93,46 +94,32 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo { ), 'urlwidth' => array( ApiBase::PARAM_TYPE => 'integer', - ApiBase::PARAM_DFLT => -1 + ApiBase::PARAM_DFLT => -1, + ApiBase::PARAM_HELP_MSG => array( + 'apihelp-query+imageinfo-param-urlwidth', + ApiQueryImageInfo::TRANSFORM_LIMIT, + ), ), 'urlheight' => array( ApiBase::PARAM_TYPE => 'integer', - ApiBase::PARAM_DFLT => -1 + ApiBase::PARAM_DFLT => -1, + ApiBase::PARAM_HELP_MSG => 'apihelp-query+imageinfo-param-urlheight', ), 'urlparam' => array( ApiBase::PARAM_TYPE => 'string', ApiBase::PARAM_DFLT => '', + ApiBase::PARAM_HELP_MSG => 'apihelp-query+imageinfo-param-urlparam', ), ); } - /** - * Return the API documentation for the parameters. - * @return array Parameter documentation. - */ - public function getParamDescription() { - $p = $this->getModulePrefix(); - - return array( - 'prop' => self::getPropertyDescriptions( $this->propertyFilter, $p ), - 'filekey' => 'Key that identifies a previous upload that was stashed temporarily.', - 'sessionkey' => 'Alias for filekey, for backward compatibility.', - 'urlwidth' => "If {$p}prop=url is set, a URL to an image scaled to this width will be returned.", - 'urlheight' => "Similar to {$p}urlwidth. Cannot be used without {$p}urlwidth", - 'urlparam' => array( "A handler specific parameter string. For example, pdf's ", - "might use 'page15-100px'. {$p}urlwidth must be used and be consistent with {$p}urlparam" ), - ); - } - - public function getDescription() { - return 'Returns image information for stashed images.'; - } - - public function getExamples() { + protected function getExamplesMessages() { return array( - 'api.php?action=query&prop=stashimageinfo&siifilekey=124sd34rsdf567', - 'api.php?action=query&prop=stashimageinfo&siifilekey=b34edoe3|bceffd4&' . - 'siiurlwidth=120&siiprop=url', + 'action=query&prop=stashimageinfo&siifilekey=124sd34rsdf567' + => 'apihelp-query+stashimageinfo-example-simple', + 'action=query&prop=stashimageinfo&siifilekey=b34edoe3|bceffd4&' . + 'siiurlwidth=120&siiprop=url' + => 'apihelp-query+stashimageinfo-example-params', ); } }