/**
* Override this method to request extra fields from the pageSet
* using $pageSet->requestField('fieldName')
+ *
+ * Note this only makes sense for 'prop' modules, as 'list' and 'meta'
+ * modules should not be using the pageset.
+ *
* @param ApiPageSet $pageSet
*/
public function requestExtraData( $pageSet ) {
return $this->mQueryModule;
}
+ /**
+ * @see ApiBase::getParent()
+ */
+ public function getParent() {
+ return $this->getQuery();
+ }
+
/**
* Get the Query database connection (read-only)
* @return DatabaseBase
isset( $extraQuery['join_conds'] ) ? (array)$extraQuery['join_conds'] : array()
);
- // getDB has its own profileDBIn/Out calls
- $db = $this->getDB();
-
- $this->profileDBIn();
- $res = $db->select( $tables, $fields, $where, $method, $options, $join_conds );
- $this->profileDBOut();
+ $res = $this->getDB()->select( $tables, $fields, $where, $method, $options, $join_conds );
return $res;
}
*/
public function titlePartToKey( $titlePart, $namespace = NS_MAIN ) {
$t = Title::makeTitleSafe( $namespace, $titlePart . 'x' );
- if ( !$t ) {
+ if ( !$t || $t->hasFragment() ) {
+ // Invalid title (e.g. bad chars) or contained a '#'.
$this->dieUsageMsg( array( 'invalidtitle', $titlePart ) );
}
if ( $namespace != $t->getNamespace() || $t->isExternal() ) {
protected function checkRowCount() {
wfDeprecated( __METHOD__, '1.24' );
$db = $this->getDB();
- $this->profileDBIn();
$rowcount = $db->estimateRowCount(
$this->tables,
$this->fields,
__METHOD__,
$this->options
);
- $this->profileDBOut();
if ( $rowcount > $this->getConfig()->get( 'APIMaxDBRows' ) ) {
return false;
}
}
+ /**
+ * @see ApiBase::getHelpFlags()
+ *
+ * Corresponding messages: api-help-flag-generator
+ */
+ protected function getHelpFlags() {
+ $flags = parent::getHelpFlags();
+ $flags[] = 'generator';
+ return $flags;
+ }
+
/**
* Execute this module as a generator
* @param ApiPageSet $resultPageSet All output should be appended to this object