<?php
/**
- * Created on Mar 16, 2008
- *
* API for MediaWiki 1.12+
*
+ * Created on Mar 16, 2008
+ *
* 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' ) ) {
$this->run();
}
+ public function getCacheMode( $params ) {
+ return 'public';
+ }
+
public function executeGenerator( $resultPageSet ) {
if ( $resultPageSet->isResolvingRedirects() ) {
$this->dieUsage( 'Use "gaifilterredir=nonredirects" option instead of "redirects" when using allimages as a generator', 'params' );
// Image filters
$dir = ( $params['dir'] == 'descending' ? 'older' : 'newer' );
$from = ( is_null( $params['from'] ) ? null : $this->titlePartToKey( $params['from'] ) );
- $this->addWhereRange( 'img_name', $dir, $from, null );
+ $to = ( is_null( $params['to'] ) ? null : $this->titlePartToKey( $params['to'] ) );
+ $this->addWhereRange( 'img_name', $dir, $from, $to );
+
if ( isset( $params['prefix'] ) )
$this->addWhere( 'img_name' . $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) );
public function getAllowedParams() {
return array (
'from' => null,
+ 'to' => null,
'prefix' => null,
'minsize' => array(
ApiBase::PARAM_TYPE => 'integer',
public function getParamDescription() {
return array(
'from' => 'The image title to start enumerating from',
+ 'to' => 'The image title to stop enumerating at',
'prefix' => 'Search for all image titles that begin with this value',
'dir' => 'The direction in which to list',
'minsize' => 'Limit to images with at least this many bytes',
'Which properties to get',
' timestamp - Adds the timestamp when the image was upload',
' user - Adds the username of the last uploader',
+ ' userid - Adds the user id of the last uploader',
' comment - Adds the comment of the last upload',
' url - Adds the URL of the image and its description page',
' size - Adds the size of the image in bytes and its height and width',