MediaWiki  master
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. More...
 
 addOlds ()
 Add the old versions of the image to the batch. More...
 
 execute ()
 Perform the move. More...
 

Protected Member Functions

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

Protected Attributes

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

Detailed Description

Helper class for file movement.

Definition at line 2781 of file LocalFile.php.

Constructor & Destructor Documentation

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

Definition at line 2803 of file LocalFile.php.

References $file, $target, file, and File\getRepo().

Member Function Documentation

LocalFileMoveBatch::addCurrent ( )

Add the current image to the batch.

Definition at line 2818 of file LocalFile.php.

LocalFileMoveBatch::addOlds ( )

Add the old versions of the image to the batch.

Returns
array List of archive names from old versions

Definition at line 2826 of file LocalFile.php.

References $timestamp, as, File\DELETED_FILE, list, and wfDebug().

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 3084 of file LocalFile.php.

References $files, as, and file.

Referenced by execute().

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 3068 of file LocalFile.php.

References as, and file.

Referenced by execute().

LocalFileMoveBatch::doDBUpdates ( )
protected

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

Definition at line 2989 of file LocalFile.php.

References $db, and DatabaseBase\update().

Referenced by execute().

LocalFileMoveBatch::getMoveTriplets ( )
protected

Generate triplets for FileRepo::storeBatch().

Returns
array

Definition at line 3016 of file LocalFile.php.

References as, file, and wfDebugLog().

Referenced by execute().

LocalFileMoveBatch::removeNonexistentFiles (   $triplets)
protected

Removes non-existent files from move batch.

Parameters
array$triplets
Returns
Status

Definition at line 3038 of file LocalFile.php.

References $file, $files, as, file, Status\newFatal(), Status\newGood(), and wfDebugLog().

Referenced by execute().

LocalFileMoveBatch::verifyDBUpdates ( )
protected

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

Returns
FileRepoStatus

Definition at line 2948 of file LocalFile.php.

References $db, $status, file, and DatabaseBase\selectField().

Referenced by execute().

Member Data Documentation

LocalFileMoveBatch::$archive
protected

Definition at line 2794 of file LocalFile.php.

LocalFileMoveBatch::$cur
protected

Definition at line 2788 of file LocalFile.php.

DatabaseBase LocalFileMoveBatch::$db
protected

Definition at line 2797 of file LocalFile.php.

Referenced by doDBUpdates(), and verifyDBUpdates().

LocalFile LocalFileMoveBatch::$file
protected

Definition at line 2783 of file LocalFile.php.

Referenced by __construct(), and removeNonexistentFiles().

LocalFileMoveBatch::$oldCount
protected

Definition at line 2792 of file LocalFile.php.

LocalFileMoveBatch::$olds
protected

Definition at line 2790 of file LocalFile.php.

Title LocalFileMoveBatch::$target
protected

Definition at line 2786 of file LocalFile.php.

Referenced by __construct().


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