X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryAllImages.php;h=9dc5f69a80a301d3809f0099d690e9c38c7dc9b8;hb=0525f22b8825c617fffa98f191ab07e8113da085;hp=4266a8e43fc7fa8acb3d5dfeda719fb1d17808ad;hpb=e696a662a96209e642fce66cb861ad18dc5a2371;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryAllImages.php b/includes/api/ApiQueryAllImages.php index 4266a8e43f..9dc5f69a80 100644 --- a/includes/api/ApiQueryAllImages.php +++ b/includes/api/ApiQueryAllImages.php @@ -228,8 +228,7 @@ class ApiQueryAllImages extends ApiQueryGeneratorBase { } if ( !is_null( $params['mime'] ) ) { - global $wgMiserMode; - if ( $wgMiserMode ) { + if ( $this->getConfig()->get( 'MiserMode' ) ) { $this->dieUsage( 'MIME search disabled in Miser Mode', 'mimesearchdisabled' ); } @@ -394,76 +393,10 @@ class ApiQueryAllImages extends ApiQueryGeneratorBase { private $propertyFilter = array( 'archivename', 'thumbmime', 'uploadwarning' ); - public function getResultProperties() { - return array_merge( - array( - '' => array( - 'name' => 'string', - 'ns' => 'namespace', - 'title' => 'string' - ) - ), - ApiQueryImageInfo::getResultPropertiesFiltered( $this->propertyFilter ) - ); - } - public function getDescription() { return 'Enumerate all images sequentially.'; } - public function getPossibleErrors() { - $p = $this->getModulePrefix(); - - return array_merge( parent::getPossibleErrors(), array( - array( - 'code' => 'params', - 'info' => 'Use "gaifilterredir=nonredirects" option instead ' . - 'of "redirects" when using allimages as a generator' - ), - array( - 'code' => 'badparams', - 'info' => "Parameter'{$p}start' can only be used with {$p}sort=timestamp" - ), - array( - 'code' => 'badparams', - 'info' => "Parameter'{$p}end' can only be used with {$p}sort=timestamp" - ), - array( - 'code' => 'badparams', - 'info' => "Parameter'{$p}user' can only be used with {$p}sort=timestamp" - ), - array( - 'code' => 'badparams', - 'info' => "Parameter'{$p}filterbots' can only be used with {$p}sort=timestamp" - ), - array( - 'code' => 'badparams', - 'info' => "Parameter'{$p}from' can only be used with {$p}sort=name" - ), - array( - 'code' => 'badparams', - 'info' => "Parameter'{$p}to' can only be used with {$p}sort=name" - ), - array( - 'code' => 'badparams', - 'info' => "Parameter'{$p}prefix' can only be used with {$p}sort=name" - ), - array( - 'code' => 'badparams', - 'info' => "Parameters '{$p}user' and '{$p}filterbots' cannot be used together" - ), - array( - 'code' => 'unsupportedrepo', - 'info' => 'Local file repository does not support querying all images' ), - array( 'code' => 'mimesearchdisabled', 'info' => 'MIME search disabled in Miser Mode' ), - array( 'code' => 'invalidsha1hash', 'info' => 'The SHA1 hash provided is not valid' ), - array( - 'code' => 'invalidsha1base36hash', - 'info' => 'The SHA1Base36 hash provided is not valid' - ), - ) ); - } - public function getExamples() { return array( 'api.php?action=query&list=allimages&aifrom=B' => array(