X-Git-Url: https://git.cyclocoop.org/%28%28?a=blobdiff_plain;f=maintenance%2FdumpUploads.php;h=64884d527b09112bec33b03e856510fa057cbfe1;hb=00cef5ba5952d23e315f031a56c08855fd266b98;hp=1a9293cb59dc75ffd062d04b6d82748da62fee25;hpb=e7651f865d31dd6203828cf509383da2ea7515c3;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/dumpUploads.php b/maintenance/dumpUploads.php index 1a9293cb59..64884d527b 100644 --- a/maintenance/dumpUploads.php +++ b/maintenance/dumpUploads.php @@ -32,8 +32,8 @@ require_once __DIR__ . '/Maintenance.php'; 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' ); @@ -64,7 +64,7 @@ By default, outputs relative paths against the parent directory of \$wgUploadDir $this->mSharedSupplement = true; } } - $this-> { $this->mAction } ( $this->mShared ); + $this->{$this->mAction} ( $this->mShared ); if ( $this->mSharedSupplement ) { $this->fetchUsed( true ); } @@ -73,10 +73,10 @@ By default, outputs relative paths against the parent directory of \$wgUploadDir /** * Fetch a list of used images from a particular image source. * - * @param $shared Boolean: true to pass shared-dir settings to hash func + * @param bool $shared True to pass shared-dir settings to hash func */ function fetchUsed( $shared ) { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = $this->getDB( DB_SLAVE ); $image = $dbr->tableName( 'image' ); $imagelinks = $dbr->tableName( 'imagelinks' ); @@ -94,10 +94,10 @@ By default, outputs relative paths against the parent directory of \$wgUploadDir /** * Fetch a list of all images from a particular image source. * - * @param $shared Boolean: true to pass shared-dir settings to hash func + * @param bool $shared True to pass shared-dir settings to hash func */ function fetchLocal( $shared ) { - $dbr = wfGetDB( DB_SLAVE ); + $dbr = $this->getDB( DB_SLAVE ); $result = $dbr->select( 'image', array( 'img_name' ), '',