r111897 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111896‎ | r111897 | r111898 >
Date:23:40, 19 February 2012
Author:aaron
Status:ok
Tags:
Comment:
* Marked some FileBackendMultiWrite functions as protected as they should be
* Broke up a few variable declarations to make NetBeans happy
* Clarified documentation a bit
Modified paths:
  • /trunk/phase3/includes/filerepo/backend/FileBackend.php (modified) (history)
  • /trunk/phase3/includes/filerepo/backend/FileBackendMultiWrite.php (modified) (history)
  • /trunk/phase3/includes/filerepo/backend/FileOp.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/backend/FileBackendMultiWrite.php
@@ -6,6 +6,8 @@
77 */
88
99 /**
 10+ * @brief Proxy backend that mirrors writes to several internal backends.
 11+ *
1012 * This class defines a multi-write backend. Multiple backends can be
1113 * registered to this proxy backend and it will act as a single backend.
1214 * Use this when all access to those backends is through this proxy backend.
@@ -82,7 +84,8 @@
8385 $status = Status::newGood();
8486
8587 $performOps = array(); // list of FileOp objects
86 - $filesRead = $filesChanged = array(); // storage paths used
 88+ $filesRead = array(); // storage paths read from
 89+ $filesChanged = array(); // storage paths written to
8790 // Build up a list of FileOps. The list will have all the ops
8891 // for one backend, then all the ops for the next, and so on.
8992 // These batches of ops are all part of a continuous array.
@@ -133,7 +136,8 @@
134137 $subStatus = FileOp::attemptBatch( $performOps, $opts );
135138
136139 $success = array();
137 - $failCount = $successCount = 0;
 140+ $failCount = 0;
 141+ $successCount = 0;
138142 // Make 'success', 'successCount', and 'failCount' fields reflect
139143 // the overall operation, rather than all the batches for each backend.
140144 // Do this by only using success values from the master backend's batch.
@@ -280,7 +284,7 @@
281285 * @see FileBackend::doPrepare()
282286 * @return Status
283287 */
284 - public function doPrepare( array $params ) {
 288+ protected function doPrepare( array $params ) {
285289 $status = Status::newGood();
286290 foreach ( $this->backends as $backend ) {
287291 $realParams = $this->substOpPaths( $params, $backend );
@@ -293,7 +297,7 @@
294298 * @see FileBackend::doSecure()
295299 * @return Status
296300 */
297 - public function doSecure( array $params ) {
 301+ protected function doSecure( array $params ) {
298302 $status = Status::newGood();
299303 foreach ( $this->backends as $backend ) {
300304 $realParams = $this->substOpPaths( $params, $backend );
@@ -306,7 +310,7 @@
307311 * @see FileBackend::doClean()
308312 * @return Status
309313 */
310 - public function doClean( array $params ) {
 314+ protected function doClean( array $params ) {
311315 $status = Status::newGood();
312316 foreach ( $this->backends as $backend ) {
313317 $realParams = $this->substOpPaths( $params, $backend );
Index: trunk/phase3/includes/filerepo/backend/FileOp.php
@@ -40,8 +40,8 @@
4141 /**
4242 * Build a new file operation transaction
4343 *
44 - * @params $backend FileBackendStore
45 - * @params $params Array
 44+ * @param $backend FileBackendStore
 45+ * @param $params Array
4646 * @throws MWException
4747 */
4848 final public function __construct( FileBackendStore $backend, array $params ) {
Index: trunk/phase3/includes/filerepo/backend/FileBackend.php
@@ -19,9 +19,10 @@
2020 * This class defines the methods as abstract that subclasses must implement.
2121 * Outside callers can assume that all backends will have these functions.
2222 *
23 - * All "storage paths" are of the format "mwstore://backend/container/path".
24 - * The paths use UNIX file system (FS) notation, though any particular backend may
25 - * not actually be using a local filesystem. Therefore, the paths are only virtual.
 23+ * All "storage paths" are of the format "mwstore://<backend>/<container>/<path>".
 24+ * The <path> portion is a relative path that uses UNIX file system (FS) notation,
 25+ * though any particular backend may not actually be using a local filesystem.
 26+ * Therefore, the relative paths are only virtual.
2627 *
2728 * Backend contents are stored under wiki-specific container names by default.
2829 * For legacy reasons, this has no effect for the FS backend class, and per-wiki
@@ -710,7 +711,7 @@
711712 }
712713
713714 /**
714 - * @brief Base class for all backends associated with a particular storage medium.
 715+ * @brief Base class for all backends using particular storage medium.
715716 *
716717 * This class defines the methods as abstract that subclasses must implement.
717718 * Outside callers should *not* use functions with "Internal" in the name.

Sign-offs

UserFlagDate
Krinkleinspected11:53, 24 February 2012

Status & tagging log