class UploadDumper extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Generates list of uploaded files which can be fed to tar or similar.
-By default, outputs relative paths against the parent directory of \$wgUploadDirectory.";
+ $this->addDescription( 'Generates list of uploaded files which can be fed to tar or similar.
+By default, outputs relative paths against the parent directory of $wgUploadDirectory.' );
$this->addOption( 'base', 'Set base relative path instead of wiki include root', false, true );
$this->addOption( 'local', 'List all local files, used or not. No shared files included' );
$this->addOption( 'used', 'Skip local images that are not used' );
function fetchLocal( $shared ) {
$dbr = $this->getDB( DB_SLAVE );
$result = $dbr->select( 'image',
- array( 'img_name' ),
+ [ 'img_name' ],
'',
__METHOD__ );
function outputItem( $name, $shared ) {
$file = wfFindFile( $name );
if ( $file && $this->filterItem( $file, $shared ) ) {
- $filename = $file->getPath();
+ $filename = $file->getLocalRefPath();
$rel = wfRelativePath( $filename, $this->mBasePath );
$this->output( "$rel\n" );
} else {