MediaWiki
master
|
Helper class for file movement. More...
Public Member Functions | |
__construct (LocalFile $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 | |
acquireSourceLock () | |
Acquire the source file lock, if it has not been acquired already. More... | |
acquireTargetLock () | |
Acquire the target file lock, if it has not been acquired already. More... | |
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 Status indicating how many rows where updated. More... | |
getMoveTriplets () | |
Generate triplets for FileRepo::storeBatch(). More... | |
getTargetFile () | |
Get the target file. More... | |
releaseLocks () | |
Release both file locks. More... | |
removeNonexistentFiles ( $triplets) | |
Removes non-existent files from move batch. More... | |
verifyDBUpdates () | |
Verify the database updates and return a new Status indicating how many rows would be updated. More... | |
Protected Attributes | |
$archive | |
$cur | |
IDatabase | $db |
LocalFile | $file |
string | $newHash |
string | $newName |
string | $newRel |
$oldCount | |
string | $oldHash |
string | $oldName |
string | $oldRel |
$olds | |
Title | $target |
Helper class for file movement.
Definition at line 33 of file LocalFileMoveBatch.php.
LocalFile | $file | |
Title | $target |
Definition at line 85 of file LocalFileMoveBatch.php.
References $file, $newName, $oldName, $target, and LocalFile\getRepo().
|
protected |
Acquire the source file lock, if it has not been acquired already.
Definition at line 173 of file LocalFileMoveBatch.php.
References StatusValue\newGood().
Referenced by addCurrent(), and execute().
|
protected |
Acquire the target file lock, if it has not been acquired already.
Definition at line 189 of file LocalFileMoveBatch.php.
References getTargetFile(), and StatusValue\newGood().
Referenced by execute().
LocalFileMoveBatch::addCurrent | ( | ) |
Add the current image to the batch.
Definition at line 104 of file LocalFileMoveBatch.php.
References $newRel, $oldRel, and acquireSourceLock().
LocalFileMoveBatch::addOlds | ( | ) |
Add the old versions of the image to the batch.
Definition at line 116 of file LocalFileMoveBatch.php.
References $oldName, and File\DELETED_FILE.
|
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.
array[] | $triplets |
Definition at line 477 of file LocalFileMoveBatch.php.
Referenced by execute().
|
protected |
Cleanup a partially moved array of triplets by deleting the target files.
Called if something went wrong half way.
array[] | $triplets |
Definition at line 461 of file LocalFileMoveBatch.php.
Referenced by execute().
|
protected |
Do the database updates and return a new Status indicating how many rows where updated.
Definition at line 373 of file LocalFileMoveBatch.php.
References $db, and Wikimedia\Rdbms\IDatabase\update().
Referenced by execute().
LocalFileMoveBatch::execute | ( | ) |
Perform the move.
Definition at line 231 of file LocalFileMoveBatch.php.
References acquireSourceLock(), acquireTargetLock(), cleanupSource(), cleanupTarget(), doDBUpdates(), getMoveTriplets(), FileRepo\OVERWRITE_SAME, releaseLocks(), removeNonexistentFiles(), and verifyDBUpdates().
|
protected |
Generate triplets for FileRepo::storeBatch().
Definition at line 401 of file LocalFileMoveBatch.php.
Referenced by execute().
|
protected |
Get the target file.
Definition at line 219 of file LocalFileMoveBatch.php.
Referenced by acquireTargetLock(), and releaseLocks().
|
protected |
Release both file locks.
Definition at line 203 of file LocalFileMoveBatch.php.
References getTargetFile().
Referenced by execute().
|
protected |
Removes non-existent files from move batch.
array[] | $triplets |
Definition at line 428 of file LocalFileMoveBatch.php.
References $file, StatusValue\newFatal(), and StatusValue\newGood().
Referenced by execute().
|
protected |
Verify the database updates and return a new Status indicating how many rows would be updated.
Definition at line 331 of file LocalFileMoveBatch.php.
References $db, and Wikimedia\Rdbms\IReadableDatabase\newSelectQueryBuilder().
Referenced by execute().
|
protected |
Definition at line 46 of file LocalFileMoveBatch.php.
|
protected |
Definition at line 40 of file LocalFileMoveBatch.php.
|
protected |
Definition at line 49 of file LocalFileMoveBatch.php.
Referenced by doDBUpdates(), and verifyDBUpdates().
|
protected |
Definition at line 35 of file LocalFileMoveBatch.php.
Referenced by __construct(), and removeNonexistentFiles().
|
protected |
Definition at line 55 of file LocalFileMoveBatch.php.
|
protected |
Definition at line 61 of file LocalFileMoveBatch.php.
Referenced by __construct().
|
protected |
Definition at line 67 of file LocalFileMoveBatch.php.
Referenced by addCurrent().
|
protected |
Definition at line 44 of file LocalFileMoveBatch.php.
|
protected |
Definition at line 52 of file LocalFileMoveBatch.php.
|
protected |
Definition at line 58 of file LocalFileMoveBatch.php.
Referenced by __construct(), and addOlds().
|
protected |
Definition at line 64 of file LocalFileMoveBatch.php.
Referenced by addCurrent().
|
protected |
Definition at line 42 of file LocalFileMoveBatch.php.
|
protected |
Definition at line 38 of file LocalFileMoveBatch.php.
Referenced by __construct().