incorrectly
* (bug 16858) Revamped list=deletedrevs to make listing deleted contributions
and listing all deleted pages possible
+* (bug 16844) Added clcategories parameter to prop=categories
=== Languages updated in 1.15 ===
$this->addTables('categorylinks');
$this->addWhereFld('cl_from', array_keys($this->getPageSet()->getGoodTitles()));
+ if(!is_null($params['categories']))
+ {
+ $cats = array();
+ foreach($params['categories'] as $cat)
+ {
+ $title = Title::newFromText($cat);
+ if($title->getNamespace() != NS_CATEGORY)
+ $this->setWarning("``$cat'' is not a category");
+ else
+ $cats[] = $title->getDBkey();
+ }
+ $this->addWhereFld('cl_to', $cats);
+ }
if(!is_null($params['continue'])) {
$cont = explode('|', $params['continue']);
if(count($cont) != 2)
$this->addWhere(array('pp_propname IS NULL'));
}
+ $this->addOption('USE INDEX', array('categorylinks' => 'cl_from'));
# Don't order by cl_from if it's constant in the WHERE clause
if(count($this->getPageSet()->getGoodTitles()) == 1)
$this->addOption('ORDER BY', 'cl_to');
ApiBase :: PARAM_MAX2 => ApiBase :: LIMIT_BIG2
),
'continue' => null,
+ 'categories' => array(
+ ApiBase :: PARAM_ISMULTI => true,
+ ),
);
}
'limit' => 'How many categories to return',
'show' => 'Which kind of categories to show',
'continue' => 'When more results are available, use this to continue',
+ 'categories' => 'Only list these categories. Useful for checking whether a certain page is in a certain category',
);
}