dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "mw.Feedback: If the message is posted remotely, link the title correctly"
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiQueryAllRevisions.php
diff --git
a/includes/api/ApiQueryAllRevisions.php
b/includes/api/ApiQueryAllRevisions.php
index
20746c9
..
6823646
100644
(file)
--- a/
includes/api/ApiQueryAllRevisions.php
+++ b/
includes/api/ApiQueryAllRevisions.php
@@
-1,8
+1,6
@@
<?php
/**
<?php
/**
- * Created on Sep 27, 2015
- *
- * Copyright © 2015 Brad Jorsch "bjorsch@wikimedia.org"
+ * Copyright © 2015 Wikimedia Foundation and contributors
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-63,20
+61,20
@@
class ApiQueryAllRevisions extends ApiQueryRevisionsBase {
}
}
}
}
- $this->addTables( 'revision' );
if ( $resultPageSet === null ) {
$this->parseParameters( $params );
if ( $resultPageSet === null ) {
$this->parseParameters( $params );
- $this->addTables( 'page' );
- $this->addJoinConds(
- [ 'page' => [ 'INNER JOIN', [ 'rev_page = page_id' ] ] ]
+ $revQuery = Revision::getQueryInfo(
+ $this->fetchContent ? [ 'page', 'text' ] : [ 'page' ]
);
);
- $this->addFields( Revision::selectFields() );
- $this->addFields( Revision::selectPageFields() );
+ $this->addTables( $revQuery['tables'] );
+ $this->addFields( $revQuery['fields'] );
+ $this->addJoinConds( $revQuery['joins'] );
// Review this depeneding on the outcome of T113901
$this->addOption( 'STRAIGHT_JOIN' );
} else {
$this->limit = $this->getParameter( 'limit' ) ?: 10;
// Review this depeneding on the outcome of T113901
$this->addOption( 'STRAIGHT_JOIN' );
} else {
$this->limit = $this->getParameter( 'limit' ) ?: 10;
+ $this->addTables( 'revision' );
$this->addFields( [ 'rev_timestamp', 'rev_id' ] );
if ( $params['generatetitles'] ) {
$this->addFields( [ 'rev_page' ] );
$this->addFields( [ 'rev_timestamp', 'rev_id' ] );
if ( $params['generatetitles'] ) {
$this->addFields( [ 'rev_page' ] );
@@
-105,15
+103,6
@@
class ApiQueryAllRevisions extends ApiQueryRevisionsBase {
$this->addFields( 'ts_tags' );
}
$this->addFields( 'ts_tags' );
}
- if ( $this->fetchContent ) {
- $this->addTables( 'text' );
- $this->addJoinConds(
- [ 'text' => [ 'INNER JOIN', [ 'rev_text_id=old_id' ] ] ]
- );
- $this->addFields( 'old_id' );
- $this->addFields( Revision::selectTextFields() );
- }
-
if ( $params['user'] !== null ) {
$id = User::idFromName( $params['user'] );
if ( $id ) {
if ( $params['user'] !== null ) {
$id = User::idFromName( $params['user'] );
if ( $id ) {