r81616 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81615‎ | r81616 | r81617 >
Date:23:59, 6 February 2011
Author:reedy
Status:ok
Tags:
Comment:
* (bug 27205) aiprop=metadata and aiprop=parsedcomment need help text

Refactored code out to reduce duplication (and hence, mismatches like this)
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryAllimages.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryImageInfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryAllimages.php
@@ -199,21 +199,7 @@
200200 'limit' => 'How many images in total to return',
201201 'sha1' => "SHA1 hash of image. Overrides {$this->getModulePrefix()}sha1base36",
202202 'sha1base36' => 'SHA1 hash of image in base 36 (used in MediaWiki)',
203 - 'prop' => array(
204 - 'Which properties to get',
205 - ' timestamp - Adds the timestamp when the image was upload',
206 - ' user - Adds the username of the last uploader',
207 - ' userid - Adds the user ID of the last uploader',
208 - ' comment - Adds the comment of the last upload',
209 - ' url - Adds the URL of the image and its description page',
210 - ' size - Adds the size of the image in bytes and its height and width',
211 - ' dimensions - Alias of size',
212 - ' sha1 - Adds the SHA-1 hash of the image',
213 - ' mime - Adds the MIME of the image',
214 - ' thumbmime - Adds the MIME of the tumbnail for the image',
215 - ' archivename - Adds the file name of the archive version for non-latest versions',
216 - ' bitdepth - Adds the bit depth of the version',
217 - ),
 203+ 'prop' => ApiQueryImageInfo::getPropertyDescriptions(),
218204 );
219205 }
220206
Index: trunk/phase3/includes/api/ApiQueryImageInfo.php
@@ -424,6 +424,8 @@
425425
426426 /**
427427 * Returns all possible parameters to iiprop
 428+ * @static
 429+ * @return Array
428430 */
429431 public static function getPropertyNames() {
430432 return array(
@@ -444,15 +446,14 @@
445447 );
446448 }
447449
448 -
449450 /**
450 - * Return the API documentation for the parameters.
451 - * @return {Array} parameter documentation.
 451+ * Returns the descriptions for the properties provided by getPropertyNames()
 452+ *
 453+ * @static
 454+ * @return array
452455 */
453 - public function getParamDescription() {
454 - $p = $this->getModulePrefix();
 456+ public static function getPropertyDescriptions() {
455457 return array(
456 - 'prop' => array(
457458 'What image information to get:',
458459 ' timestamp - Adds timestamp for the uploaded version',
459460 ' user - Adds the user who uploaded the image version',
@@ -468,7 +469,17 @@
469470 ' metadata - Lists EXIF metadata for the version of the image',
470471 ' archivename - Adds the file name of the archive version for non-latest versions',
471472 ' bitdepth - Adds the bit depth of the version',
472 - ),
 473+ );
 474+ }
 475+
 476+ /**
 477+ * Return the API documentation for the parameters.
 478+ * @return {Array} parameter documentation.
 479+ */
 480+ public function getParamDescription() {
 481+ $p = $this->getModulePrefix();
 482+ return array(
 483+ 'prop' => self::getPropertyDescriptions(),
473484 'urlwidth' => array( "If {$p}prop=url is set, a URL to an image scaled to this width will be returned.",
474485 'Only the current version of the image can be scaled' ),
475486 'urlheight' => "Similar to {$p}urlwidth. Cannot be used without {$p}urlwidth",
Index: trunk/phase3/RELEASE-NOTES
@@ -149,6 +149,7 @@
150150 * Expose list of skins in meta=siteinfo
151151 * (bug 26548) Add iiurlparam param to query=imageinfo and query=stashimageinfo
152152 * (bug 27201) Special:WhatLinksHere output no longer contains duplicate IDs
 153+* (bug 27205) aiprop=metadata and aiprop=parsedcomment need help text
153154
154155 === Languages updated in 1.18 ===
155156

Status & tagging log