* @subpackage SpecialPage
*/
-$options = array( 'full', 'current' );
+$options = array( 'full', 'current', 'server' );
require_once( 'commandLine.inc' );
require_once( 'SpecialExport.php' );
var $reporting = true;
var $pageCount = 0;
var $revCount = 0;
+ var $server = null; // use default
function BackupDumper() {
$this->stderr = fopen( "php://stderr", "wt" );
function &backupDb() {
global $wgDBadminuser, $wgDBadminpassword;
- global $wgDBserver, $wgDBname;
- $db =& new Database( $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname );
+ global $wgDBname;
+ $db =& new Database( $this->backupServer(), $wgDBadminuser, $wgDBadminpassword, $wgDBname );
return $db;
}
+
+ function backupServer() {
+ global $wgDBserver;
+ return $this->server
+ ? $this->server
+ : $wgDBserver;
+ }
function reportPage( $page ) {
$this->pageCount++;
$rate = '-';
$revrate = '-';
}
- $this->progress( "$this->pageCount ($rate pages/sec $revrate revs/sec)" );
+ global $wgDBname;
+ $this->progress( "$wgDBname $this->pageCount ($rate pages/sec $revrate revs/sec)" );
}
}
if( isset( $options['report'] ) ) {
$dumper->reportingInterval = IntVal( $options['report'] );
}
+if( isset( $options['server'] ) ) {
+ $dumper->server = $options['server'];
+}
if( isset( $options['full'] ) ) {
$dumper->dump( MW_EXPORT_FULL );
} elseif( isset( $options['current'] ) ) {