$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'] );
- global $wgOldChangeTagsIndex;
- $index['change_tag'] = $wgOldChangeTagsIndex ? 'ct_tag' : 'change_tag_tag_id';
+ $index['change_tag'] = 'change_tag_tag_id';
}
if ( !is_null( $params['action'] ) ) {
$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 );
$res = $this->select( __METHOD__ );
$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...
$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 ) {
$result->setIndexedTagName_recursive( $logParams, 'param' );
$vals = array_merge( $vals, $logParams );
}
+
return $vals;
}
public function getAllowedParams() {
global $wgLogTypes, $wgLogActions, $wgLogActionsHandlers;
+
return array(
'prop' => array(
ApiBase::PARAM_ISMULTI => true,
public function getParamDescription() {
$p = $this->getModulePrefix();
+
return array(
'prop' => array(
'Which properties to get',
public function getResultProperties() {
global $wgLogTypes;
+
return array(
'ids' => array(
'logid' => 'integer',