diff options
Diffstat (limited to 'includes/libs/filebackend')
-rw-r--r-- | includes/libs/filebackend/fileop/CopyFileOp.php | 2 | ||||
-rw-r--r-- | includes/libs/filebackend/fileop/DeleteFileOp.php | 2 | ||||
-rw-r--r-- | includes/libs/filebackend/fileop/FileOp.php | 16 | ||||
-rw-r--r-- | includes/libs/filebackend/fileop/MoveFileOp.php | 2 |
4 files changed, 12 insertions, 10 deletions
diff --git a/includes/libs/filebackend/fileop/CopyFileOp.php b/includes/libs/filebackend/fileop/CopyFileOp.php index cee3e7f7ea18..a60e391ee68a 100644 --- a/includes/libs/filebackend/fileop/CopyFileOp.php +++ b/includes/libs/filebackend/fileop/CopyFileOp.php @@ -44,7 +44,7 @@ class CopyFileOp extends FileOp { $srcExists = $this->resolveFileExistence( $this->params['src'], $opPredicates ); if ( $srcExists === false ) { if ( $this->getParam( 'ignoreMissingSource' ) ) { - $this->cancelled = true; // no-op + $this->noOp = true; // no-op // Update file existence predicates (cache 404s) $batchPredicates->assumeFileDoesNotExist( $this->params['src'] ); diff --git a/includes/libs/filebackend/fileop/DeleteFileOp.php b/includes/libs/filebackend/fileop/DeleteFileOp.php index 7c7c39f850e0..1c467bbe8f31 100644 --- a/includes/libs/filebackend/fileop/DeleteFileOp.php +++ b/includes/libs/filebackend/fileop/DeleteFileOp.php @@ -40,7 +40,7 @@ class DeleteFileOp extends FileOp { $srcExists = $this->resolveFileExistence( $this->params['src'], $opPredicates ); if ( $srcExists === false ) { if ( $this->getParam( 'ignoreMissingSource' ) ) { - $this->cancelled = true; // no-op + $this->noOp = true; // no-op // Update file existence predicates (cache 404s) $batchPredicates->assumeFileDoesNotExist( $this->params['src'] ); diff --git a/includes/libs/filebackend/fileop/FileOp.php b/includes/libs/filebackend/fileop/FileOp.php index 3bfd362e5e91..b761795656bd 100644 --- a/includes/libs/filebackend/fileop/FileOp.php +++ b/includes/libs/filebackend/fileop/FileOp.php @@ -43,23 +43,25 @@ abstract class FileOp { /** @var array */ protected $params = []; - /** @var int */ + /** @var int Stage in the operation life-cycle */ protected $state = self::STATE_NEW; - /** @var bool */ + /** @var bool Whether the operation pre-check or attempt stage failed */ protected $failed = false; - /** @var bool */ + /** @var bool Whether the operation is part of a concurrent sub-batch of operation */ protected $async = false; - /** @var bool */ - protected $cancelled = false; + /** @var bool Whether the operation pre-check stage marked the attempt stage as a no-op */ + protected $noOp = false; /** @var bool|null */ protected $overwriteSameCase; /** @var bool|null */ protected $destExists; - /* Object life-cycle */ + /** Operation has not yet been pre-checked nor run */ private const STATE_NEW = 1; + /** Operation has been pre-checked but not yet attempted */ private const STATE_CHECKED = 2; + /** Operation has been attempted */ private const STATE_ATTEMPTED = 3; /** @@ -235,7 +237,7 @@ abstract class FileOp { return StatusValue::newFatal( 'fileop-fail-attempt-precheck' ); } $this->state = self::STATE_ATTEMPTED; - if ( $this->cancelled ) { + if ( $this->noOp ) { $status = StatusValue::newGood(); // no-op } else { $status = $this->doAttempt(); diff --git a/includes/libs/filebackend/fileop/MoveFileOp.php b/includes/libs/filebackend/fileop/MoveFileOp.php index 708574b18393..8540cfacc9c5 100644 --- a/includes/libs/filebackend/fileop/MoveFileOp.php +++ b/includes/libs/filebackend/fileop/MoveFileOp.php @@ -44,7 +44,7 @@ class MoveFileOp extends FileOp { $srcExists = $this->resolveFileExistence( $this->params['src'], $opPredicates ); if ( $srcExists === false ) { if ( $this->getParam( 'ignoreMissingSource' ) ) { - $this->cancelled = true; // no-op + $this->noOp = true; // no-op // Update file existence predicates (cache 404s) $batchPredicates->assumeFileDoesNotExist( $this->params['src'] ); |