r111159 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111158‎ | r111159 | r111160 >
Date:14:27, 10 February 2012
Author:reedy
Status:ok (Comments)
Tags:
Comment:
* (bug 34316) Add ability to retrieve maximum upload size from MediaWiki API.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.20 (modified) (history)
  • /trunk/phase3/includes/api/ApiQuerySiteinfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQuerySiteinfo.php
@@ -177,6 +177,8 @@
178178 $data['misermode'] = '';
179179 }
180180
 181+ $data['maxuploadsize'] = UploadBase::getMaxUploadSize();
 182+
181183 wfRunHooks( 'APIQuerySiteInfoGeneralInfo', array( $this, &$data ) );
182184
183185 return $this->getResult()->addValue( 'query', $property, $data );
Index: trunk/phase3/RELEASE-NOTES-1.20
@@ -24,6 +24,7 @@
2525 compressed the output twice resulting in garbage output (since 1.18)
2626
2727 === API changes in 1.20 ===
 28+* (bug 34316) Add ability to retrieve maximum upload size from MediaWiki API.
2829
2930 === Languages updated in 1.20 ===
3031

Comments

#Comment by Bryan (talk | contribs)   18:17, 10 February 2012

If available, it would be nice to specify the per-upload-type size restrictions.

#Comment by MZMcBride (talk | contribs)   22:28, 10 February 2012

MediaWiki supports per-upload-type size restrictions?

#Comment by Bryan (talk | contribs)   22:40, 10 February 2012

Yes.

#Comment by MZMcBride (talk | contribs)   22:42, 10 February 2012

Well, I think that'd be a separate bug. :-)

Out of curiosity, are those limits exposed anywhere in the UI? I've never seen them. (Maybe I've never used a wiki where they're set....)

#Comment by Bryan (talk | contribs)   09:57, 11 February 2012

With upload type I mean upload source-type, not file type. It is possible to have different upload limits for upload-by-url, upload-from-file, etc. You'll see them in the upload form.

#Comment by MZMcBride (talk | contribs)   22:28, 10 February 2012

I assume the API won't be outputting "100 MB"? What's returned by UploadBase::getMaxUploadSize()? Bytes? And should this be documented or should people just assume it's in bytes?

Status & tagging log