MediaWiki master
MediaWiki\FileRepo\File\LocalFileDeleteBatch Class Reference

Helper class for file deletion. More...

Public Member Functions

 __construct (File $file, UserIdentity $user, $reason='', $suppress=false)
 
 addCurrent ()
 
 addOld ( $oldName)
 
 addOlds ()
 Add the old versions of the image to the batch.
 
 execute ()
 Run the transaction.
 

Protected Member Functions

 doDBInserts ()
 
 getHashes (StatusValue $status)
 
 getOldRels ()
 
 removeNonexistentFiles ( $batch)
 Removes non-existent files from a deletion batch.
 

Detailed Description

Helper class for file deletion.

Access: internal

Definition at line 37 of file LocalFileDeleteBatch.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\FileRepo\File\LocalFileDeleteBatch::__construct ( File $file,
UserIdentity $user,
$reason = '',
$suppress = false )
Parameters
File$file
UserIdentity$user
string$reason
bool$suppress

Definition at line 65 of file LocalFileDeleteBatch.php.

Member Function Documentation

◆ addCurrent()

MediaWiki\FileRepo\File\LocalFileDeleteBatch::addCurrent ( )

Definition at line 77 of file LocalFileDeleteBatch.php.

◆ addOld()

MediaWiki\FileRepo\File\LocalFileDeleteBatch::addOld ( $oldName)
Parameters
string$oldName

Definition at line 84 of file LocalFileDeleteBatch.php.

Referenced by MediaWiki\FileRepo\File\LocalFileDeleteBatch\addOlds().

◆ addOlds()

MediaWiki\FileRepo\File\LocalFileDeleteBatch::addOlds ( )

Add the old versions of the image to the batch.

Returns
string[] List of archive names from old versions

Definition at line 93 of file LocalFileDeleteBatch.php.

References MediaWiki\FileRepo\File\LocalFileDeleteBatch\addOld().

◆ doDBInserts()

MediaWiki\FileRepo\File\LocalFileDeleteBatch::doDBInserts ( )
protected

◆ execute()

MediaWiki\FileRepo\File\LocalFileDeleteBatch::execute ( )

Run the transaction.

Returns
Status

Definition at line 363 of file LocalFileDeleteBatch.php.

References StatusValue\newGood().

◆ getHashes()

MediaWiki\FileRepo\File\LocalFileDeleteBatch::getHashes ( StatusValue $status)
protected
Parameters
StatusValue$statusTo add error messages to
Returns
array

Definition at line 131 of file LocalFileDeleteBatch.php.

◆ getOldRels()

MediaWiki\FileRepo\File\LocalFileDeleteBatch::getOldRels ( )
protected
Returns
array

Definition at line 114 of file LocalFileDeleteBatch.php.

◆ removeNonexistentFiles()

MediaWiki\FileRepo\File\LocalFileDeleteBatch::removeNonexistentFiles ( $batch)
protected

Removes non-existent files from a deletion batch.

Parameters
array[]$batch
Returns
Status A good status with existing files in $batch as value, or a fatal status in case of I/O errors.

Definition at line 436 of file LocalFileDeleteBatch.php.


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