From: Brion Vibber Date: Wed, 13 Jul 2005 01:57:43 +0000 (+0000) Subject: * Accept --server option for database to read main query from on backup X-Git-Tag: 1.5.0beta4~148 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=3c969fb74179909d6d995e19c49ca412e80804da;p=lhc%2Fweb%2Fwiklou.git * Accept --server option for database to read main query from on backup --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d357000d96..d7b93bfc4c 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -565,6 +565,7 @@ of MediaWiki:Newpagetext) to &action=edit, if page is new. * Nynorsk numeric format fix * (bug 2825) Fix regression in newtalk notifications for anons w/ enotif off * (bug 2833) Fix bug in previous fix +* Accept --server option for database to read main query from on backup === Caveats === diff --git a/maintenance/dumpBackup.php b/maintenance/dumpBackup.php index 28ff27cb31..8eaba39476 100644 --- a/maintenance/dumpBackup.php +++ b/maintenance/dumpBackup.php @@ -22,7 +22,7 @@ * @subpackage SpecialPage */ -$options = array( 'full', 'current' ); +$options = array( 'full', 'current', 'server' ); require_once( 'commandLine.inc' ); require_once( 'SpecialExport.php' ); @@ -32,6 +32,7 @@ class BackupDumper { var $reporting = true; var $pageCount = 0; var $revCount = 0; + var $server = null; // use default function BackupDumper() { $this->stderr = fopen( "php://stderr", "wt" ); @@ -61,10 +62,17 @@ class BackupDumper { 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++; @@ -91,7 +99,8 @@ class BackupDumper { $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)" ); } } @@ -107,6 +116,9 @@ if( isset( $options['quiet'] ) ) { 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'] ) ) {