MediaWiki REL1_34
MoveFileOp Class Reference

Move a file from one storage path to another in the backend. More...

Inheritance diagram for MoveFileOp:
Collaboration diagram for MoveFileOp:

Public Member Functions

 storagePathsChanged ()
 Get a list of storage paths written to for this operation.
 
 storagePathsRead ()
 Get a list of storage paths read from for this operation.
 
- Public Member Functions inherited from FileOp
 __construct (FileBackendStore $backend, array $params, LoggerInterface $logger)
 Build a new batch file operation transaction.
 
 applyDependencies (array $deps)
 Update a dependency tracking array to account for this operation.
 
 attempt ()
 Attempt the operation.
 
 attemptAsync ()
 Attempt the operation in the background.
 
 dependsOn (array $deps)
 Check if this operation changes files listed in $paths.
 
 failed ()
 Check if this operation failed precheck() or attempt()
 
 getBackend ()
 Get the backend this operation is for.
 
 getJournalEntries (array $oPredicates, array $nPredicates)
 Get the file journal entries for this file operation.
 
 getParam ( $name)
 Get the value of the parameter with the given name.
 
 logFailure ( $action)
 Log a file operation failure and preserve any temp files.
 
 precheck (array &$predicates)
 Check preconditions of the operation without writing anything.
 
 setBatchId ( $batchId)
 Set the batch UUID this operation belongs to.
 

Protected Member Functions

 allowedParams ()
 Get the file operation parameters.
 
 doAttempt ()
 
 doPrecheck (array &$predicates)
 
- Protected Member Functions inherited from FileOp
 fileExists ( $source, array $predicates)
 Check if a file will exist in storage when this operation is attempted.
 
 fileSha1 ( $source, array $predicates)
 Get the SHA-1 hash a file in storage will have when this operation is attempted.
 
 getSourceSha1Base36 ()
 precheckDestExistence() helper function to get the source file SHA-1.
 
 precheckDestExistence (array $predicates)
 Check for errors with regards to the destination file already existing.
 
 setFlags (array $params)
 Adjust params to FileBackendStore internal file calls.
 

Additional Inherited Members

- Static Public Member Functions inherited from FileOp
static newDependencies ()
 Get a new empty dependency tracking array for paths read/written to.
 
static newPredicates ()
 Get a new empty predicates array for precheck()
 
- Public Attributes inherited from FileOp
const STATE_ATTEMPTED = 3
 
const STATE_CHECKED = 2
 
const STATE_NEW = 1
 
- Static Protected Member Functions inherited from FileOp
static normalizeIfValidStoragePath ( $path)
 Normalize a string if it is a valid storage path.
 
- Protected Attributes inherited from FileOp
bool $async = false
 
FileBackendStore $backend
 
string $batchId
 
bool $destExists
 
bool $doOperation = true
 Operation is not a no-op.
 
bool $failed = false
 
LoggerInterface $logger
 
bool $overwriteSameCase
 
array $params = []
 
string $sourceSha1
 
int $state = self::STATE_NEW
 

Detailed Description

Move a file from one storage path to another in the backend.

Parameters for this operation are outlined in FileBackend::doOperations().

Definition at line 28 of file MoveFileOp.php.

Member Function Documentation

◆ allowedParams()

MoveFileOp::allowedParams ( )
protected

Get the file operation parameters.

Returns
array (required params list, optional params list, list of params that are paths)

Reimplemented from FileOp.

Definition at line 29 of file MoveFileOp.php.

◆ doAttempt()

MoveFileOp::doAttempt ( )
protected
Returns
StatusValue

Reimplemented from FileOp.

Definition at line 74 of file MoveFileOp.php.

References FileOp\getParam(), and FileOp\setFlags().

◆ doPrecheck()

MoveFileOp::doPrecheck ( array &  $predicates)
protected
Parameters
array&$predicates
Returns
StatusValue

Reimplemented from FileOp.

Definition at line 37 of file MoveFileOp.php.

References FileOp\$destExists, FileOp\$sourceSha1, FileOp\fileExists(), FileOp\getParam(), and FileOp\precheckDestExistence().

◆ storagePathsChanged()

MoveFileOp::storagePathsChanged ( )

Get a list of storage paths written to for this operation.

Returns
array

Reimplemented from FileOp.

Definition at line 103 of file MoveFileOp.php.

◆ storagePathsRead()

MoveFileOp::storagePathsRead ( )

Get a list of storage paths read from for this operation.

Returns
array

Reimplemented from FileOp.

Definition at line 99 of file MoveFileOp.php.


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