MediaWiki
1.33.0
|
Helper class for file undeletion. More...
Public Member Functions | |
__construct (File $file, $unsuppress=false) | |
addAll () | |
Add all revisions of the file. More... | |
addId ( $fa_id) | |
Add a file by ID. More... | |
addIds ( $ids) | |
Add a whole lot of files by ID. More... | |
cleanup () | |
Delete unused files in the deleted zone. More... | |
execute () | |
Run the transaction, except the cleanup batch. More... | |
Protected Member Functions | |
cleanupFailedBatch ( $storeStatus, $storeBatch) | |
Cleanup a failed batch. More... | |
removeNonexistentFiles ( $triplets) | |
Removes non-existent files from a store batch. More... | |
removeNonexistentFromCleanup ( $batch) | |
Removes non-existent files from a cleanup batch. More... | |
Private Attributes | |
bool | $all |
Add all revisions of the file. More... | |
string[] | $cleanupBatch |
List of file IDs to restore. More... | |
LocalFile | $file |
string[] | $ids |
List of file IDs to restore. More... | |
bool | $unsuppress = false |
Whether to remove all settings for suppressed fields. More... | |
Helper class for file undeletion.
Definition at line 2713 of file LocalFile.php.
File | $file | |
bool | $unsuppress |
Definition at line 2733 of file LocalFile.php.
References $file, $unsuppress, and file.
LocalFileRestoreBatch::addAll | ( | ) |
Add all revisions of the file.
Definition at line 2759 of file LocalFile.php.
LocalFileRestoreBatch::addId | ( | $fa_id | ) |
LocalFileRestoreBatch::addIds | ( | $ids | ) |
Add a whole lot of files by ID.
int[] | $ids |
Definition at line 2752 of file LocalFile.php.
References $ids.
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 3078 of file LocalFile.php.
References file, and 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 3097 of file LocalFile.php.
References $cleanupBatch, $success, as, and file.
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 2771 of file LocalFile.php.
References $ids, $user, $wgLang, DeferredUpdates\addUpdate(), as, cleanupFailedBatch(), File\DELETED_FILE, SiteStatsUpdate\factory(), file, LocalRepo\getHashFromKey(), ArchivedFile\getQueryInfo(), User\newFromAnyId(), ActorMigration\newMigration(), FileRepo\OVERWRITE_SAME, removeNonexistentFiles(), RepoGroup\singleton(), wfDebug(), and wfTimestamp().
|
protected |
Removes non-existent files from a store batch.
array | $triplets |
Definition at line 3027 of file LocalFile.php.
References $file, as, file, StatusValue\newFatal(), and StatusValue\newGood().
Referenced by execute().
|
protected |
|
private |
Add all revisions of the file.
Definition at line 2724 of file LocalFile.php.
|
private |
List of file IDs to restore.
Definition at line 2718 of file LocalFile.php.
Referenced by cleanupFailedBatch().
|
private |
Definition at line 2715 of file LocalFile.php.
Referenced by __construct(), removeNonexistentFiles(), and removeNonexistentFromCleanup().
|
private |
List of file IDs to restore.
Definition at line 2721 of file LocalFile.php.
|
private |
Whether to remove all settings for suppressed fields.
Definition at line 2727 of file LocalFile.php.
Referenced by __construct().