r87176 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87175‎ | r87176 | r87177 >
Date:21:35, 30 April 2011
Author:btongminh
Status:ok (Comments)
Tags:todo 
Comment:
Add --include-files option to dumpBackup.php to include the uploaded files in the XML stream. Uses new backend features from r85911.
Modified paths:
  • /trunk/phase3/maintenance/backup.inc (modified) (history)
  • /trunk/phase3/maintenance/dumpBackup.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/backup.inc
@@ -50,6 +50,7 @@
5151 var $sink = null; // Output filters
5252 var $stubText = false; // include rev_text_id instead of text; for 2-pass dump
5353 var $dumpUploads = false;
 54+ var $dumpUploadFileContents = false;
5455
5556 function BackupDumper( $args ) {
5657 $this->stderr = fopen( "php://stderr", "wt" );
@@ -187,6 +188,7 @@
188189 $db = $this->backupDb();
189190 $exporter = new WikiExporter( $db, $history, WikiExporter::STREAM, $text );
190191 $exporter->dumpUploads = $this->dumpUploads;
 192+ $exporter->dumpUploadFileContents = $this->dumpUploadFileContents;
191193
192194 $wrapper = new ExportProgressFilter( $this->sink, $this );
193195 $exporter->setOutputSink( $wrapper );
Index: trunk/phase3/maintenance/dumpBackup.php
@@ -59,6 +59,7 @@
6060 $dumper->skipHeader = isset( $options['skip-header'] );
6161 $dumper->skipFooter = isset( $options['skip-footer'] );
6262 $dumper->dumpUploads = isset( $options['uploads'] );
 63+$dumper->dumpUploadFileContents = isset( $options['include-files'] );
6364
6465 $textMode = isset( $options['stub'] ) ? WikiExporter::STUB : WikiExporter::TEXT;
6566
@@ -96,7 +97,8 @@
9798 --skip-header Don't output the <mediawiki> header
9899 --skip-footer Don't output the </mediawiki> footer
99100 --stub Don't perform old_text lookups; for 2-pass dump
100 - --uploads Include upload records (experimental)
 101+ --uploads Include upload records without files
 102+ --include-files Include files within the XML stream
101103 --conf=<file> Use the specified configuration file (LocalSettings.php)
102104
103105 --wiki=<wiki> Only back up the specified <wiki>

Follow-up revisions

RevisionCommit summaryAuthorDate
r88145Follow-up r87176: Make importDump.php import files...btongminh10:39, 15 May 2011
r88148Follow-up r87176 use wfLocalFile instead of wfFindFilebtongminh10:43, 15 May 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r85911Add support for importing/exporting files. This can be done by embedding the ...btongminh19:25, 12 April 2011

Comments

#Comment by MaxSem (talk | contribs)   06:30, 1 May 2011

RELEASE-NOTES?

#Comment by Bryan (talk | contribs)   15:17, 1 May 2011

I will, once I get importDump.php to also import those new XML files.

#Comment by Brion VIBBER (talk | contribs)   23:24, 7 June 2011

Does this also require specifying --uploads? I see nothing much extra in output passing just --include-files; if a requirement, needs documenting. Otherwise perhaps it should imply --uploads?

Marking todo rather than fixme as this is an experimental feature, not used by default.

#Comment by Bryan (talk | contribs)   08:02, 18 June 2011

As you correctly stated on r85911, embedding files into XML streams might give problems. With r88145 and follow-ups it is possible to import the files from a separate directory if only the bare upload records are available.

Status & tagging log