<?php
-
/**
- * Created on May 10, 2010
- *
* 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
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
*/
if ( !defined( 'MEDIAWIKI' ) ) {
if ( !$wgUser->isAllowed( 'deletedhistory' ) ) {
$this->dieUsage( 'You don\'t have permission to view deleted file information', 'permissiondenied' );
}
-
+
$db = $this->getDB();
$params = $this->extractRequestParams();
-
+
$prop = array_flip( $params['prop'] );
$fld_sha1 = isset( $prop['sha1'] );
$fld_timestamp = isset( $prop['timestamp'] );
$fld_mime = isset( $prop['mime'] );
$fld_metadata = isset( $prop['metadata'] );
$fld_bitdepth = isset( $prop['bitdepth'] );
-
+
$this->addTables( 'filearchive' );
-
+
$this->addFields( 'fa_name' );
$this->addFieldsIf( 'fa_storage_key', $fld_sha1 );
$this->addFieldsIf( 'fa_timestamp', $fld_timestamp );
$this->setContinueEnumParameter( 'from', $this->keyToTitle( $row->fa_name ) );
break;
}
-
+
$file = array();
$file['name'] = $row->fa_name;
if ( $fld_mime ) {
$file['mime'] = "$row->fa_major_mime/$row->fa_minor_mime";
}
-
+
$fit = $result->addValue( array( 'query', $this->getModuleName() ), null, $file );
if ( !$fit ) {
$this->setContinueEnumParameter( 'from', $this->keyToTitle( $row->fa_name ) );
'sha1base36' => 'SHA1 hash of image in base 36 (used in MediaWiki)',
'prop' => array(
'What image information to get:',
- ' sha1 - Adds sha1 hash for the image',
+ ' sha1 - Adds SHA-1 hash for the image',
' timestamp - Adds timestamp for the uploaded version',
' user - Adds user for uploaded the image version',
' size - Adds the size of the image in bytes',