dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make API documentation links language aware
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiQueryStashImageInfo.php
diff --git
a/includes/api/ApiQueryStashImageInfo.php
b/includes/api/ApiQueryStashImageInfo.php
index
b039a1e
..
1924ca0
100644
(file)
--- a/
includes/api/ApiQueryStashImageInfo.php
+++ b/
includes/api/ApiQueryStashImageInfo.php
@@
-33,7
+33,7
@@
class ApiQueryStashImageInfo extends ApiQueryImageInfo {
public function execute() {
if ( !$this->getUser()->isLoggedIn() ) {
public function execute() {
if ( !$this->getUser()->isLoggedIn() ) {
- $this->die
Usage( 'You must be logged-in to have an upload
stash', 'notloggedin' );
+ $this->die
WithError( 'apierror-mustbeloggedin-upload
stash', 'notloggedin' );
}
$params = $this->extractRequestParams();
}
$params = $this->extractRequestParams();
@@
-45,9
+45,7
@@
class ApiQueryStashImageInfo extends ApiQueryImageInfo {
$result = $this->getResult();
$result = $this->getResult();
- if ( !$params['filekey'] && !$params['sessionkey'] ) {
- $this->dieUsage( 'One of filekey or sessionkey must be supplied', 'nofilekey' );
- }
+ $this->requireAtLeastOneParameter( $params, 'filekey', 'sessionkey' );
// Alias sessionkey to filekey, but give an existing filekey precedence.
if ( !$params['filekey'] && $params['sessionkey'] ) {
// Alias sessionkey to filekey, but give an existing filekey precedence.
if ( !$params['filekey'] && $params['sessionkey'] ) {
@@
-66,9
+64,9
@@
class ApiQueryStashImageInfo extends ApiQueryImageInfo {
}
// @todo Update exception handling here to understand current getFile exceptions
} catch ( UploadStashFileNotFoundException $e ) {
}
// @todo Update exception handling here to understand current getFile exceptions
} catch ( UploadStashFileNotFoundException $e ) {
- $this->die
Usage( 'File not found: ' . $e->getMessage(), 'invalidsessiondata'
);
+ $this->die
WithException( $e, [ 'wrap' => 'apierror-stashedfilenotfound' ]
);
} catch ( UploadStashBadPathException $e ) {
} catch ( UploadStashBadPathException $e ) {
- $this->die
Usage( 'Bad path: ' . $e->getMessage(), 'invalidsessiondata'
);
+ $this->die
WithException( $e, [ 'wrap' => 'apierror-stashpathinvalid' ]
);
}
}
}
}
@@
-125,6
+123,6
@@
class ApiQueryStashImageInfo extends ApiQueryImageInfo {
}
public function getHelpUrls() {
}
public function getHelpUrls() {
- return 'https://www.mediawiki.org/wiki/API:Stashimageinfo';
+ return 'https://www.mediawiki.org/wiki/
Special:MyLanguage/
API:Stashimageinfo';
}
}
}
}