From 6adcda1cc892addf30d4663c5885fa268957fd6f Mon Sep 17 00:00:00 2001 From: Victor Vasiliev Date: Fri, 4 Jul 2008 13:04:03 +0000 Subject: [PATCH] Don't pass $db, as Tim Starling advises --- includes/filerepo/LocalFile.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/includes/filerepo/LocalFile.php b/includes/filerepo/LocalFile.php index ea84550912..84839afd02 100644 --- a/includes/filerepo/LocalFile.php +++ b/includes/filerepo/LocalFile.php @@ -969,8 +969,7 @@ class LocalFile extends File */ function move( $target ) { $this->lock(); - $dbw = $this->repo->getMasterDB(); - $batch = new LocalFileMoveBatch( $this, $target, $dbw ); + $batch = new LocalFileMoveBatch( $this, $target ); $batch->addCurrent(); $batch->addOlds(); if( !$this->repo->canTransformVia404() ) { @@ -1703,7 +1702,7 @@ class LocalFileRestoreBatch { class LocalFileMoveBatch { var $file, $cur, $olds, $oldcount, $archive, $thumbs, $target, $db; - function __construct( File $file, Title $target, Database $db ) { + function __construct( File $file, Title $target ) { $this->file = $file; $this->target = $target; $this->oldHash = $this->file->repo->getHashPath( $this->file->getName() ); @@ -1712,7 +1711,7 @@ class LocalFileMoveBatch { $this->newName = $this->file->repo->getNameFromTitle( $this->target ); $this->oldRel = $this->oldHash . $this->oldName; $this->newRel = $this->newHash . $this->newName; - $this->db = $db; + $this->db = $file->repo->getMasterDb(); } function addCurrent() { -- 2.20.1