$ts = $db->addQuotes( $db->timestamp( $cont[2] ) );
$op = ( $dir == 'newer' ? '>' : '<' );
$this->addWhere( "ar_namespace $op $ns OR " .
- "(ar_namespace = $ns AND " .
- "(ar_title $op $title OR " .
- "(ar_title = $title AND " .
- "ar_timestamp $op= $ts)))" );
+ "(ar_namespace = $ns AND " .
+ "(ar_title $op $title OR " .
+ "(ar_title = $title AND " .
+ "ar_timestamp $op= $ts)))" );
}
$this->addOption( 'LIMIT', $limit + 1 );
$this->addOption( 'ORDER BY', array(
'ar_title' . $sort,
'ar_timestamp' . $sort
- ));
+ ) );
}
} else {
if ( $mode == 'revs' ) {
public function getDescription() {
$p = $this->getModulePrefix();
+
return array(
'List deleted revisions.',
'Operates in three modes:',
$result = $this->getResult();
$count = 0;
foreach ( $res as $row ) {
- if ( ++ $count > $limit ) {
+ if ( ++$count > $limit ) {
// We've reached the one extra which shows that there are additional pages to be had. Stop here...
$this->setContinueEnumParameter( 'offset', $offset + $limit );
break;
if ( is_null( $resultPageSet ) ) {
$result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ),
- $this->getModulePrefix() );
+ $this->getModulePrefix() );
}
}
$protocols[] = substr( $p, 0, strpos( $p, ':' ) );
}
}
+
return $protocols;
}
public function getParamDescription() {
$p = $this->getModulePrefix();
+
return array(
'limit' => 'How many links to return',
'offset' => 'When more results are available, use this to continue',
public function getParamDescription() {
$p = $this->getModulePrefix();
+
return array(
'prop' => array(
'Which repository properties to get (there may be more available on some wikis):',
}
if ( $fld_metadata ) {
$file['metadata'] = $row->fa_metadata
- ? ApiQueryImageInfo::processMetaData( unserialize( $row->fa_metadata ), $result )
- : null;
+ ? ApiQueryImageInfo::processMetaData( unserialize( $row->fa_metadata ), $result )
+ : null;
}
if ( $fld_bitdepth ) {
$file['bitdepth'] = $row->fa_bits;
$this->addOption( 'ORDER BY', array(
'iwl_title' . $sort,
'iwl_from' . $sort
- ));
+ ) );
}
} else {
$this->addOption( 'ORDER BY', array(
'iwl_prefix' . $sort,
'iwl_title' . $sort,
'iwl_from' . $sort
- ));
+ ) );
}
$this->addOption( 'LIMIT', $params['limit'] + 1 );
$count = 0;
$result = $this->getResult();
foreach ( $res as $row ) {
- if ( ++ $count > $params['limit'] ) {
+ 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->iwl_prefix}|{$row->iwl_title}|{$row->iwl_from}" );
$this->addOption( 'ORDER BY', 'iwl_from' . $sort );
} else {
$this->addOption( 'ORDER BY', array(
- 'iwl_from' . $sort,
- 'iwl_title' . $sort
- ));
+ 'iwl_from' . $sort,
+ 'iwl_title' . $sort
+ ) );
}
} else {
// Don't order by iwl_from if it's constant in the WHERE clause
$this->addOption( 'ORDER BY', 'iwl_prefix' . $sort );
} else {
$this->addOption( 'ORDER BY', array(
- 'iwl_from' . $sort,
- 'iwl_prefix' . $sort,
- 'iwl_title' . $sort
- ));
+ 'iwl_from' . $sort,
+ 'iwl_prefix' . $sort,
+ 'iwl_title' . $sort
+ ) );
}
}
if ( !$h ) {
$this->setWarning( 'Could not create thumbnail because ' .
$image->getName() . ' does not have an associated image handler' );
+
return $thumbParams;
}
// handlers.
$this->setWarning( "Could not parse {$p}urlparam for " . $image->getName()
. '. Using only width and height' );
+
return $thumbParams;
}
$uploadwarning = isset( $prop['uploadwarning'] );
if ( ( $url || $sha1 || $meta || $mime || $mediatype || $archive || $bitdepth )
- && $file->isDeleted( File::DELETED_FILE ) ) {
+ && $file->isDeleted( File::DELETED_FILE )
+ ) {
$vals['filehidden'] = '';
//Early return, tidier than indenting all following things one level
}
}
$result->setIndexedTagName( $retval, 'metadata' );
+
return $retval;
}
if ( $start === null ) {
$start = $img->getTimestamp();
}
+
return $img->getOriginalTitle()->getDBkey() . '|' . $start;
}
public function getAllowedParams() {
global $wgContLang;
+
return array(
'prop' => array(
ApiBase::PARAM_ISMULTI => true,
*/
public function getParamDescription() {
$p = $this->getModulePrefix();
+
return array(
'prop' => self::getPropertyDescriptions( array(), $p ),
'urlwidth' => array( "If {$p}prop=url is set, a URL to an image scaled to this width will be returned.",
'start' => 'Timestamp to start listing from',
'end' => 'Timestamp to stop listing at',
'metadataversion' => array( "Version of metadata to use. if 'latest' is specified, use latest version.",
- "Defaults to '1' for backwards compatibility" ),
+ "Defaults to '1' for backwards compatibility" ),
'extmetadatalanguage' => array( 'What language to fetch extmetadata in. This affects both which',
- 'translation to fetch, if multiple are available, as well as how things',
- 'like numbers and various values are formatted.' ),
+ 'translation to fetch, if multiple are available, as well as how things',
+ 'like numbers and various values are formatted.' ),
'extmetadatamultilang' => 'If translations for extmetadata property are available, fetch all of them.',
'continue' => 'If the query response includes a continue value, use it here to get another page of results',
'localonly' => 'Look only for files in the local repository',
)
),
);
+
return array_diff_key( $props, array_flip( $filter ) );
}
public function getPossibleErrors() {
$p = $this->getModulePrefix();
+
return array_merge( parent::getPossibleErrors(), array(
array( 'code' => "{$p}urlwidth", 'info' => "{$p}urlheight cannot be used without {$p}urlwidth" ),
array( 'code' => 'urlparam', 'info' => "Invalid value for {$p}urlparam" ),
$this->addOption( 'ORDER BY', 'il_to' . $sort );
} else {
$this->addOption( 'ORDER BY', array(
- 'il_from' . $sort,
- 'il_to' . $sort
- ));
+ 'il_from' . $sort,
+ 'il_to' . $sort
+ ) );
}
$this->addOption( 'LIMIT', $params['limit'] + 1 );
'watch' => array( 'ApiQueryInfo', 'getWatchToken' ),
);
wfRunHooks( 'APIQueryInfoTokens', array( &$this->tokenFunctions ) );
+
return $this->tokenFunctions;
}
), $pageid, $pageInfo );
if ( !$fit ) {
$this->setContinueEnumParameter( 'continue',
- $title->getNamespace() . '|' .
- $title->getText() );
+ $title->getNamespace() . '|' .
+ $title->getText() );
break;
}
}
$this->resetQueryParams();
$this->addTables( 'page_restrictions' );
$this->addFields( array( 'pr_page', 'pr_type', 'pr_level',
- 'pr_expiry', 'pr_cascade' ) );
+ 'pr_expiry', 'pr_cascade' ) );
$this->addWhereFld( 'pr_page', array_keys( $this->titles ) );
$res = $this->select( __METHOD__ );
$this->resetQueryParams();
$this->addTables( array( 'page_restrictions', 'page', 'templatelinks' ) );
$this->addFields( array( 'pr_type', 'pr_level', 'pr_expiry',
- 'page_title', 'page_namespace',
- 'tl_title', 'tl_namespace' ) );
+ 'page_title', 'page_namespace',
+ 'tl_title', 'tl_namespace' ) );
$this->addWhere( $lb->constructSet( 'tl', $db ) );
$this->addWhere( 'pr_page = page_id' );
$this->addWhere( 'pr_page = tl_from' );
$this->resetQueryParams();
$this->addTables( array( 'page_restrictions', 'page', 'imagelinks' ) );
$this->addFields( array( 'pr_type', 'pr_level', 'pr_expiry',
- 'page_title', 'page_namespace', 'il_to' ) );
+ 'page_title', 'page_namespace', 'il_to' ) );
$this->addWhere( 'pr_page = page_id' );
$this->addWhere( 'pr_page = il_from' );
$this->addWhereFld( 'pr_cascade', 1 );
foreach ( $res as $row ) {
if ( MWNamespace::isTalk( $row->page_namespace ) ) {
$this->talkids[MWNamespace::getSubject( $row->page_namespace )][$row->page_title] =
- intval( $row->page_id );
+ intval( $row->page_id );
} else {
$this->subjectids[MWNamespace::getTalk( $row->page_namespace )][$row->page_title] =
- intval( $row->page_id );
+ intval( $row->page_id );
}
}
}
if ( !is_null( $params['token'] ) ) {
return 'private';
}
+
return 'public';
}