* various row objects and XML output for filtering. Filters
* can be chained or used as callbacks.
*
- * @param DumpOutput $sink
+ * @param DumpOutput &$sink
*/
public function setOutputSink( &$sink ) {
$this->sink =& $sink;
/**
* @param string $cond
+ * @param bool $orderRevs
* @throws MWException
* @throws Exception
*/
protected function dumpFrom( $cond = '', $orderRevs = false ) {
# For logging dumps...
if ( $this->history & self::LOGS ) {
- $where = [ 'user_id = log_user' ];
+ $where = [];
# Hide private logs
$hideLogs = LogEventsList::getExcludeClause( $this->db );
if ( $hideLogs ) {
$prev = $this->db->bufferResults( false );
}
$result = null; // Assuring $result is not undefined, if exception occurs early
+
+ $commentQuery = CommentStore::getStore()->getJoin( 'log_comment' );
+
try {
- $result = $this->db->select( [ 'logging', 'user' ],
- [ "{$logging}.*", 'user_name' ], // grab the user name
+ $result = $this->db->select( [ 'logging', 'user' ] + $commentQuery['tables'],
+ [ "{$logging}.*", 'user_name' ] + $commentQuery['fields'], // grab the user name
$where,
__METHOD__,
- [ 'ORDER BY' => 'log_id', 'USE INDEX' => [ 'logging' => 'PRIMARY' ] ]
+ [ 'ORDER BY' => 'log_id', 'USE INDEX' => [ 'logging' => 'PRIMARY' ] ],
+ [ 'user' => [ 'JOIN', 'user_id = log_user' ] ] + $commentQuery['joins']
);
$this->outputLogStream( $result );
if ( $this->buffer == self::STREAM ) {
Hooks::run( 'ModifyExportQuery',
[ $this->db, &$tables, &$cond, &$opts, &$join ] );
+ $commentQuery = CommentStore::getStore()->getJoin( 'rev_comment' );
+
# Do the query!
- $result = $this->db->select( $tables, '*', $cond, __METHOD__, $opts, $join );
+ $result = $this->db->select(
+ $tables + $commentQuery['tables'],
+ [ '*' ] + $commentQuery['fields'],
+ $cond,
+ __METHOD__,
+ $opts,
+ $join + $commentQuery['joins']
+ );
# Output dump results
$this->outputPageStream( $result );