https://www.mediawiki.org/wiki/Special:Code/MediaWiki/111897
Revision: 111897
Author: aaron
Date: 2012-02-19 23:40:02 +0000 (Sun, 19 Feb 2012)
Log Message:
-----------
* 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
trunk/phase3/includes/filerepo/backend/FileBackendMultiWrite.php
trunk/phase3/includes/filerepo/backend/FileOp.php
Modified: trunk/phase3/includes/filerepo/backend/FileBackend.php
===================================================================
--- trunk/phase3/includes/filerepo/backend/FileBackend.php 2012-02-19
22:47:50 UTC (rev 111896)
+++ trunk/phase3/includes/filerepo/backend/FileBackend.php 2012-02-19
23:40:02 UTC (rev 111897)
@@ -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://<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 @@
}
/**
- * @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.
Modified: trunk/phase3/includes/filerepo/backend/FileBackendMultiWrite.php
===================================================================
--- trunk/phase3/includes/filerepo/backend/FileBackendMultiWrite.php
2012-02-19 22:47:50 UTC (rev 111896)
+++ trunk/phase3/includes/filerepo/backend/FileBackendMultiWrite.php
2012-02-19 23:40:02 UTC (rev 111897)
@@ -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 @@
$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 @@
$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 @@
* @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 @@
* @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 @@
* @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 );
Modified: trunk/phase3/includes/filerepo/backend/FileOp.php
===================================================================
--- trunk/phase3/includes/filerepo/backend/FileOp.php 2012-02-19 22:47:50 UTC
(rev 111896)
+++ trunk/phase3/includes/filerepo/backend/FileOp.php 2012-02-19 23:40:02 UTC
(rev 111897)
@@ -40,8 +40,8 @@
/**
* 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 ) {
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs