X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fapi%2FApiQueryFilearchive.php;h=d401511059a8297c5b86d448b27d8fd0a313e3fa;hp=212b61340ac64897af028fb97beb717fc61a0482;hb=7babd362babcbf7f20adb8e12edb4f4bc1d4249f;hpb=059fdf444ebc254fe703d36c98397164b5dbd533 diff --git a/includes/api/ApiQueryFilearchive.php b/includes/api/ApiQueryFilearchive.php index 212b61340a..d401511059 100644 --- a/includes/api/ApiQueryFilearchive.php +++ b/includes/api/ApiQueryFilearchive.php @@ -2,8 +2,6 @@ /** * API for MediaWiki 1.12+ * - * Created on May 10, 2010 - * * Copyright © 2010 Sam Reed * Copyright © 2008 Vasiliev Victor vasilvv@gmail.com, * based on ApiQueryAllPages.php @@ -60,25 +58,10 @@ class ApiQueryFilearchive extends ApiQueryBase { $fld_bitdepth = isset( $prop['bitdepth'] ); $fld_archivename = isset( $prop['archivename'] ); - $this->addTables( 'filearchive' ); - - $this->addFields( ArchivedFile::selectFields() ); - $this->addFields( [ 'fa_id', 'fa_name', 'fa_timestamp', 'fa_deleted' ] ); - $this->addFieldsIf( 'fa_sha1', $fld_sha1 ); - $this->addFieldsIf( [ 'fa_user', 'fa_user_text' ], $fld_user ); - $this->addFieldsIf( [ 'fa_height', 'fa_width', 'fa_size' ], $fld_dimensions || $fld_size ); - $this->addFieldsIf( [ 'fa_major_mime', 'fa_minor_mime' ], $fld_mime ); - $this->addFieldsIf( 'fa_media_type', $fld_mediatype ); - $this->addFieldsIf( 'fa_metadata', $fld_metadata ); - $this->addFieldsIf( 'fa_bits', $fld_bitdepth ); - $this->addFieldsIf( 'fa_archive_name', $fld_archivename ); - - if ( $fld_description ) { - $commentQuery = $commentStore->getJoin(); - $this->addTables( $commentQuery['tables'] ); - $this->addFields( $commentQuery['fields'] ); - $this->addJoinConds( $commentQuery['joins'] ); - } + $fileQuery = ArchivedFile::getQueryInfo(); + $this->addTables( $fileQuery['tables'] ); + $this->addFields( $fileQuery['fields'] ); + $this->addJoinConds( $fileQuery['joins'] ); if ( !is_null( $params['continue'] ) ) { $cont = explode( '|', $params['continue'] );