MediaWiki REL1_39
|
Helper class for file undeletion. More...
Public Member Functions | |
__construct (LocalFile $file, $unsuppress=false) | |
addAll () | |
Add all revisions of the file. | |
addId ( $fa_id) | |
Add a file by ID. | |
addIds ( $ids) | |
Add a whole lot of files by ID. | |
cleanup () | |
Delete unused files in the deleted zone. | |
execute () | |
Run the transaction, except the cleanup batch. | |
Protected Member Functions | |
cleanupFailedBatch ( $storeStatus, $storeBatch) | |
Cleanup a failed batch. | |
removeNonexistentFiles ( $triplets) | |
Removes non-existent files from a store batch. | |
removeNonexistentFromCleanup ( $batch) | |
Removes non-existent files from a cleanup batch. | |
Helper class for file undeletion.
Definition at line 30 of file LocalFileRestoreBatch.php.
LocalFileRestoreBatch::__construct | ( | LocalFile | $file, |
$unsuppress = false ) |
LocalFile | $file | |
bool | $unsuppress |
Definition at line 50 of file LocalFileRestoreBatch.php.
References $file.
LocalFileRestoreBatch::addAll | ( | ) |
Add all revisions of the file.
Definition at line 76 of file LocalFileRestoreBatch.php.
LocalFileRestoreBatch::addId | ( | $fa_id | ) |
LocalFileRestoreBatch::addIds | ( | $ids | ) |
Add a whole lot of files by ID.
int[] | $ids |
Definition at line 69 of file LocalFileRestoreBatch.php.
LocalFileRestoreBatch::cleanup | ( | ) |
Delete unused files in the deleted zone.
This should be called from outside the transaction in which execute() was called.
Definition at line 410 of file LocalFileRestoreBatch.php.
References removeNonexistentFromCleanup().
|
protected |
Cleanup a failed batch.
The batch was only partially successful, so rollback by removing all items that were successfully copied.
Status | $storeStatus | |
array[] | $storeBatch |
Definition at line 429 of file LocalFileRestoreBatch.php.
References $success.
Referenced by execute().
LocalFileRestoreBatch::execute | ( | ) |
Run the transaction, except the cleanup batch.
The cleanup batch should be run in a separate transaction, because it locks different rows and there's no need to keep the image row locked while it's acquiring those locks The caller may have its own transaction open. So we save the batch and let the caller call cleanup()
Definition at line 88 of file LocalFileRestoreBatch.php.
References $mime, $wgLang, cleanupFailedBatch(), ArchivedFile\getQueryInfo(), FileRepo\OVERWRITE_SAME, removeNonexistentFiles(), wfDebug(), and wfTimestamp().
|
protected |
Removes non-existent files from a store batch.
array[] | $triplets |
Definition at line 359 of file LocalFileRestoreBatch.php.
References $file.
Referenced by execute().
|
protected |
Removes non-existent files from a cleanup batch.
string[] | $batch |
Definition at line 385 of file LocalFileRestoreBatch.php.
References $file.
Referenced by cleanup().