Follow-up I41cc21708: Add to RELEASE-NOTES as it's now a pre-release patch
[lhc/web/wiklou.git] / maintenance / dumpBackup.php
index 18737a4..6bbd86d 100644 (file)
@@ -31,7 +31,7 @@ class DumpBackup extends BackupDumper {
        function __construct( $args = null ) {
                parent::__construct();
 
-               $this->mDescription = <<<TEXT
+               $this->addDescription( <<<TEXT
 This script dumps the wiki page or logging database into an
 XML interchange wrapper format for export or backup.
 
@@ -40,7 +40,8 @@ XML output is sent to stdout; progress reports are sent to stderr.
 WARNING: this is not a full database dump! It is merely for public export
          of your wiki. For full backup, see our online help at:
          https://www.mediawiki.org/wiki/Backup
-TEXT;
+TEXT
+               );
                $this->stderr = fopen( "php://stderr", "wt" );
                // Actions
                $this->addOption( 'full', 'Dump all revisions of every page' );
@@ -49,6 +50,8 @@ TEXT;
                $this->addOption( 'stable', 'Dump stable versions of pages' );
                $this->addOption( 'revrange', 'Dump range of revisions specified by revstart and ' .
                        'revend parameters' );
+               $this->addOption( 'orderrevs', 'Dump revisions in ascending revision order ' .
+                       '(implies dump of a range of pages)' );
                $this->addOption( 'pagelist',
                        'Dump only pages included in the file', false, true );
                // Options
@@ -84,7 +87,7 @@ TEXT;
                } elseif ( $this->hasOption( 'revrange' ) ) {
                        $this->dump( WikiExporter::RANGE, $textMode );
                } else {
-                       $this->error( 'No valid action specified.', 1 );
+                       $this->fatalError( 'No valid action specified.' );
                }
        }
 
@@ -101,7 +104,9 @@ TEXT;
                                $this->fatalError( "Unable to open file {$filename}\n" );
                        }
                        $pages = array_map( 'trim', $pages );
-                       $this->pages = array_filter( $pages, create_function( '$x', 'return $x !== "";' ) );
+                       $this->pages = array_filter( $pages, function ( $x ) {
+                               return $x !== '';
+                       } );
                }
 
                if ( $this->hasOption( 'start' ) ) {
@@ -124,8 +129,9 @@ TEXT;
                $this->skipFooter = $this->hasOption( 'skip-footer' );
                $this->dumpUploads = $this->hasOption( 'uploads' );
                $this->dumpUploadFileContents = $this->hasOption( 'include-files' );
+               $this->orderRevs = $this->hasOption( 'orderrevs' );
        }
 }
 
-$maintClass = 'DumpBackup';
+$maintClass = DumpBackup::class;
 require_once RUN_MAINTENANCE_IF_MAIN;