42 $this->repoGroup = $repoGroup;
46 if ( !$this->
getUser()->isRegistered() ) {
47 $this->
dieWithError(
'apierror-mustbeloggedin-uploadstash',
'notloggedin' );
53 $prop = array_fill_keys( $params[
'prop'],
true );
62 if ( !$params[
'filekey'] && $params[
'sessionkey'] ) {
63 $params[
'filekey'] = $params[
'sessionkey'];
67 $stash = $this->repoGroup->getLocalRepo()->getUploadStash( $this->
getUser() );
69 foreach ( $params[
'filekey'] as $filekey ) {
70 $file = $stash->getFile( $filekey );
71 $finalThumbParam = $this->
mergeThumbParams( $file, $scale, $params[
'urlparam'] );
73 $result->addValue( [
'query', $this->
getModuleName() ],
null, $imageInfo );
74 $result->addIndexedTagName( [
'query', $this->
getModuleName() ], $modulePrefix );
84 private const PROPERTY_FILTER = [
85 'user',
'userid',
'comment',
'parsedcomment',
86 'mediatype',
'archivename',
'uploadwarning',
96 return parent::getPropertyNames( $filter ?? self::PROPERTY_FILTER );
106 return parent::getPropertyMessages( $filter ?? self::PROPERTY_FILTER );
113 ParamValidator::PARAM_ISMULTI =>
true,
116 ParamValidator::PARAM_ISMULTI =>
true,
117 ParamValidator::PARAM_DEPRECATED =>
true,
120 ParamValidator::PARAM_ISMULTI =>
true,
121 ParamValidator::PARAM_DEFAULT =>
'timestamp|url',
127 ParamValidator::PARAM_TYPE =>
'integer',
128 ParamValidator::PARAM_DEFAULT => -1,
130 'apihelp-query+imageinfo-param-urlwidth',
135 ParamValidator::PARAM_TYPE =>
'integer',
136 ParamValidator::PARAM_DEFAULT => -1,
140 ParamValidator::PARAM_TYPE =>
'string',
141 ParamValidator::PARAM_DEFAULT =>
'',
150 'action=query&prop=stashimageinfo&siifilekey=124sd34rsdf567'
151 =>
'apihelp-query+stashimageinfo-example-simple',
152 'action=query&prop=stashimageinfo&siifilekey=b34edoe3|bceffd4&' .
153 'siiurlwidth=120&siiprop=url'
154 =>
'apihelp-query+stashimageinfo-example-params',
160 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Stashimageinfo';
165class_alias( ApiQueryStashImageInfo::class,
'ApiQueryStashImageInfo' );