MediaWiki  1.23.2
StoreFileOp Class Reference

Store a file into the backend from a file on the file system. More...

Inheritance diagram for StoreFileOp:
Collaboration diagram for StoreFileOp:

Public Member Functions

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

Protected Member Functions

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

Additional Inherited Members

- Static Public Member Functions inherited from FileOp
static newDependencies ()
 Get a new empty dependency tracking array for paths read/written to. More...
 
static newPredicates ()
 Get a new empty predicates array for precheck() More...
 
- 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. More...
 
- Protected Attributes inherited from FileOp
bool $async = false
 
FileBackendStore $backend
 
string $batchId
 
bool $destExists
 
bool $doOperation = true
 Operation is not a no-op *. More...
 
bool $failed = false
 
bool $overwriteSameCase
 
array $params = array()
 
string $sourceSha1
 
int $state = self::STATE_NEW
 

Detailed Description

Store a file into the backend from a file on the file system.

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

Definition at line 518 of file FileOp.php.

Member Function Documentation

◆ allowedParams()

StoreFileOp::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 519 of file FileOp.php.

References array().

◆ doAttempt()

StoreFileOp::doAttempt ( )
protected
Returns
Status

Reimplemented from FileOp.

Definition at line 560 of file FileOp.php.

References Status\newGood(), and FileOp\setFlags().

◆ doPrecheck()

StoreFileOp::doPrecheck ( array $predicates)
protected
Parameters
array$predicates
Returns
Status

Reimplemented from FileOp.

Definition at line 527 of file FileOp.php.

References FileOp\$destExists, FileOp\$sourceSha1, Status\newGood(), and FileOp\precheckDestExistence().

◆ getSourceSha1Base36()

StoreFileOp::getSourceSha1Base36 ( )
protected

precheckDestExistence() helper function to get the source file SHA-1.

Subclasses should overwride this if the source is not in storage.

Returns
string|bool Returns false on failure

Reimplemented from FileOp.

Definition at line 569 of file FileOp.php.

References $hash, wfBaseConvert(), wfRestoreWarnings(), and wfSuppressWarnings().

◆ storagePathsChanged()

StoreFileOp::storagePathsChanged ( )

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

Returns
array

Reimplemented from FileOp.

Definition at line 580 of file FileOp.php.

References array().


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