X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/mediawiki.git/blobdiff_plain/74c929b24b048c9f1e31e17db757ae4195cd7673..18a6620945d02687fbcfc4c27355d952fd748b41:/maintenance/dumpBackup.php diff --git a/maintenance/dumpBackup.php b/maintenance/dumpBackup.php index de7ce655..90e8f72f 100644 --- a/maintenance/dumpBackup.php +++ b/maintenance/dumpBackup.php @@ -1,6 +1,9 @@ + * Script that dumps wiki pages or logging database into an XML interchange + * wrapper format for export or backup + * + * Copyright © 2005 Brion Vibber * http://www.mediawiki.org/ * * This program is free software; you can redistribute it and/or modify @@ -26,12 +29,12 @@ $originalDir = getcwd(); $optionsWithArgs = array( 'pagelist', 'start', 'end' ); -require_once( 'commandLine.inc' ); +require_once( dirname( __FILE__ ) . '/commandLine.inc' ); require_once( 'backup.inc' ); $dumper = new BackupDumper( $argv ); -if( isset( $options['quiet'] ) ) { +if ( isset( $options['quiet'] ) ) { $dumper->reporting = false; } @@ -47,10 +50,10 @@ if ( isset( $options['pagelist'] ) ) { $dumper->pages = array_filter( $pages, create_function( '$x', 'return $x !== "";' ) ); } -if( isset( $options['start'] ) ) { +if ( isset( $options['start'] ) ) { $dumper->startId = intval( $options['start'] ); } -if( isset( $options['end'] ) ) { +if ( isset( $options['end'] ) ) { $dumper->endId = intval( $options['end'] ); } $dumper->skipHeader = isset( $options['skip-header'] ); @@ -59,45 +62,51 @@ $dumper->dumpUploads = isset( $options['uploads'] ); $textMode = isset( $options['stub'] ) ? WikiExporter::STUB : WikiExporter::TEXT; -if( isset( $options['full'] ) ) { +if ( isset( $options['full'] ) ) { $dumper->dump( WikiExporter::FULL, $textMode ); -} elseif( isset( $options['current'] ) ) { +} elseif ( isset( $options['current'] ) ) { $dumper->dump( WikiExporter::CURRENT, $textMode ); -} elseif( isset( $options['logs'] ) ) { +} elseif ( isset( $options['stable'] ) ) { + $dumper->dump( WikiExporter::STABLE, $textMode ); +} elseif ( isset( $options['logs'] ) ) { $dumper->dump( WikiExporter::LOGS ); } else { $dumper->progress( << [] Actions: - --full Dump complete history of every page. - --current Includes only the latest revision of each page. - --logs Dump action logs for every page. + --full Dump all revisions of every page. + --current Dump only the latest revision of every page. + --logs Dump all log events. + --stable Stable versions of pages? + --pagelist= + Where is a list of page titles to be dumped Options: --quiet Don't dump status reports to stderr. --report=n Report position and speed after every n pages processed. - (Default: 100) + (Default: 100) --server=h Force reading from MySQL server h - --start=n Start from page_id n - --end=n Stop before page_id n (exclusive) + --start=n Start from page_id or log_id n + --end=n Stop before page_id or log_id n (exclusive) --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) + --conf= Use the specified configuration file (LocalSettings.php) + + --wiki= Only back up the specified -Fancy stuff: +Fancy stuff: (Works? Add examples please.) --plugin=[:] Load a dump plugin class --output=: Begin a filtered output stream; - s: file, gzip, bzip2, 7zip + s: file, gzip, bzip2, 7zip --filter=[:] Add a filter on an output branch ENDS ); } - -