r84433 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84432‎ | r84433 | r84434 >
Date:23:50, 20 March 2011
Author:reedy
Status:ok
Tags:
Comment:
Start of bug 27586/bug 27589

Turn properties into a filterable key/value pair, but leave exisiting wrapper methods in place for the moment

Will finish it off later
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryImageInfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryImageInfo.php
@@ -475,22 +475,32 @@
476476 * @return Array
477477 */
478478 public static function getPropertyNames() {
 479+ return array_keys( self::getProperties() );
 480+ }
 481+
 482+ /**
 483+ * Returns array key value pairs of
 484+ *
 485+ * @static
 486+ * @return array
 487+ */
 488+ private static function getProperties() {
479489 return array(
480 - 'timestamp',
481 - 'user',
482 - 'userid',
483 - 'comment',
484 - 'parsedcomment',
485 - 'url',
486 - 'size',
487 - 'dimensions', // For backwards compatibility with Allimages
488 - 'sha1',
489 - 'mime',
490 - 'thumbmime',
491 - 'mediatype',
492 - 'metadata',
493 - 'archivename',
494 - 'bitdepth',
 490+ 'timestamp' => ' timestamp - Adds timestamp for the uploaded version',
 491+ 'user' => ' user - Adds the user who uploaded the image version',
 492+ 'userid' => ' userid - Add the user ID that uploaded the image version',
 493+ 'comment' => ' comment - Comment on the version',
 494+ 'parsedcomment' => ' parsedcomment - Parse the comment on the version',
 495+ 'url' => ' url - Gives URL to the image and the description page',
 496+ 'size' => ' size - Adds the size of the image in bytes and the height, width and page count (if applicable)',
 497+ 'dimensions' => ' dimensions - Alias for size', // For backwards compatibility with Allimages
 498+ 'sha1' => ' sha1 - Adds SHA-1 hash for the image',
 499+ 'mime' => ' mime - Adds MIME type of the image',
 500+ 'thumbmime' => ' thumbmime - Adds MIME type of the image thumbnail (requires url)',
 501+ 'mediatype' => ' mediatype - Adds the media type of the image',
 502+ 'metadata' => ' metadata - Lists EXIF metadata for the version of the image',
 503+ 'archivename' => ' archivename - Adds the file name of the archive version for non-latest versions',
 504+ 'bitdepth' => ' bitdepth - Adds the bit depth of the version',
495505 );
496506 }
497507
@@ -501,24 +511,10 @@
502512 * @return array
503513 */
504514 public static function getPropertyDescriptions() {
505 - return array(
506 - 'What image information to get:',
507 - ' timestamp - Adds timestamp for the uploaded version',
508 - ' user - Adds the user who uploaded the image version',
509 - ' userid - Add the user ID that uploaded the image version',
510 - ' comment - Comment on the version',
511 - ' parsedcomment - Parse the comment on the version',
512 - ' url - Gives URL to the image and the description page',
513 - ' size - Adds the size of the image in bytes and the height, width and page count (if applicable)',
514 - ' dimensions - Alias for size',
515 - ' sha1 - Adds SHA-1 hash for the image',
516 - ' mime - Adds MIME type of the image',
517 - ' thumbmime - Adds MIME type of the image thumbnail (requires url)',
518 - ' mediatype - Adds the media type of the image',
519 - ' metadata - Lists EXIF metadata for the version of the image',
520 - ' archivename - Adds the file name of the archive version for non-latest versions',
521 - ' bitdepth - Adds the bit depth of the version',
522 - );
 515+ return array_merge(
 516+ array( 'What image information to get:' ),
 517+ array_values( self::getProperties() )
 518+ );
523519 }
524520
525521 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r84502* (bug 27589) list=allimages&aiprop=archivename is useless...reedy23:51, 21 March 2011
r84504* (bug 27586) Remove duplication of props in ApiQueryStashImageInfo by using ...reedy00:08, 22 March 2011

Status & tagging log