Index: trunk/phase3/includes/api/ApiQueryAllimages.php |
— | — | @@ -203,7 +203,7 @@ |
204 | 204 | 'sha1' => null, |
205 | 205 | 'sha1base36' => null, |
206 | 206 | 'prop' => array( |
207 | | - ApiBase::PARAM_TYPE => ApiQueryImageInfo::getPropertyNames(), |
| 207 | + ApiBase::PARAM_TYPE => ApiQueryImageInfo::getPropertyNames( $this->propertyFilter ), |
208 | 208 | ApiBase::PARAM_DFLT => 'timestamp|url', |
209 | 209 | ApiBase::PARAM_ISMULTI => true |
210 | 210 | ), |
— | — | @@ -222,11 +222,13 @@ |
223 | 223 | 'limit' => 'How many images in total to return', |
224 | 224 | 'sha1' => "SHA1 hash of image. Overrides {$this->getModulePrefix()}sha1base36", |
225 | 225 | 'sha1base36' => 'SHA1 hash of image in base 36 (used in MediaWiki)', |
226 | | - 'prop' => ApiQueryImageInfo::getPropertyDescriptions(), |
| 226 | + 'prop' => ApiQueryImageInfo::getPropertyDescriptions( $this->propertyFilter ), |
227 | 227 | 'mime' => 'What MIME type to search for. e.g. image/jpeg. Disabled in Miser Mode', |
228 | 228 | ); |
229 | 229 | } |
230 | 230 | |
| 231 | + private $propertyFilter = array( 'archivename' ); |
| 232 | + |
231 | 233 | public function getDescription() { |
232 | 234 | return 'Enumerate all images sequentially'; |
233 | 235 | } |
Index: trunk/phase3/includes/api/ApiQueryImageInfo.php |
— | — | @@ -471,15 +471,18 @@ |
472 | 472 | |
473 | 473 | /** |
474 | 474 | * Returns all possible parameters to iiprop |
| 475 | + * |
| 476 | + * @param array $filter List of properties to filter out |
| 477 | + * |
475 | 478 | * @static |
476 | 479 | * @return Array |
477 | 480 | */ |
478 | | - public static function getPropertyNames() { |
479 | | - return array_keys( self::getProperties() ); |
| 481 | + public static function getPropertyNames( $filter = array() ) { |
| 482 | + return array_diff( array_keys( self::getProperties() ), $filter ); |
480 | 483 | } |
481 | 484 | |
482 | 485 | /** |
483 | | - * Returns array key value pairs of |
| 486 | + * Returns array key value pairs of properties and their descriptions |
484 | 487 | * |
485 | 488 | * @static |
486 | 489 | * @return array |
— | — | @@ -506,14 +509,16 @@ |
507 | 510 | |
508 | 511 | /** |
509 | 512 | * Returns the descriptions for the properties provided by getPropertyNames() |
| 513 | + * |
| 514 | + * @param array $filter List of properties to filter out |
510 | 515 | * |
511 | 516 | * @static |
512 | 517 | * @return array |
513 | 518 | */ |
514 | | - public static function getPropertyDescriptions() { |
| 519 | + public static function getPropertyDescriptions( $filter = array() ) { |
515 | 520 | return array_merge( |
516 | 521 | array( 'What image information to get:' ), |
517 | | - array_values( self::getProperties() ) |
| 522 | + array_values( array_diff_key( self::getProperties(), array_flip( $filter ) ) ) |
518 | 523 | ); |
519 | 524 | } |
520 | 525 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -276,6 +276,7 @@ |
277 | 277 | the general site info results |
278 | 278 | * (bug 16288) API: consider making closure status of wikis more clear |
279 | 279 | with meta=siteinfo |
| 280 | +* (bug 27589) list=allimages&aiprop=archivename is useless |
280 | 281 | |
281 | 282 | === Languages updated in 1.18 === |
282 | 283 | |