* @file
*/
-if ( !defined( 'MEDIAWIKI' ) ) {
- // Eclipse helper - will be ignored in production
- require_once( "ApiQueryBase.php" );
-}
-
/**
* A query module to list duplicates of the given file(s)
*
);
}
- $this->addOption( 'ORDER BY', 'i1.img_name' );
+ $dir = ( $params['dir'] == 'descending' ? ' DESC' : '' );
+ $this->addOption( 'ORDER BY', 'i1.img_name' . $dir );
$this->addOption( 'LIMIT', $params['limit'] + 1 );
$res = $this->select( __METHOD__ );
ApiBase::PARAM_MAX2 => ApiBase::LIMIT_BIG2
),
'continue' => null,
+ 'dir' => array(
+ ApiBase::PARAM_DFLT => 'ascending',
+ ApiBase::PARAM_TYPE => array(
+ 'ascending',
+ 'descending'
+ )
+ ),
);
}
return array(
'limit' => 'How many files to return',
'continue' => 'When more results are available, use this to continue',
+ 'dir' => 'The direction in which to list',
);
}
) );
}
- protected function getExamples() {
+ public function getExamples() {
return array(
'api.php?action=query&titles=File:Albert_Einstein_Head.jpg&prop=duplicatefiles',
'api.php?action=query&generator=allimages&prop=duplicatefiles',
}
public function getHelpUrls() {
- return 'http://www.mediawiki.org/wiki/API:Properties#duplicatefiles_.2F_df';
+ return 'https://www.mediawiki.org/wiki/API:Properties#duplicatefiles_.2F_df';
}
public function getVersion() {