aboutsummaryrefslogtreecommitdiffstats
path: root/includes/libs/filebackend
diff options
context:
space:
mode:
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>2024-03-04 06:38:24 +0000
committerGerrit Code Review <gerrit@wikimedia.org>2024-03-04 06:38:24 +0000
commit8af7393edb61f7c5bdd3b1150a259d543d5936e2 (patch)
treeeb5b2ad6a70e793aebbba0b1bdce0a835e17c6a9 /includes/libs/filebackend
parente78541e80ff2b906bfa6a500f78f40e6054f40b7 (diff)
parentfa066f31843dd87af07f83b80acb96530410f0a4 (diff)
downloadmediawikicore-8af7393edb61f7c5bdd3b1150a259d543d5936e2.tar.gz
mediawikicore-8af7393edb61f7c5bdd3b1150a259d543d5936e2.zip
Merge "filebackend: improve documentation of FileOp fields"
Diffstat (limited to 'includes/libs/filebackend')
-rw-r--r--includes/libs/filebackend/fileop/CopyFileOp.php2
-rw-r--r--includes/libs/filebackend/fileop/DeleteFileOp.php2
-rw-r--r--includes/libs/filebackend/fileop/FileOp.php16
-rw-r--r--includes/libs/filebackend/fileop/MoveFileOp.php2
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'] );