From: Bryan Tong Minh Date: Sat, 30 Apr 2011 21:35:09 +0000 (+0000) Subject: Add --include-files option to dumpBackup.php to include the uploaded files in the... X-Git-Tag: 1.31.0-rc.0~30487 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=99385c945d87074dcbe6bd44079428a45e18fc08;p=lhc%2Fweb%2Fwiklou.git Add --include-files option to dumpBackup.php to include the uploaded files in the XML stream. Uses new backend features from r85911. --- diff --git a/maintenance/backup.inc b/maintenance/backup.inc index 27cf11eca1..206d4433fe 100644 --- a/maintenance/backup.inc +++ b/maintenance/backup.inc @@ -50,6 +50,7 @@ class BackupDumper { var $sink = null; // Output filters var $stubText = false; // include rev_text_id instead of text; for 2-pass dump var $dumpUploads = false; + var $dumpUploadFileContents = false; function BackupDumper( $args ) { $this->stderr = fopen( "php://stderr", "wt" ); @@ -187,6 +188,7 @@ class BackupDumper { $db = $this->backupDb(); $exporter = new WikiExporter( $db, $history, WikiExporter::STREAM, $text ); $exporter->dumpUploads = $this->dumpUploads; + $exporter->dumpUploadFileContents = $this->dumpUploadFileContents; $wrapper = new ExportProgressFilter( $this->sink, $this ); $exporter->setOutputSink( $wrapper ); diff --git a/maintenance/dumpBackup.php b/maintenance/dumpBackup.php index 90e8f72fff..16400297db 100644 --- a/maintenance/dumpBackup.php +++ b/maintenance/dumpBackup.php @@ -59,6 +59,7 @@ if ( isset( $options['end'] ) ) { $dumper->skipHeader = isset( $options['skip-header'] ); $dumper->skipFooter = isset( $options['skip-footer'] ); $dumper->dumpUploads = isset( $options['uploads'] ); +$dumper->dumpUploadFileContents = isset( $options['include-files'] ); $textMode = isset( $options['stub'] ) ? WikiExporter::STUB : WikiExporter::TEXT; @@ -96,7 +97,8 @@ Options: --skip-header Don't output the header --skip-footer Don't output the footer --stub Don't perform old_text lookups; for 2-pass dump - --uploads Include upload records (experimental) + --uploads Include upload records without files + --include-files Include files within the XML stream --conf= Use the specified configuration file (LocalSettings.php) --wiki= Only back up the specified