MediaWiki
1.34.0
|
Helper class for file movement. More...
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 Status 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 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 31 of file LocalFileMoveBatch.php.
Definition at line 71 of file LocalFileMoveBatch.php.
References $file, $newName, $oldName, $target, and File\getRepo().
LocalFileMoveBatch::addCurrent | ( | ) |
Add the current image to the batch.
Definition at line 86 of file LocalFileMoveBatch.php.
LocalFileMoveBatch::addOlds | ( | ) |
Add the old versions of the image to the batch.
Definition at line 94 of file LocalFileMoveBatch.php.
References $oldName, File\DELETED_FILE, and wfDebug().
|
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 350 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 334 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 254 of file LocalFileMoveBatch.php.
References $db, and Wikimedia\Rdbms\IDatabase\update().
Referenced by execute().
LocalFileMoveBatch::execute | ( | ) |
Perform the move.
Definition at line 144 of file LocalFileMoveBatch.php.
References $status, cleanupSource(), cleanupTarget(), doDBUpdates(), getMoveTriplets(), FileRepo\OVERWRITE_SAME, removeNonexistentFiles(), verifyDBUpdates(), and wfDebugLog().
|
protected |
Generate triplets for FileRepo::storeBatch().
Definition at line 282 of file LocalFileMoveBatch.php.
References wfDebugLog().
Referenced by execute().
|
protected |
Removes non-existent files from move batch.
array | $triplets |
Definition at line 304 of file LocalFileMoveBatch.php.
References $file, StatusValue\newFatal(), StatusValue\newGood(), and wfDebugLog().
Referenced by execute().
|
protected |
Verify the database updates and return a new Status indicating how many rows would be updated.
Definition at line 217 of file LocalFileMoveBatch.php.
References $db, $status, and Wikimedia\Rdbms\IDatabase\lockForUpdate().
Referenced by execute().
|
protected |
Definition at line 44 of file LocalFileMoveBatch.php.
|
protected |
Definition at line 38 of file LocalFileMoveBatch.php.
|
protected |
Definition at line 47 of file LocalFileMoveBatch.php.
Referenced by doDBUpdates(), and verifyDBUpdates().
|
protected |
Definition at line 33 of file LocalFileMoveBatch.php.
Referenced by __construct(), and removeNonexistentFiles().
|
protected |
Definition at line 53 of file LocalFileMoveBatch.php.
|
protected |
Definition at line 59 of file LocalFileMoveBatch.php.
Referenced by __construct().
|
protected |
Definition at line 65 of file LocalFileMoveBatch.php.
Referenced by addCurrent().
|
protected |
Definition at line 42 of file LocalFileMoveBatch.php.
|
protected |
Definition at line 50 of file LocalFileMoveBatch.php.
|
protected |
Definition at line 56 of file LocalFileMoveBatch.php.
Referenced by __construct(), and addOlds().
|
protected |
Definition at line 62 of file LocalFileMoveBatch.php.
Referenced by addCurrent().
|
protected |
Definition at line 40 of file LocalFileMoveBatch.php.
|
protected |
Definition at line 36 of file LocalFileMoveBatch.php.
Referenced by __construct().