X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;ds=sidebyside;f=maintenance%2FdumpUploads.php;h=b4df20fe01033b87bec3dca1399f4214eb6f0558;hb=99dcd46f00f5153ed74cebfbafc368e8f3b38f02;hp=64884d527b09112bec33b03e856510fa057cbfe1;hpb=8dee9b773913c17b8f48440389c63608209e6c9f;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/dumpUploads.php b/maintenance/dumpUploads.php index 64884d527b..b4df20fe01 100644 --- a/maintenance/dumpUploads.php +++ b/maintenance/dumpUploads.php @@ -29,7 +29,7 @@ require_once __DIR__ . '/Maintenance.php'; * * @ingroup Maintenance */ -class UploadDumper extends Maintenance { +class DumpUploads extends Maintenance { public function __construct() { parent::__construct(); $this->addDescription( 'Generates list of uploaded files which can be fed to tar or similar. @@ -76,7 +76,7 @@ By default, outputs relative paths against the parent directory of $wgUploadDire * @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 $wgUploadDire * @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 $wgUploadDire 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 $wgUploadDire } } -$maintClass = "UploadDumper"; +$maintClass = DumpUploads::class; require_once RUN_MAINTENANCE_IF_MAIN;