r79222 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79221‎ | r79222 | r79223 >
Date:00:56, 30 December 2010
Author:reedy
Status:ok
Tags:
Comment:
Per CR on r68482, fix adss to add

Also remove trailing whitespace in files
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryImageInfo.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryStashImageInfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryImageInfo.php
@@ -179,10 +179,10 @@
180180 }
181181
182182 /**
183 - * From parameters, construct a 'scale' array
184 - * @param $params Array:
 183+ * From parameters, construct a 'scale' array
 184+ * @param $params Array:
185185 * @return Array or Null: key-val array of 'width' and 'height', or null
186 - */
 186+ */
187187 public function getScale( $params ) {
188188 $p = $this->getModulePrefix();
189189 if ( $params['urlheight'] != -1 && $params['urlwidth'] == -1 ) {
@@ -230,7 +230,7 @@
231231 $vals['size'] = intval( $file->getSize() );
232232 $vals['width'] = intval( $file->getWidth() );
233233 $vals['height'] = intval( $file->getHeight() );
234 -
 234+
235235 $pageCount = $file->pageCount();
236236 if ( $pageCount !== false ) {
237237 $vals['pagecount'] = $pageCount;
@@ -266,10 +266,10 @@
267267 }
268268 if ( isset( $prop['parsedcomment'] ) ) {
269269 global $wgUser;
270 - $vals['parsedcomment'] = $wgUser->getSkin()->formatComment(
 270+ $vals['parsedcomment'] = $wgUser->getSkin()->formatComment(
271271 $file->getDescription(), $file->getTitle() );
272272 }
273 -
 273+
274274 if ( isset( $prop['sha1'] ) ) {
275275 $vals['sha1'] = wfBaseConvert( $file->getSha1(), 36, 16, 40 );
276276 }
@@ -380,7 +380,7 @@
381381
382382
383383 /**
384 - * Return the API documentation for the parameters.
 384+ * Return the API documentation for the parameters.
385385 * @return {Array} parameter documentation.
386386 */
387387 public function getParamDescription() {
@@ -398,7 +398,7 @@
399399 ' dimensions - Alias for size',
400400 ' sha1 - Adds SHA-1 hash for the image',
401401 ' mime - Adds MIME type of the image',
402 - ' thumbmime - Adss MIME type of the image thumbnail (requires url)',
 402+ ' thumbmime - Adds MIME type of the image thumbnail (requires url)',
403403 ' metadata - Lists EXIF metadata for the version of the image',
404404 ' archivename - Adds the file name of the archive version for non-latest versions',
405405 ' bitdepth - Adds the bit depth of the version',
Index: trunk/phase3/includes/api/ApiQueryStashImageInfo.php
@@ -38,13 +38,13 @@
3939 $prop = array_flip( $params['prop'] );
4040
4141 $scale = $this->getScale( $params );
42 -
 42+
4343 $result = $this->getResult();
44 -
 44+
4545 try {
4646 $stash = new UploadStash();
47 -
48 - foreach ( $params['sessionkey'] as $sessionkey ) {
 47+
 48+ foreach ( $params['sessionkey'] as $sessionkey ) {
4949 $file = $stash->getFile( $sessionkey );
5050 $imageInfo = self::getInfo( $file, $prop, $result, $scale );
5151 $result->addValue( array( 'query', $this->getModuleName() ), null, $imageInfo );
@@ -57,8 +57,7 @@
5858 $this->dieUsage( "File not found: " . $e->getMessage(), "invalidsessiondata" );
5959 } catch ( UploadStashBadPathException $e ) {
6060 $this->dieUsage( "Bad path: " . $e->getMessage(), "invalidsessiondata" );
61 - }
62 -
 61+ }
6362 }
6463
6564 /**
@@ -81,7 +80,7 @@
8281
8382 public function getAllowedParams() {
8483 return array(
85 - 'sessionkey' => array(
 84+ 'sessionkey' => array(
8685 ApiBase::PARAM_ISMULTI => true,
8786 ApiBase::PARAM_REQUIRED => true,
8887 ApiBase::PARAM_DFLT => null
@@ -117,7 +116,7 @@
118117 ' dimensions - Alias for size',
119118 ' sha1 - Adds sha1 hash for the image',
120119 ' mime - Adds MIME of the image',
121 - ' thumbmime - Adss MIME of the image thumbnail (requires url)',
 120+ ' thumbmime - Adds MIME of the image thumbnail (requires url)',
122121 ' metadata - Lists EXIF metadata for the version of the image',
123122 ' bitdepth - Adds the bit depth of the version',
124123 ),

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r68482* (bug 23473) - Give description of properties on all modules...reedy19:36, 23 June 2010

Status & tagging log