$opts = array( 'ORDER BY' => 'page_id ASC' );
$opts['USE INDEX'] = array();
$join = array();
- # Latest revision dumps...
- if( $this->history & WikiExporter::CURRENT ) {
- if( $this->list_authors && $cond != '' ) { // List authors, if so desired
- list($page,$revision) = $this->db->tableNamesN('page','revision');
- $this->do_list_authors( $page, $revision, $cond );
- }
- $join['revision'] = array('INNER JOIN','page_id=rev_page AND page_latest=rev_id');
- # "Stable" revision dumps...
- } elseif( $this->history & WikiExporter::STABLE ) {
- # Default JOIN, to be overridden...
- $join['revision'] = array('INNER JOIN','page_id=rev_page AND page_latest=rev_id');
- # One, and only one hook should set this, and return false
- if( wfRunHooks( 'WikiExporter::dumpStableQuery', array(&$tables,&$opts,&$join) ) ) {
- wfProfileOut( __METHOD__ );
- return new WikiError( __METHOD__." given invalid history dump type." );
- }
- # Time offset/limit for all pages/history...
- } elseif( is_array( $this->history ) ) {
+ if( is_array( $this->history ) ) {
+ # Time offset/limit for all pages/history...
$revJoin = 'page_id=rev_page';
# Set time order
if( $this->history['dir'] == 'asc' ) {
if( !empty( $this->history['limit'] ) ) {
$opts['LIMIT'] = intval( $this->history['limit'] );
}
- # Full history dumps...
} elseif( $this->history & WikiExporter::FULL ) {
+ # Full history dumps...
$join['revision'] = array('INNER JOIN','page_id=rev_page');
- # Uknown history specification parameter?
+ } elseif( $this->history & WikiExporter::CURRENT ) {
+ # Latest revision dumps...
+ if( $this->list_authors && $cond != '' ) { // List authors, if so desired
+ list($page,$revision) = $this->db->tableNamesN('page','revision');
+ $this->do_list_authors( $page, $revision, $cond );
+ }
+ $join['revision'] = array('INNER JOIN','page_id=rev_page AND page_latest=rev_id');
+ } elseif( $this->history & WikiExporter::STABLE ) {
+ # "Stable" revision dumps...
+ # Default JOIN, to be overridden...
+ $join['revision'] = array('INNER JOIN','page_id=rev_page AND page_latest=rev_id');
+ # One, and only one hook should set this, and return false
+ if( wfRunHooks( 'WikiExporter::dumpStableQuery', array(&$tables,&$opts,&$join) ) ) {
+ wfProfileOut( __METHOD__ );
+ return new WikiError( __METHOD__." given invalid history dump type." );
+ }
} else {
+ # Uknown history specification parameter?
wfProfileOut( __METHOD__ );
return new WikiError( __METHOD__." given invalid history dump type." );
}