*/
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() ) {
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() );
$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() {