MediaWiki  1.28.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 = []
 
FileRepoStatus $status
 
bool $suppress
 Whether to suppress all suppressable fields when deleting. More...
 
User $user
 

Detailed Description

Helper class for file deletion.

Definition at line 2070 of file LocalFile.php.

Constructor & Destructor Documentation

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

Definition at line 2101 of file LocalFile.php.

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

Member Function Documentation

LocalFileDeleteBatch::addCurrent ( )

Definition at line 2114 of file LocalFile.php.

References file.

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

Definition at line 2121 of file LocalFile.php.

References file.

Referenced by 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 2130 of file LocalFile.php.

References addOld(), as, and file.

LocalFileDeleteBatch::doDBDeletes ( )

Definition at line 2330 of file LocalFile.php.

References file, getOldRels(), and list.

Referenced by execute().

LocalFileDeleteBatch::doDBInserts ( )
protected
LocalFileDeleteBatch::execute ( )

Run the transaction.

Returns
Status

Definition at line 2351 of file LocalFile.php.

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

LocalFileDeleteBatch::getHashes ( )
protected
Returns
array

Definition at line 2167 of file LocalFile.php.

References $hashes, $name, $res, as, file, getOldRels(), and list.

Referenced by execute().

LocalFileDeleteBatch::getOldRels ( )
protected
Returns
array

Definition at line 2151 of file LocalFile.php.

References $srcRels.

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

LocalFileDeleteBatch::removeNonexistentFiles (   $batch)
protected

Removes non-existent files from a deletion batch.

Parameters
array$batch
Returns
Status

Definition at line 2411 of file LocalFile.php.

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

Referenced by execute().

Member Data Documentation

array LocalFileDeleteBatch::$archiveUrls = []
private

Definition at line 2081 of file LocalFile.php.

array LocalFileDeleteBatch::$deletionBatch
private

Items to be processed in the deletion batch.

Definition at line 2084 of file LocalFile.php.

LocalFile LocalFileDeleteBatch::$file
private

Definition at line 2072 of file LocalFile.php.

Referenced by __construct().

string LocalFileDeleteBatch::$reason
private

Definition at line 2075 of file LocalFile.php.

Referenced by __construct(), and doDBInserts().

array LocalFileDeleteBatch::$srcRels = []
private

Definition at line 2078 of file LocalFile.php.

Referenced by getOldRels().

FileRepoStatus LocalFileDeleteBatch::$status
private

Definition at line 2090 of file LocalFile.php.

Referenced by execute().

bool LocalFileDeleteBatch::$suppress
private

Whether to suppress all suppressable fields when deleting.

Definition at line 2087 of file LocalFile.php.

Referenced by __construct().

User LocalFileDeleteBatch::$user
private

Definition at line 2093 of file LocalFile.php.

Referenced by __construct().


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