Merge "Space in $separatorTransformTable should be non-breaking in Portuguese, Espera...
[lhc/web/wiklou.git] / includes / api / ApiQueryAllCategories.php
index 23e361c..ce28d03 100644 (file)
  * @file
  */
 
-if ( !defined( 'MEDIAWIKI' ) ) {
-       // Eclipse helper - will be ignored in production
-       require_once( 'ApiQueryBase.php' );
-}
-
 /**
  * Query module to enumerate all categories, even the ones that don't have
  * category pages.
@@ -55,7 +50,6 @@ class ApiQueryAllCategories extends ApiQueryGeneratorBase {
 
        /**
         * @param $resultPageSet ApiPageSet
-        * @return void
         */
        private function run( $resultPageSet = null ) {
                $db = $this->getDB();
@@ -71,7 +65,12 @@ class ApiQueryAllCategories extends ApiQueryGeneratorBase {
 
                $min = $params['min'];
                $max = $params['max'];
-               $this->addWhereRange( 'cat_pages', $dir, $min, $max );
+               if ( $dir == 'newer' ) {
+                       $this->addWhereRange( 'cat_pages', 'newer', $min, $max );
+               } else {
+                       $this->addWhereRange( 'cat_pages', 'older', $max, $min);
+               }
+    
 
                if ( isset( $params['prefix'] ) ) {
                        $this->addWhere( 'cat_title' . $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) );
@@ -204,7 +203,7 @@ class ApiQueryAllCategories extends ApiQueryGeneratorBase {
        }
 
        public function getHelpUrls() {
-               return 'http://www.mediawiki.org/wiki/API:Allcategories';
+               return 'https://www.mediawiki.org/wiki/API:Allcategories';
        }
 
        public function getVersion() {