From 87acd2f8b1f1a3550553d9f0770246b41529315c Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Mon, 10 Dec 2007 16:45:01 +0000 Subject: [PATCH] API: * Replacing Title::newFromText() by Title::makeTitle(), which is more efficient * Changing 'AtoZ' to 'ascending' throughout --- includes/api/ApiQueryAllCategories.php | 13 +++++++------ includes/api/ApiQueryAllpages.php | 6 +++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/includes/api/ApiQueryAllCategories.php b/includes/api/ApiQueryAllCategories.php index 04f4300935..9d616d21cd 100644 --- a/includes/api/ApiQueryAllCategories.php +++ b/includes/api/ApiQueryAllCategories.php @@ -78,11 +78,12 @@ class ApiQueryAllCategories extends ApiQueryGeneratorBase { } // Normalize titles + $titleObj = Title::makeTitle(NS_CATEGORY, $row->cl_to); if(!is_null($resultPageSet)) - $titleObj = Title::newFromText('Category:' . $row->cl_to); + $pages[] = $titleObj->getPrefixedText(); else - $titleObj = Title::newFromText($row->cl_to); - $pages[] = $titleObj->getPrefixedText(); + // Don't show "Category:" everywhere in non-generator mode + $pages[] = $titleObj->getText(); } $db->freeResult($res); @@ -100,10 +101,10 @@ class ApiQueryAllCategories extends ApiQueryGeneratorBase { 'from' => null, 'prefix' => null, 'dir' => array( - ApiBase :: PARAM_DFLT => 'AtoZ', + ApiBase :: PARAM_DFLT => 'ascending', ApiBase :: PARAM_TYPE => array( - 'AtoZ', - 'ZtoA' + 'ascending', + 'descending' ), ), 'limit' => array ( diff --git a/includes/api/ApiQueryAllpages.php b/includes/api/ApiQueryAllpages.php index 8f7daecc24..0ede557ec5 100644 --- a/includes/api/ApiQueryAllpages.php +++ b/includes/api/ApiQueryAllpages.php @@ -186,10 +186,10 @@ class ApiQueryAllpages extends ApiQueryGeneratorBase { ApiBase :: PARAM_MAX2 => ApiBase :: LIMIT_BIG2 ), 'dir' => array ( - ApiBase :: PARAM_DFLT => 'AtoZ', + ApiBase :: PARAM_DFLT => 'ascending', ApiBase :: PARAM_TYPE => array ( - 'AtoZ', - 'ZtoA' + 'ascending', + 'descending' ) ) ); -- 2.20.1