*
* Methods called from attemptBatch() should avoid throwing exceptions at all costs.
* FileOp objects should be lightweight in order to support large arrays in memory.
- *
+ *
* @ingroup FileBackend
* @since 1.19
*/
/**
* Attempt to perform a series of file operations.
* Callers are responsible for handling file locking.
- *
+ *
* $opts is an array of options, including:
* 'force' : Errors that would normally cause a rollback do not.
* The remaining operations are still attempted if any fail.
* This can increase performance for non-critical writes.
* This has no effect unless the 'force' flag is set.
* 'nonJournaled' : Don't log this operation batch in the file journal.
- *
+ *
* The resulting Status will be "OK" unless:
* a) unexpected operation errors occurred (network partitions, disk full...)
* b) significant operation errors occured and 'force' was not set
- *
+ *
* @param $performOps Array List of FileOp operations
* @param $opts Array Batch operation options
* @param $journal FileJournal Journal to log operations to
- * @return Status
+ * @return Status
*/
final public static function attemptBatch(
array $performOps, array $opts, FileJournal $journal
/**
* Get the file journal entries for a single file operation
- *
+ *
* @param $fileOp FileOp
* @param $oPredicates Array Pre-op information about files
* @param $nPredicates Array Post-op information about files
/**
* Get the value of the parameter with the given name
- *
+ *
* @param $name string
* @return mixed Returns null if the parameter is not set
*/
/**
* Check if this operation failed precheck() or attempt()
- *
- * @return bool
+ *
+ * @return bool
*/
final public function failed() {
return $this->failed;
/**
* Get a new empty predicates array for precheck()
*
- * @return Array
+ * @return Array
*/
final public static function newPredicates() {
return array( 'exists' => array(), 'sha1' => array() );
/**
* Get the file operation parameters
- *
+ *
* @return Array (required params list, optional params list)
*/
protected function allowedParams() {
* Check for errors with regards to the destination file already existing.
* This also updates the destSameAsSource and sourceSha1 member variables.
* A bad status will be returned if there is no chance it can be overwritten.
- *
+ *
* @param $predicates Array
* @return Status
*/
/**
* Check if a file will exist in storage when this operation is attempted
- *
+ *
* @param $source string Storage path
* @param $predicates Array
- * @return bool
+ * @return bool
*/
final protected function fileExists( $source, array $predicates ) {
if ( isset( $predicates['exists'][$source] ) ) {
/**
* Get the SHA-1 of a file in storage when this operation is attempted
- *
+ *
* @param $source string Storage path
* @param $predicates Array
* @return string|bool False on failure
/**
* Log a file operation failure and preserve any temp files
- *
+ *
* @param $action string
* @return void
*/
}
public function storagePathsChanged() {
- return array( $this->params['dst'] );
+ return array( $this->params['src'], $this->params['dst'] );
}
}