X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FdumpUploads.php;h=40cac1b0ea23ae01d86294dc248d51b2e41de9f0;hb=7afced64454ad30d688540f7626448ac2faefebb;hp=c4ca056c59bf7528e16d4934737506310967eb99;hpb=37e011b5554dd9b2966ccfdbef9a9bc8309a233f;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/dumpUploads.php b/maintenance/dumpUploads.php index c4ca056c59..40cac1b0ea 100644 --- a/maintenance/dumpUploads.php +++ b/maintenance/dumpUploads.php @@ -32,6 +32,9 @@ require_once __DIR__ . '/Maintenance.php'; * @ingroup Maintenance */ class DumpUploads extends Maintenance { + /** @var string */ + private $mBasePath; + public function __construct() { parent::__construct(); $this->addDescription( 'Generates list of uploaded files which can be fed to tar or similar. @@ -44,30 +47,29 @@ By default, outputs relative paths against the parent directory of $wgUploadDire public function execute() { global $IP; - $this->mAction = 'fetchLocal'; $this->mBasePath = $this->getOption( 'base', $IP ); - $this->mShared = false; - $this->mSharedSupplement = false; - - if ( $this->hasOption( 'local' ) ) { - $this->mAction = 'fetchLocal'; - } - - if ( $this->hasOption( 'used' ) ) { - $this->mAction = 'fetchUsed'; - } + $shared = false; + $sharedSupplement = false; if ( $this->hasOption( 'shared' ) ) { if ( $this->hasOption( 'used' ) ) { // Include shared-repo files in the used check - $this->mShared = true; + $shared = true; } else { // Grab all local *plus* used shared - $this->mSharedSupplement = true; + $sharedSupplement = true; } } - $this->{$this->mAction} ( $this->mShared ); - if ( $this->mSharedSupplement ) { + + if ( $this->hasOption( 'local' ) ) { + $this->fetchLocal( $shared ); + } elseif ( $this->hasOption( 'used' ) ) { + $this->fetchUsed( $shared ); + } else { + $this->fetchLocal( $shared ); + } + + if ( $sharedSupplement ) { $this->fetchUsed( true ); } }