return array(
'limit' => 'How many images to return',
'continue' => 'When more results are available, use this to continue',
- 'images' => 'Only list these images. Useful for checking whether a certain page has a certain Image.',
+ 'images' => 'Only list these images. Useful for checking whether a ' .
+ 'certain page has a certain Image.',
'dir' => 'The direction in which to list',
);
}
public function getExamples() {
return array(
- 'api.php?action=query&prop=images&titles=Main%20Page' => 'Get a list of images used in the [[Main Page]]',
- 'api.php?action=query&generator=images&titles=Main%20Page&prop=info' => 'Get information about all images used in the [[Main Page]]',
+ 'api.php?action=query&prop=images&titles=Main%20Page'
+ => 'Get a list of images used in the [[Main Page]]',
+ 'api.php?action=query&generator=images&titles=Main%20Page&prop=info'
+ => 'Get information about all images used in the [[Main Page]]',
);
}
private $pageRestrictions, $pageIsRedir, $pageIsNew, $pageTouched,
$pageLatest, $pageLength;
- private $protections, $watched, $watchers, $notificationtimestamps, $talkids, $subjectids, $displaytitles;
+ private $protections, $watched, $watchers, $notificationtimestamps,
+ $talkids, $subjectids, $displaytitles;
private $showZeroWatchers = false;
private $tokenFunctions;
*/
private function extractPageInfo( $pageid, $title ) {
$pageInfo = array();
- $titleExists = $pageid > 0; //$title->exists() needs pageid, which is not set for all title objects
+ // $title->exists() needs pageid, which is not set for all title objects
+ $titleExists = $pageid > 0;
$ns = $title->getNamespace();
$dbkey = $title->getDBkey();
if ( $this->fld_notificationtimestamp ) {
$pageInfo['notificationtimestamp'] = '';
if ( isset( $this->notificationtimestamps[$ns][$dbkey] ) ) {
- $pageInfo['notificationtimestamp'] = wfTimestamp( TS_ISO_8601, $this->notificationtimestamps[$ns][$dbkey] );
+ $pageInfo['notificationtimestamp'] =
+ wfTimestamp( TS_ISO_8601, $this->notificationtimestamps[$ns][$dbkey] );
}
}
$this->watched[$row->wl_namespace][$row->wl_title] = true;
}
if ( $this->fld_notificationtimestamp ) {
- $this->notificationtimestamps[$row->wl_namespace][$row->wl_title] = $row->wl_notificationtimestamp;
+ $this->notificationtimestamps[$row->wl_namespace][$row->wl_title] =
+ $row->wl_notificationtimestamp;
}
}
}
$result = $this->getResult();
foreach ( $res as $row ) {
if ( ++$count > $params['limit'] ) {
- // We've reached the one extra which shows that there are additional pages to be had. Stop here...
- // Continue string preserved in case the redirect query doesn't pass the limit
- $this->setContinueEnumParameter( 'continue', "{$row->ll_lang}|{$row->ll_title}|{$row->ll_from}" );
+ // We've reached the one extra which shows that there are
+ // additional pages to be had. Stop here... Continue string
+ // preserved in case the redirect query doesn't pass the limit.
+ $this->setContinueEnumParameter(
+ 'continue',
+ "{$row->ll_lang}|{$row->ll_title}|{$row->ll_from}"
+ );
break;
}
$fit = $result->addValue( array( 'query', $this->getModuleName() ), null, $entry );
if ( !$fit ) {
- $this->setContinueEnumParameter( 'continue', "{$row->ll_lang}|{$row->ll_title}|{$row->ll_from}" );
+ $this->setContinueEnumParameter(
+ 'continue',
+ "{$row->ll_lang}|{$row->ll_title}|{$row->ll_from}"
+ );
break;
}
}
public function getExamples() {
return array(
- 'api.php?action=query&prop=langlinks&titles=Main%20Page&redirects=' => 'Get interlanguage links from the [[Main Page]]',
+ 'api.php?action=query&prop=langlinks&titles=Main%20Page&redirects='
+ => 'Get interlanguage links from the [[Main Page]]',
);
}
$this->prefix = 'pl';
$this->description = 'link';
$this->titlesParam = 'titles';
- $this->titlesParamDescription = 'Only list links to these titles. Useful for checking whether a certain page links to a certain title.';
+ $this->titlesParamDescription = 'Only list links to these titles. Useful ' .
+ 'for checking whether a certain page links to a certain title.';
$this->helpUrl = 'https://www.mediawiki.org/wiki/API:Properties#links_.2F_pl';
break;
case self::TEMPLATES:
$this->prefix = 'tl';
$this->description = 'template';
$this->titlesParam = 'templates';
- $this->titlesParamDescription = 'Only list these templates. Useful for checking whether a certain page uses a certain template.';
+ $this->titlesParamDescription = 'Only list these templates. Useful ' .
+ 'for checking whether a certain page uses a certain template.';
$this->helpUrl = 'https://www.mediawiki.org/wiki/API:Properties#templates_.2F_tl';
break;
default:
return array(
"api.php?action=query&prop={$name}&titles=Main%20Page" => "Get {$desc}s from the [[Main Page]]",
- "api.php?action=query&generator={$name}&titles=Main%20Page&prop=info" => "Get information about the {$desc} pages in the [[Main Page]]",
- "api.php?action=query&prop={$name}&titles=Main%20Page&{$this->prefix}namespace=2|10" => "Get {$desc}s from the Main Page in the User and Template namespaces",
+ "api.php?action=query&generator={$name}&titles=Main%20Page&prop=info"
+ => "Get information about the {$desc} pages in the [[Main Page]]",
+ "api.php?action=query&prop={$name}&titles=Main%20Page&{$this->prefix}namespace=2|10"
+ => "Get {$desc}s from the Main Page in the User and Template namespaces",
);
}
$this->addFieldsIf( array( 'log_id', 'page_id' ), $this->fld_ids );
$this->addFieldsIf( array( 'log_user', 'log_user_text', 'user_name' ), $this->fld_user );
$this->addFieldsIf( 'log_user', $this->fld_userid );
- $this->addFieldsIf( array( 'log_namespace', 'log_title' ), $this->fld_title || $this->fld_parsedcomment );
+ $this->addFieldsIf(
+ array( 'log_namespace', 'log_title' ),
+ $this->fld_title || $this->fld_parsedcomment
+ );
$this->addFieldsIf( 'log_comment', $this->fld_comment || $this->fld_parsedcomment );
$this->addFieldsIf( 'log_params', $this->fld_details );
if ( !is_null( $params['tag'] ) ) {
$this->addTables( 'change_tag' );
- $this->addJoinConds( array( 'change_tag' => array( 'INNER JOIN', array( 'log_id=ct_log_id' ) ) ) );
+ $this->addJoinConds( array( 'change_tag' => array( 'INNER JOIN',
+ array( 'log_id=ct_log_id' ) ) ) );
$this->addWhereFld( 'ct_tag', $params['tag'] );
$index['change_tag'] = 'change_tag_tag_id';
}
$index['logging'] = 'type_time';
}
- $this->addTimestampWhereRange( 'log_timestamp', $params['dir'], $params['start'], $params['end'] );
+ $this->addTimestampWhereRange(
+ 'log_timestamp',
+ $params['dir'],
+ $params['start'],
+ $params['end']
+ );
$limit = $params['limit'];
$this->addOption( 'LIMIT', $limit + 1 );
$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...
+ // We've reached the one extra which shows that there are
+ // additional pages to be had. Stop here...
$this->setContinueEnumParameter( 'start', wfTimestamp( TS_ISO_8601, $row->log_timestamp ) );
break;
}
* @param $legacy bool
* @return array
*/
- public static function addLogParams( $result, &$vals, $params, $type, $action, $ts, $legacy = false ) {
+ public static function addLogParams( $result, &$vals, $params, $type,
+ $action, $ts, $legacy = false
+ ) {
switch ( $type ) {
case 'move':
if ( $legacy ) {
$count = 0;
foreach ( $this->select( __METHOD__ ) as $row ) {
if ( ++$count > $limit ) {
- // We've reached the one extra which shows that there are additional pages to be had. Stop here...
+ // We've reached the one extra which shows that there are
+ // additional pages to be had. Stop here...
$this->setContinueEnumParameter( 'continue', $row->pp_propname );
break;
}
public function getParamDescription() {
return array(
'continue' => 'When more results are available, use this to continue',
- 'prop' => 'Only list these props. Useful for checking whether a certain page uses a certain page prop',
+ 'prop' => 'Only list these props. Useful for checking whether a ' .
+ 'certain page uses a certain page prop',
);
}