diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:30:02 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:30:02 -0400 |
commit | 1de335ad3f395ca6861085393ba366a9e3fb4a0d (patch) | |
tree | f1fdd326034e05177596851be6a7127615d81498 /includes/api/ApiQueryStashImageInfo.php | |
parent | 9c75fa8ff6d4d38ef552c00fef5969fb154765e8 (diff) | |
parent | f6d65e533c62f6deb21342d4901ece24497b433e (diff) |
Merge commit 'f6d65'
# Conflicts:
# skins/ArchLinux/ArchLinux.php
Diffstat (limited to 'includes/api/ApiQueryStashImageInfo.php')
-rw-r--r-- | includes/api/ApiQueryStashImageInfo.php | 52 |
1 files changed, 19 insertions, 33 deletions
diff --git a/includes/api/ApiQueryStashImageInfo.php b/includes/api/ApiQueryStashImageInfo.php index db928560..11268426 100644 --- a/includes/api/ApiQueryStashImageInfo.php +++ b/includes/api/ApiQueryStashImageInfo.php @@ -52,18 +52,16 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo { } try { - $stash = RepoGroup::singleton()->getLocalRepo()->getUploadStash(); + $stash = RepoGroup::singleton()->getLocalRepo()->getUploadStash( $this->getUser() ); foreach ( $params['filekey'] as $filekey ) { $file = $stash->getFile( $filekey ); $finalThumbParam = $this->mergeThumbParams( $file, $scale, $params['urlparam'] ); $imageInfo = ApiQueryImageInfo::getInfo( $file, $prop, $result, $finalThumbParam ); $result->addValue( array( 'query', $this->getModuleName() ), null, $imageInfo ); - $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), $modulePrefix ); + $result->addIndexedTagName( array( 'query', $this->getModuleName() ), $modulePrefix ); } // @todo Update exception handling here to understand current getFile exceptions - } catch ( UploadStashNotAvailableException $e ) { - $this->dieUsage( "Session not available: " . $e->getMessage(), "nosession" ); } catch ( UploadStashFileNotFoundException $e ) { $this->dieUsage( "File not found: " . $e->getMessage(), "invalidsessiondata" ); } catch ( UploadStashBadPathException $e ) { @@ -90,50 +88,38 @@ class ApiQueryStashImageInfo extends ApiQueryImageInfo { 'prop' => array( ApiBase::PARAM_ISMULTI => true, ApiBase::PARAM_DFLT => 'timestamp|url', - ApiBase::PARAM_TYPE => self::getPropertyNames( $this->propertyFilter ) + ApiBase::PARAM_TYPE => self::getPropertyNames( $this->propertyFilter ), + ApiBase::PARAM_HELP_MSG => 'apihelp-query+imageinfo-param-prop', + ApiBase::PARAM_HELP_MSG_PER_VALUE => self::getPropertyMessages( $this->propertyFilter ) ), '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', ); } } |