#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
-# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# http://www.gnu.org/copyleft/gpl.html
/**
*
*/
/** */
-require_once( 'Revision.php' );
define( 'MW_EXPORT_FULL', 0 );
define( 'MW_EXPORT_CURRENT', 1 );
}
if( $cond == '' ) {
// Optimization hack for full-database dump
- $pageindex = 'FORCE INDEX (PRIMARY)';
- $revindex = 'FORCE INDEX (PRIMARY)';
+ $revindex = $pageindex = $this->db->useIndexClause("PRIMARY");
$straight = ' /*! STRAIGHT_JOIN */ ';
} else {
$pageindex = '';
$ts = wfTimestamp( TS_ISO_8601, $row->rev_timestamp );
$out .= " " . wfElement( 'timestamp', null, $ts ) . "\n";
- if( $row->rev_deleted & MW_REV_DELETED_USER ) {
+ if( $row->rev_deleted & Revision::MW_REV_DELETED_USER ) {
$out .= " " . wfElement( 'contributor', array( 'deleted' => 'deleted' ) ) . "\n";
} else {
$out .= " <contributor>\n";
if( $row->rev_minor_edit ) {
$out .= " <minor/>\n";
}
- if( $row->rev_deleted & MW_REV_DELETED_COMMENT ) {
+ if( $row->rev_deleted & Revision::MW_REV_DELETED_COMMENT ) {
$out .= " " . wfElement( 'comment', array( 'deleted' => 'deleted' ) ) . "\n";
} elseif( $row->rev_comment != '' ) {
$out .= " " . wfElementClean( 'comment', null, strval( $row->rev_comment ) ) . "\n";
}
- if( $row->rev_deleted & MW_REV_DELETED_TEXT ) {
+ if( $row->rev_deleted & Revision::MW_REV_DELETED_TEXT ) {
$out .= " " . wfElement( 'text', array( 'deleted' => 'deleted' ) ) . "\n";
} elseif( isset( $row->old_text ) ) {
// Raw text from the database may have invalid chars
class Dump7ZipOutput extends DumpPipeOutput {
function Dump7ZipOutput( $file ) {
$command = "7za a -bd -si " . wfEscapeShellArg( $file );
+ // Suppress annoying useless crap from p7zip
+ // Unfortunately this could suppress real error messages too
+ $command .= " >/dev/null 2>&1";
parent::DumpPipeOutput( $command );
}
}
$ns = intval( $key );
$this->namespaces[$ns] = true;
} else {
- wfDie( "Unrecognized namespace key '$key'\n" );
+ throw new MWException( "Unrecognized namespace key '$key'\n" );
}
}
}