X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/categories/supprimer.php?a=blobdiff_plain;f=maintenance%2FdumpUploads.php;h=b4df20fe01033b87bec3dca1399f4214eb6f0558;hb=5f2cb872b587a601a6a07624802e7b56d76e2e95;hp=026ac025c083cfc36283bd7b6164653315d7e020;hpb=53be5c92adab85c799754775e6b68c30fed6bf9c;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/dumpUploads.php b/maintenance/dumpUploads.php index 026ac025c0..b4df20fe01 100644 --- a/maintenance/dumpUploads.php +++ b/maintenance/dumpUploads.php @@ -29,11 +29,11 @@ require_once __DIR__ . '/Maintenance.php'; * * @ingroup Maintenance */ -class UploadDumper extends Maintenance { +class DumpUploads 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' ); @@ -76,7 +76,7 @@ By default, outputs relative paths against the parent directory of \$wgUploadDir * @param bool $shared True to pass shared-dir settings to hash func */ function fetchUsed( $shared ) { - $dbr = $this->getDB( DB_SLAVE ); + $dbr = $this->getDB( DB_REPLICA ); $image = $dbr->tableName( 'image' ); $imagelinks = $dbr->tableName( 'imagelinks' ); @@ -97,9 +97,9 @@ By default, outputs relative paths against the parent directory of \$wgUploadDir * @param bool $shared True to pass shared-dir settings to hash func */ function fetchLocal( $shared ) { - $dbr = $this->getDB( DB_SLAVE ); + $dbr = $this->getDB( DB_REPLICA ); $result = $dbr->select( 'image', - array( 'img_name' ), + [ 'img_name' ], '', __METHOD__ ); @@ -111,7 +111,7 @@ By default, outputs relative paths against the parent directory of \$wgUploadDir 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 { @@ -124,5 +124,5 @@ By default, outputs relative paths against the parent directory of \$wgUploadDir } } -$maintClass = "UploadDumper"; +$maintClass = DumpUploads::class; require_once RUN_MAINTENANCE_IF_MAIN;