* Marked some FileBackendMultiWrite functions as protected as they should be
authorAaron Schulz <aaron@users.mediawiki.org>
Sun, 19 Feb 2012 23:40:02 +0000 (23:40 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Sun, 19 Feb 2012 23:40:02 +0000 (23:40 +0000)
* Broke up a few variable declarations to make NetBeans happy
* Clarified documentation a bit

includes/filerepo/backend/FileBackend.php
includes/filerepo/backend/FileBackendMultiWrite.php
includes/filerepo/backend/FileOp.php

index e546c96..7e804b7 100644 (file)
  * 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://<backend>/<container>/<path>".
+ * The <path> 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.
index 95e0eeb..52c71d6 100644 (file)
@@ -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 );
index bf35356..048a33d 100644 (file)
@@ -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 ) {