MediaWiki REL1_35
LocalFileDeleteBatch Class Reference

Helper class for file deletion. More...

Collaboration diagram for LocalFileDeleteBatch:

Public Member Functions

 __construct (File $file, $param2='', $param3='', $param4=false)
 
 addCurrent ()
 
 addOld ( $oldName)
 
 addOlds ()
 Add the old versions of the image to the batch.
 
 execute ()
 Run the transaction.
 

Protected Member Functions

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

Private Member Functions

 doDBDeletes ()
 

Private Attributes

array $archiveUrls = []
 
array $deletionBatch
 Items to be processed in the deletion batch.
 
LocalFile $file
 
string $reason
 
array $srcRels = []
 
Status $status
 
bool $suppress
 Whether to suppress all suppressable fields when deleting.
 
User $user
 

Detailed Description

Helper class for file deletion.

Definition at line 31 of file LocalFileDeleteBatch.php.

Constructor & Destructor Documentation

◆ __construct()

LocalFileDeleteBatch::__construct ( File  $file,
  $param2 = '',
  $param3 = '',
  $param4 = false 
)
Parameters
File$file
string | User$param2
bool | string$param3
User | null | bool$param4

Old signature: $file, $reason = '', $suppress = false, $user = null New signature: $file, $user, $reason = '', $suppress = false

See T245710 for more

Definition at line 67 of file LocalFileDeleteBatch.php.

References $file, $reason, $suppress, $user, and wfDeprecatedMsg().

Member Function Documentation

◆ addCurrent()

LocalFileDeleteBatch::addCurrent ( )

Definition at line 108 of file LocalFileDeleteBatch.php.

◆ addOld()

LocalFileDeleteBatch::addOld (   $oldName)
Parameters
string$oldName

Definition at line 115 of file LocalFileDeleteBatch.php.

Referenced by addOlds().

◆ addOlds()

LocalFileDeleteBatch::addOlds ( )

Add the old versions of the image to the batch.

Returns
string[] List of archive names from old versions

Definition at line 124 of file LocalFileDeleteBatch.php.

References addOld().

◆ doDBDeletes()

LocalFileDeleteBatch::doDBDeletes ( )
private

Definition at line 328 of file LocalFileDeleteBatch.php.

References getOldRels().

Referenced by execute().

◆ doDBInserts()

LocalFileDeleteBatch::doDBInserts ( )
protected

Definition at line 217 of file LocalFileDeleteBatch.php.

References $ext, $reason, $res, $user, getOldRels(), OldLocalFile\getQueryInfo(), and User\newFromAnyId().

Referenced by execute().

◆ execute()

LocalFileDeleteBatch::execute ( )

◆ getHashes()

LocalFileDeleteBatch::getHashes ( )
protected
Returns
array

Definition at line 161 of file LocalFileDeleteBatch.php.

References $hashes, $res, and getOldRels().

Referenced by execute().

◆ getOldRels()

LocalFileDeleteBatch::getOldRels ( )
protected
Returns
array

Definition at line 145 of file LocalFileDeleteBatch.php.

References $srcRels.

Referenced by doDBDeletes(), doDBInserts(), and getHashes().

◆ removeNonexistentFiles()

LocalFileDeleteBatch::removeNonexistentFiles (   $batch)
protected

Removes non-existent files from a deletion batch.

Parameters
array[]$batch
Returns
Status

Definition at line 409 of file LocalFileDeleteBatch.php.

Referenced by execute().

Member Data Documentation

◆ $archiveUrls

array LocalFileDeleteBatch::$archiveUrls = []
private

Definition at line 42 of file LocalFileDeleteBatch.php.

◆ $deletionBatch

array LocalFileDeleteBatch::$deletionBatch
private

Items to be processed in the deletion batch.

Definition at line 45 of file LocalFileDeleteBatch.php.

◆ $file

LocalFile LocalFileDeleteBatch::$file
private

Definition at line 33 of file LocalFileDeleteBatch.php.

Referenced by __construct().

◆ $reason

string LocalFileDeleteBatch::$reason
private

Definition at line 36 of file LocalFileDeleteBatch.php.

Referenced by __construct(), and doDBInserts().

◆ $srcRels

array LocalFileDeleteBatch::$srcRels = []
private

Definition at line 39 of file LocalFileDeleteBatch.php.

Referenced by getOldRels().

◆ $status

Status LocalFileDeleteBatch::$status
private

Definition at line 51 of file LocalFileDeleteBatch.php.

Referenced by execute().

◆ $suppress

bool LocalFileDeleteBatch::$suppress
private

Whether to suppress all suppressable fields when deleting.

Definition at line 48 of file LocalFileDeleteBatch.php.

Referenced by __construct().

◆ $user

User LocalFileDeleteBatch::$user
private

Definition at line 54 of file LocalFileDeleteBatch.php.

Referenced by __construct(), and doDBInserts().


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