From 2d5c65dce98c66e55b5a7ab667207e61a54798b4 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sun, 19 Feb 2012 23:40:02 +0000 Subject: [PATCH] * Marked some FileBackendMultiWrite functions as protected as they should be * Broke up a few variable declarations to make NetBeans happy * Clarified documentation a bit --- includes/filerepo/backend/FileBackend.php | 9 +++++---- .../filerepo/backend/FileBackendMultiWrite.php | 14 +++++++++----- includes/filerepo/backend/FileOp.php | 4 ++-- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/includes/filerepo/backend/FileBackend.php b/includes/filerepo/backend/FileBackend.php index e546c96a9a..7e804b7d44 100644 --- a/includes/filerepo/backend/FileBackend.php +++ b/includes/filerepo/backend/FileBackend.php @@ -19,9 +19,10 @@ * This class defines the methods as abstract that subclasses must implement. * Outside callers can assume that all backends will have these functions. * - * All "storage paths" are of the format "mwstore://backend/container/path". - * The paths use UNIX file system (FS) notation, though any particular backend may - * not actually be using a local filesystem. Therefore, the paths are only virtual. + * All "storage paths" are of the format "mwstore:////". + * The portion is a relative path that uses UNIX file system (FS) notation, + * though any particular backend may not actually be using a local filesystem. + * Therefore, the relative paths are only virtual. * * Backend contents are stored under wiki-specific container names by default. * For legacy reasons, this has no effect for the FS backend class, and per-wiki @@ -710,7 +711,7 @@ abstract class FileBackend { } /** - * @brief Base class for all backends associated with a particular storage medium. + * @brief Base class for all backends using particular storage medium. * * This class defines the methods as abstract that subclasses must implement. * Outside callers should *not* use functions with "Internal" in the name. diff --git a/includes/filerepo/backend/FileBackendMultiWrite.php b/includes/filerepo/backend/FileBackendMultiWrite.php index 95e0eeb0b8..52c71d6f02 100644 --- a/includes/filerepo/backend/FileBackendMultiWrite.php +++ b/includes/filerepo/backend/FileBackendMultiWrite.php @@ -6,6 +6,8 @@ */ /** + * @brief Proxy backend that mirrors writes to several internal backends. + * * This class defines a multi-write backend. Multiple backends can be * registered to this proxy backend and it will act as a single backend. * Use this when all access to those backends is through this proxy backend. @@ -82,7 +84,8 @@ class FileBackendMultiWrite extends FileBackend { $status = Status::newGood(); $performOps = array(); // list of FileOp objects - $filesRead = $filesChanged = array(); // storage paths used + $filesRead = array(); // storage paths read from + $filesChanged = array(); // storage paths written to // Build up a list of FileOps. The list will have all the ops // for one backend, then all the ops for the next, and so on. // These batches of ops are all part of a continuous array. @@ -133,7 +136,8 @@ class FileBackendMultiWrite extends FileBackend { $subStatus = FileOp::attemptBatch( $performOps, $opts ); $success = array(); - $failCount = $successCount = 0; + $failCount = 0; + $successCount = 0; // Make 'success', 'successCount', and 'failCount' fields reflect // the overall operation, rather than all the batches for each backend. // Do this by only using success values from the master backend's batch. @@ -280,7 +284,7 @@ class FileBackendMultiWrite extends FileBackend { * @see FileBackend::doPrepare() * @return Status */ - public function doPrepare( array $params ) { + protected function doPrepare( array $params ) { $status = Status::newGood(); foreach ( $this->backends as $backend ) { $realParams = $this->substOpPaths( $params, $backend ); @@ -293,7 +297,7 @@ class FileBackendMultiWrite extends FileBackend { * @see FileBackend::doSecure() * @return Status */ - public function doSecure( array $params ) { + protected function doSecure( array $params ) { $status = Status::newGood(); foreach ( $this->backends as $backend ) { $realParams = $this->substOpPaths( $params, $backend ); @@ -306,7 +310,7 @@ class FileBackendMultiWrite extends FileBackend { * @see FileBackend::doClean() * @return Status */ - public function doClean( array $params ) { + protected function doClean( array $params ) { $status = Status::newGood(); foreach ( $this->backends as $backend ) { $realParams = $this->substOpPaths( $params, $backend ); diff --git a/includes/filerepo/backend/FileOp.php b/includes/filerepo/backend/FileOp.php index bf3535694e..048a33d085 100644 --- a/includes/filerepo/backend/FileOp.php +++ b/includes/filerepo/backend/FileOp.php @@ -40,8 +40,8 @@ abstract class FileOp { /** * Build a new file operation transaction * - * @params $backend FileBackendStore - * @params $params Array + * @param $backend FileBackendStore + * @param $params Array * @throws MWException */ final public function __construct( FileBackendStore $backend, array $params ) { -- 2.20.1