MediaWiki REL1_31
LocalFileMoveBatch Class Reference

Helper class for file movement. More...

Collaboration diagram for LocalFileMoveBatch:

Public Member Functions

 __construct (File $file, Title $target)
 
 addCurrent ()
 Add the current image to the batch.
 
 addOlds ()
 Add the old versions of the image to the batch.
 
 execute ()
 Perform the move.
 

Protected Member Functions

 cleanupSource ( $triplets)
 Cleanup a fully moved array of triplets by deleting the source files.
 
 cleanupTarget ( $triplets)
 Cleanup a partially moved array of triplets by deleting the target files.
 
 doDBUpdates ()
 Do the database updates and return a new Status indicating how many rows where updated.
 
 getMoveTriplets ()
 Generate triplets for FileRepo::storeBatch().
 
 removeNonexistentFiles ( $triplets)
 Removes non-existent files from move batch.
 
 verifyDBUpdates ()
 Verify the database updates and return a new Status indicating how many rows would be updated.
 

Protected Attributes

 $archive
 
 $cur
 
IDatabase $db
 
LocalFile $file
 
 $oldCount
 
 $olds
 
Title $target
 

Detailed Description

Helper class for file movement.

Definition at line 3168 of file LocalFile.php.

Constructor & Destructor Documentation

◆ __construct()

LocalFileMoveBatch::__construct ( File $file,
Title $target )
Parameters
File$file
Title$target

Definition at line 3190 of file LocalFile.php.

References $file, and $target.

Member Function Documentation

◆ addCurrent()

LocalFileMoveBatch::addCurrent ( )

Add the current image to the batch.

Definition at line 3205 of file LocalFile.php.

◆ addOlds()

LocalFileMoveBatch::addOlds ( )

Add the old versions of the image to the batch.

Returns
string[] List of archive names from old versions

Definition at line 3213 of file LocalFile.php.

References File\DELETED_FILE, list, and wfDebug().

◆ cleanupSource()

LocalFileMoveBatch::cleanupSource ( $triplets)
protected

Cleanup a fully moved array of triplets by deleting the source files.

Called at the end of the move process if everything else went ok.

Parameters
array[]$triplets

Definition at line 3482 of file LocalFile.php.

Referenced by execute().

◆ cleanupTarget()

LocalFileMoveBatch::cleanupTarget ( $triplets)
protected

Cleanup a partially moved array of triplets by deleting the target files.

Called if something went wrong half way.

Parameters
array[]$triplets

Definition at line 3466 of file LocalFile.php.

Referenced by execute().

◆ doDBUpdates()

LocalFileMoveBatch::doDBUpdates ( )
protected

Do the database updates and return a new Status indicating how many rows where updated.

Definition at line 3376 of file LocalFile.php.

References $db, $wgCommentTableSchemaMigrationStage, MIGRATION_OLD, and Wikimedia\Rdbms\IDatabase\update().

Referenced by execute().

◆ execute()

LocalFileMoveBatch::execute ( )

◆ getMoveTriplets()

LocalFileMoveBatch::getMoveTriplets ( )
protected

Generate triplets for FileRepo::storeBatch().

Returns
array[]

Definition at line 3414 of file LocalFile.php.

References wfDebugLog().

Referenced by execute().

◆ removeNonexistentFiles()

LocalFileMoveBatch::removeNonexistentFiles ( $triplets)
protected

Removes non-existent files from move batch.

Parameters
array$triplets
Returns
Status

Definition at line 3436 of file LocalFile.php.

References $file, and wfDebugLog().

Referenced by execute().

◆ verifyDBUpdates()

LocalFileMoveBatch::verifyDBUpdates ( )
protected

Verify the database updates and return a new Status indicating how many rows would be updated.

Returns
Status

Definition at line 3335 of file LocalFile.php.

References $db, and Wikimedia\Rdbms\IDatabase\selectField().

Referenced by execute().

Member Data Documentation

◆ $archive

LocalFileMoveBatch::$archive
protected

Definition at line 3181 of file LocalFile.php.

◆ $cur

LocalFileMoveBatch::$cur
protected

Definition at line 3175 of file LocalFile.php.

◆ $db

IDatabase LocalFileMoveBatch::$db
protected

Definition at line 3184 of file LocalFile.php.

Referenced by doDBUpdates(), and verifyDBUpdates().

◆ $file

LocalFile LocalFileMoveBatch::$file
protected

Definition at line 3170 of file LocalFile.php.

Referenced by __construct(), and removeNonexistentFiles().

◆ $oldCount

LocalFileMoveBatch::$oldCount
protected

Definition at line 3179 of file LocalFile.php.

◆ $olds

LocalFileMoveBatch::$olds
protected

Definition at line 3177 of file LocalFile.php.

◆ $target

Title LocalFileMoveBatch::$target
protected

Definition at line 3173 of file LocalFile.php.

Referenced by __construct().


The documentation for this class was generated from the following file: