56 $this->repoGroup = $repoGroup;
60 if ( !$this->
getUser()->isRegistered() ) {
61 $this->
dieWithError(
'apierror-mustbeloggedin-uploadstash',
'notloggedin' );
67 $prop = array_fill_keys( $params[
'prop'],
true );
76 if ( !$params[
'filekey'] && $params[
'sessionkey'] ) {
77 $params[
'filekey'] = $params[
'sessionkey'];
81 $stash = $this->repoGroup->getLocalRepo()->getUploadStash( $this->
getUser() );
83 foreach ( $params[
'filekey'] as $filekey ) {
84 $file = $stash->getFile( $filekey );
85 $finalThumbParam = $this->
mergeThumbParams( $file, $scale, $params[
'urlparam'] );
87 $result->addValue( [
'query', $this->
getModuleName() ],
null, $imageInfo );
88 $result->addIndexedTagName( [
'query', $this->
getModuleName() ], $modulePrefix );
98 private const PROPERTY_FILTER = [
99 'user',
'userid',
'comment',
'parsedcomment',
100 'mediatype',
'archivename',
'uploadwarning',
110 return parent::getPropertyNames( $filter ?? self::PROPERTY_FILTER );
120 return parent::getPropertyMessages( $filter ?? self::PROPERTY_FILTER );
126 ParamValidator::PARAM_ISMULTI =>
true,
129 ParamValidator::PARAM_ISMULTI =>
true,
130 ParamValidator::PARAM_DEPRECATED =>
true,
133 ParamValidator::PARAM_ISMULTI =>
true,
134 ParamValidator::PARAM_DEFAULT =>
'timestamp|url',
140 ParamValidator::PARAM_TYPE =>
'integer',
141 ParamValidator::PARAM_DEFAULT => -1,
143 'apihelp-query+imageinfo-param-urlwidth',
148 ParamValidator::PARAM_TYPE =>
'integer',
149 ParamValidator::PARAM_DEFAULT => -1,
153 ParamValidator::PARAM_TYPE =>
'string',
154 ParamValidator::PARAM_DEFAULT =>
'',
162 'action=query&prop=stashimageinfo&siifilekey=124sd34rsdf567'
163 =>
'apihelp-query+stashimageinfo-example-simple',
164 'action=query&prop=stashimageinfo&siifilekey=b34edoe3|bceffd4&' .
165 'siiurlwidth=120&siiprop=url'
166 =>
'apihelp-query+stashimageinfo-example-params',
171 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Stashimageinfo';
176class_alias( ApiQueryStashImageInfo::class,
'ApiQueryStashImageInfo' );