*/
class ApiQueryCategoryMembers extends ApiQueryGeneratorBase {
- public function __construct( $query, $moduleName ) {
+ public function __construct( ApiQuery $query, $moduleName ) {
parent::__construct( $query, $moduleName, 'cm' );
}
// Scanning large datasets for rare categories sucks, and I already told
// how to have efficient subcategory access :-) ~~~~ (oh well, domas)
- global $wgMiserMode;
$miser_ns = array();
- if ( $wgMiserMode ) {
+ if ( $this->getConfig()->get( 'MiserMode' ) ) {
$miser_ns = $params['namespace'];
} else {
$this->addWhereFld( 'page_namespace', $params['namespace'] );
}
public function getParamDescription() {
- global $wgMiserMode;
$p = $this->getModulePrefix();
$desc = array(
'title' => "Which category to enumerate (required). Must include " .
'limit' => 'The maximum number of pages to return.',
);
- if ( $wgMiserMode ) {
+ if ( $this->getConfig()->get( 'MiserMode' ) ) {
$desc['namespace'] = array(
$desc['namespace'],
"NOTE: Due to \$wgMiserMode, using this may result in fewer than \"{$p}limit\" results",
return $desc;
}
- public function getResultProperties() {
- return array(
- 'ids' => array(
- 'pageid' => 'integer'
- ),
- 'title' => array(
- 'ns' => 'namespace',
- 'title' => 'string'
- ),
- 'sortkey' => array(
- 'sortkey' => 'string'
- ),
- 'sortkeyprefix' => array(
- 'sortkeyprefix' => 'string'
- ),
- 'type' => array(
- 'type' => array(
- ApiBase::PROP_TYPE => array(
- 'page',
- 'subcat',
- 'file'
- )
- )
- ),
- 'timestamp' => array(
- 'timestamp' => 'timestamp'
- )
- );
- }
-
public function getDescription() {
return 'List all pages in a given category.';
}
- public function getPossibleErrors() {
- return array_merge( parent::getPossibleErrors(),
- $this->getTitleOrPageIdErrorMessage(),
- array(
- array( 'code' => 'invalidcategory', 'info' => 'The category name you entered is not valid' ),
- )
- );
- }
-
public function getExamples() {
return array(
'api.php?action=query&list=categorymembers&cmtitle=Category:Physics'