MediaWiki  1.29.1
LocalFileDeleteBatch Class Reference

Helper class for file deletion. More...

Collaboration diagram for LocalFileDeleteBatch:

Public Member Functions

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

Protected Member Functions

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

Private Attributes

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

Detailed Description

Helper class for file deletion.

Definition at line 2083 of file LocalFile.php.

Constructor & Destructor Documentation

◆ __construct()

LocalFileDeleteBatch::__construct ( File  $file,
  $reason = '',
  $suppress = false,
  $user = null 
)
Parameters
File$file
string$reason
bool$suppress
User | null$user

Definition at line 2114 of file LocalFile.php.

References $file, $reason, $suppress, $user, $wgUser, file, global, reason(), and user.

Member Function Documentation

◆ addCurrent()

LocalFileDeleteBatch::addCurrent ( )

Definition at line 2127 of file LocalFile.php.

References file.

◆ addOld()

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

Definition at line 2134 of file LocalFile.php.

References file.

Referenced by addOlds().

◆ addOlds()

LocalFileDeleteBatch::addOlds ( )

Add the old versions of the image to the batch.

Returns
array List of archive names from old versions

Definition at line 2143 of file LocalFile.php.

References addOld(), as, and file.

◆ doDBDeletes()

LocalFileDeleteBatch::doDBDeletes ( )

Definition at line 2337 of file LocalFile.php.

References captcha-old\count, file, getOldRels(), and list.

Referenced by execute().

◆ doDBInserts()

LocalFileDeleteBatch::doDBInserts ( )
protected

◆ execute()

LocalFileDeleteBatch::execute ( )

Run the transaction.

Returns
Status

Definition at line 2358 of file LocalFile.php.

References $ext, $hashes, $name, $status, as, doDBDeletes(), doDBInserts(), file, getHashes(), StatusValue\isGood(), and removeNonexistentFiles().

◆ getHashes()

LocalFileDeleteBatch::getHashes ( )
protected
Returns
array

Definition at line 2180 of file LocalFile.php.

References $hashes, $name, $res, as, captcha-old\count, file, getOldRels(), and list.

Referenced by execute().

◆ getOldRels()

LocalFileDeleteBatch::getOldRels ( )
protected
Returns
array

Definition at line 2164 of file LocalFile.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 2418 of file LocalFile.php.

References $batch, as, file, list, StatusValue\newFatal(), and StatusValue\newGood().

Referenced by execute().

Member Data Documentation

◆ $archiveUrls

array LocalFileDeleteBatch::$archiveUrls = []
private

Definition at line 2094 of file LocalFile.php.

◆ $deletionBatch

array LocalFileDeleteBatch::$deletionBatch
private

Items to be processed in the deletion batch.

Definition at line 2097 of file LocalFile.php.

◆ $file

LocalFile LocalFileDeleteBatch::$file
private

Definition at line 2085 of file LocalFile.php.

Referenced by __construct().

◆ $reason

string LocalFileDeleteBatch::$reason
private

Definition at line 2088 of file LocalFile.php.

Referenced by __construct(), and doDBInserts().

◆ $srcRels

array LocalFileDeleteBatch::$srcRels = []
private

Definition at line 2091 of file LocalFile.php.

Referenced by getOldRels().

◆ $status

Status LocalFileDeleteBatch::$status
private

Definition at line 2103 of file LocalFile.php.

Referenced by execute().

◆ $suppress

bool LocalFileDeleteBatch::$suppress
private

Whether to suppress all suppressable fields when deleting.

Definition at line 2100 of file LocalFile.php.

Referenced by __construct().

◆ $user

User LocalFileDeleteBatch::$user
private

Definition at line 2106 of file LocalFile.php.

Referenced by __construct().


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