$this->dfltNamespace = NS_TEMPLATE;
$this->hasNamespace = true;
$this->indexTag = 't';
- $this->description = 'List all transclusions (pages embedded using {{x}}), including non-existing';
+ $this->description =
+ 'List all transclusions (pages embedded using {{x}}), including non-existing';
$this->descriptionWhat = 'transclusion';
$this->descriptionTargets = 'transcluded titles';
$this->descriptionLinking = 'transcluding';
if ( $params['unique'] ) {
if ( $fld_ids ) {
$this->dieUsage(
- "{$this->getModuleName()} cannot return corresponding page ids in unique {$this->descriptionWhat}s mode",
- 'params' );
+ "{$this->getModuleName()} cannot return corresponding page " .
+ "ids in unique {$this->descriptionWhat}s mode",
+ 'params'
+ );
}
$this->addOption( 'DISTINCT' );
}
}
// 'continue' always overrides 'from'
- $from = ( $continue || is_null( $params['from'] ) ? null : $this->titlePartToKey( $params['from'] ) );
- $to = ( is_null( $params['to'] ) ? null : $this->titlePartToKey( $params['to'] ) );
+ $from = ( $continue || $params['from'] === null ? null :
+ $this->titlePartToKey( $params['from'], $params['namespace'] ) );
+ $to = ( $params['to'] === null ? null :
+ $this->titlePartToKey( $params['to'], $params['namespace'] ) );
$this->addWhereRange( $pfx . $fieldTitle, 'newer', $from, $to );
+
if ( isset( $params['prefix'] ) ) {
- $this->addWhere( $pfx . $fieldTitle . $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) );
+ $this->addWhere( $pfx . $fieldTitle . $db->buildLike( $this->titlePartToKey(
+ $params['prefix'], $params['namespace'] ), $db->anyString() ) );
}
$this->addFields( array( 'pl_title' => $pfx . $fieldTitle ) );
$count = 0;
$result = $this->getResult();
foreach ( $res as $row ) {
- if ( ++ $count > $limit ) {
- // We've reached the one extra which shows that there are additional pages to be had. Stop here...
+ if ( ++$count > $limit ) {
+ // We've reached the one extra which shows that there are
+ // additional pages to be had. Stop here...
if ( $params['unique'] ) {
$this->setContinueEnumParameter( 'continue', $row->pl_title );
} else {
if ( !$this->hasNamespace ) {
unset( $allowedParams['namespace'] );
}
+
return $allowedParams;
}
if ( !$this->hasNamespace ) {
unset( $paramDescription['namespace'] );
}
+
return $paramDescription;
}
public function getPossibleErrors() {
$m = $this->getModuleName();
$what = $this->descriptionWhat;
+
return array_merge( parent::getPossibleErrors(), array(
- array( 'code' => 'params', 'info' => "{$m} cannot return corresponding page ids in unique {$what}s mode" ),
+ array(
+ 'code' => 'params',
+ 'info' => "{$m} cannot return corresponding page ids in unique {$what}s mode"
+ ),
) );
}
$name = $this->getModuleName();
$what = $this->descriptionWhat;
$targets = $this->descriptionTargets;
+
return array(
"api.php?action=query&list={$name}&{$p}from=B&{$p}prop=ids|title"
- => "List $targets with page ids they are from, including missing ones. Start at B",
+ => "List $targets with page ids they are from, including missing ones. Start at B",
"api.php?action=query&list={$name}&{$p}unique=&{$p}from=B"
- => "List unique $targets",
+ => "List unique $targets",
"api.php?action=query&generator={$name}&g{$p}unique=&g{$p}from=B"
- => "Gets all $targets, marking the missing ones",
+ => "Gets all $targets, marking the missing ones",
"api.php?action=query&generator={$name}&g{$p}from=B"
- => "Gets pages containing the {$what}s",
+ => "Gets pages containing the {$what}s",
);
}
public function getHelpUrls() {
$name = ucfirst( $this->getModuleName() );
+
return "https://www.mediawiki.org/wiki/API:{$name}";
}
}