<?php
-
/**
- * Created on December 12, 2007
*
- * API for MediaWiki 1.8+
*
- * Copyright © 2007 Roan Kattouw <Firstname>.<Lastname>@home.nl
+ * Created on December 12, 2007
+ *
+ * Copyright © 2007 Roan Kattouw <Firstname>.<Lastname>@gmail.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* 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( $resultPageSet );
}
+ /**
+ * @param $resultPageSet ApiPageSet
+ * @return void
+ */
private function run( $resultPageSet = null ) {
$db = $this->getDB();
$params = $this->extractRequestParams();
$this->addTables( 'category' );
$this->addFields( 'cat_title' );
- $fromdir = ( $params['dir'] == 'descending' ? 'older' : 'newer' );
- $todir = ( $params['dir'] != 'descending' ? 'older' : 'newer' );
+ $dir = ( $params['dir'] == 'descending' ? 'older' : 'newer' );
$from = ( is_null( $params['from'] ) ? null : $this->titlePartToKey( $params['from'] ) );
$to = ( is_null( $params['to'] ) ? null : $this->titlePartToKey( $params['to'] ) );
- $this->addWhereRange( 'cat_title', $fromdir, $from, null );
- $this->addWhereRange( 'cat_title', $todir, $to, null );
+ $this->addWhereRange( 'cat_title', $dir, $from, $to );
if ( isset( $params['prefix'] ) ) {
$this->addWhere( 'cat_title' . $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) );