From: Aaron Schulz Date: Fri, 23 Aug 2019 15:45:54 +0000 (-0700) Subject: filebackend: update code comments and break some long lines X-Git-Tag: 1.34.0-rc.0~603^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=95e68098cadf9daf29c4621aaeb3706bd9de33d4 filebackend: update code comments and break some long lines Change-Id: I072e15c7c51490888284561260958e405fb061ca --- diff --git a/includes/libs/filebackend/FileBackend.php b/includes/libs/filebackend/FileBackend.php index b187fe563c..4cacb7af63 100644 --- a/includes/libs/filebackend/FileBackend.php +++ b/includes/libs/filebackend/FileBackend.php @@ -420,7 +420,7 @@ abstract class FileBackend implements LoggerAwareInterface { * * The StatusValue will be "OK" unless: * - a) unexpected operation errors occurred (network partitions, disk full...) - * - b) significant operation errors occurred and 'force' was not set + * - b) predicted operation errors occurred and 'force' was not set * * @param array $ops List of operations to execute in order * @param array $opts Batch operation options diff --git a/includes/libs/filebackend/FileBackendMultiWrite.php b/includes/libs/filebackend/FileBackendMultiWrite.php index f92d5fa0a9..27ad870ae5 100644 --- a/includes/libs/filebackend/FileBackendMultiWrite.php +++ b/includes/libs/filebackend/FileBackendMultiWrite.php @@ -88,7 +88,7 @@ class FileBackendMultiWrite extends FileBackend { * any checks from "syncChecks" are still synchronous. * * @param array $config - * @throws FileBackendError + * @throws LogicException */ public function __construct( array $config ) { parent::__construct( $config ); @@ -178,9 +178,8 @@ class FileBackendMultiWrite extends FileBackend { $masterStatus = $mbe->doOperations( $realOps, $opts ); $status->merge( $masterStatus ); // Propagate the operations to the clone backends if there were no unexpected errors - // and if there were either no expected errors or if the 'force' option was used. - // However, if nothing succeeded at all, then don't replicate any of the operations. - // If $ops only had one operation, this might avoid backend sync inconsistencies. + // and everything didn't fail due to predicted errors. If $ops only had one operation, + // this might avoid backend sync inconsistencies. if ( $masterStatus->isOK() && $masterStatus->successCount > 0 ) { foreach ( $this->backends as $index => $backend ) { if ( $index === $this->masterIndex ) { @@ -271,7 +270,10 @@ class FileBackendMultiWrite extends FileBackend { continue; } } - if ( ( $this->syncChecks & self::CHECK_SHA1 ) && $cBackend->getFileSha1Base36( $cParams ) !== $mSha1 ) { // wrong SHA1 + if ( + ( $this->syncChecks & self::CHECK_SHA1 ) && + $cBackend->getFileSha1Base36( $cParams ) !== $mSha1 + ) { // wrong SHA1 $status->fatal( 'backend-fail-synced', $path ); continue; } diff --git a/includes/libs/filebackend/FileOpBatch.php b/includes/libs/filebackend/FileOpBatch.php index 540961edd1..bbcda085c0 100644 --- a/includes/libs/filebackend/FileOpBatch.php +++ b/includes/libs/filebackend/FileOpBatch.php @@ -46,7 +46,7 @@ class FileOpBatch { * * The resulting StatusValue will be "OK" unless: * - a) unexpected operation errors occurred (network partitions, disk full...) - * - b) significant operation errors occurred and 'force' was not set + * - b) predicted operation errors occurred and 'force' was not set * * @param FileOp[] $performOps List of FileOp operations * @param array $opts Batch operation options