'by the previous query', '_badcontinue'
);
}
-
+
// Remove the types to skip from $queryTypes
$contTypeIndex = array_search( $cont[0], $queryTypes );
$queryTypes = array_slice( $queryTypes, $contTypeIndex );
-
+
// Add a WHERE clause for sortkey and from
// pack( "H*", $foo ) is used to convert hex back to binary
$escSortkey = $this->getDB()->addQuotes( pack( "H*", $cont[1] ) );
$contWhere = "cl_sortkey $op $escSortkey OR " .
"(cl_sortkey = $escSortkey AND " .
"cl_from $op= $from)";
-
+
} else {
// The below produces ORDER BY cl_sortkey, cl_from, possibly with DESC added to each of them
$this->addWhereRange( 'cl_sortkey',
$res = $this->select( __METHOD__ );
$rows = iterator_to_array( $res );
}
+
+ $result = $this->getResult();
$count = 0;
foreach ( $rows as $row ) {
if ( ++ $count > $limit ) {
if ( $fld_timestamp ) {
$vals['timestamp'] = wfTimestamp( TS_ISO_8601, $row->cl_timestamp );
}
- $fit = $this->getResult()->addValue( array( 'query', $this->getModuleName() ),
+ $fit = $result->addValue( array( 'query', $this->getModuleName() ),
null, $vals );
if ( !$fit ) {
if ( $params['sort'] == 'timestamp' ) {
}
if ( is_null( $resultPageSet ) ) {
- $this->getResult()->setIndexedTagName_internal(
+ $result->setIndexedTagName_internal(
array( 'query', $this->getModuleName() ), 'cm' );
}
}
'dir' => 'In which direction to sort',
'start' => "Timestamp to start listing from. Can only be used with {$p}sort=timestamp",
'end' => "Timestamp to end listing at. Can only be used with {$p}sort=timestamp",
- 'startsortkey' => "Sortkey to start listing from. Can only be used with {$p}sort=sortkey",
- 'endsortkey' => "Sortkey to end listing at. Can only be used with {$p}sort=sortkey",
+ 'startsortkey' => "Sortkey to start listing from. Must be given in binary format. Can only be used with {$p}sort=sortkey",
+ 'endsortkey' => "Sortkey to end listing at. Must be given in binary format. Can only be used with {$p}sort=sortkey",
'continue' => 'For large categories, give the value retured from previous query',
'limit' => 'The maximum number of pages to return.',
);
);
}
- protected function getExamples() {
+ public function getExamples() {
return array(
'Get first 10 pages in [[Category:Physics]]:',
' api.php?action=query&list=categorymembers&cmtitle=Category:Physics',
);
}
+ public function getHelpUrls() {
+ return 'http://www.mediawiki.org/wiki/API:Categorymembers';
+ }
+
public function getVersion() {
return __CLASS__ . ': $Id$';
}