r104413 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104412‎ | r104413 | r104414 >
Date:09:18, 28 November 2011
Author:aaron
Status:deferred
Tags:
Comment:
* Added missing FileBackendMultiWrite functions
* Removed obsolete files
Modified paths:
  • /branches/FileBackend/phase3/includes/filerepo/backend/FileBackendMultiWrite.php (modified) (history)
  • /branches/FileBackend/phase3/includes/filerepo/dataStores (deleted) (history)

Diff [purge]

Index: branches/FileBackend/phase3/includes/filerepo/backend/FileBackendMultiWrite.php
@@ -8,7 +8,8 @@
99 /**
1010 * This class defines a multi-write backend. Multiple backends can
1111 * be registered to this proxy backend it will act as a single backend.
12 - * Use this only if all access to the backends is through an instance of this class.
 12+ * Use this when all access to the backends is through this proxy backend.
 13+ * At least one of the backends must be declared the "master" backend.
1314 *
1415 * The order that the backends are defined sets the priority of which
1516 * backend is read from or written to first. Functions like fileExists()
@@ -16,8 +17,10 @@
1718 * that has the file (normally both should have it anyway). Special cases:
1819 * a) getFileList() will return results from the first backend that is
1920 * not declared as non-persistent cache. This is for correctness.
20 - * b) getFileHash() will always check only the master backend to keep the
21 - * result format consistent.
 21+ * b) getFileTimestamp() will always check only the master backend to
 22+ * avoid confusing and inconsistent results.
 23+ * c) getFileHash() will always check only the master backend to keep
 24+ * the result format consistent.
2225 *
2326 * All write operations are performed on all backends.
2427 * If an operation fails on one backend it will be rolled back from the others.
@@ -171,11 +174,19 @@
172175 function secure( array $params ) {
173176 $status = Status::newGood();
174177 foreach ( $this->backends as $backend ) {
175 - $status->merge( $backend->prepare( $params ) );
 178+ $status->merge( $backend->secure( $params ) );
176179 }
177180 return $status;
178181 }
179182
 183+ function clean( array $params ) {
 184+ $status = Status::newGood();
 185+ foreach ( $this->backends as $backend ) {
 186+ $status->merge( $backend->clean( $params ) );
 187+ }
 188+ return $status;
 189+ }
 190+
180191 function fileExists( array $params ) {
181192 foreach ( $this->backends as $backend ) {
182193 if ( $backend->fileExists( $params ) ) {
@@ -185,6 +196,11 @@
186197 return false;
187198 }
188199
 200+ function getFileTimestamp( array $params ) {
 201+ // Skip non-master for consistent timestamps
 202+ return $this->backends[$this->masterIndex]->getFileTimestamp( $params );
 203+ }
 204+
189205 function getFileHash( array $params ) {
190206 // Skip non-master for consistent hash formats
191207 return $this->backends[$this->masterIndex]->getFileHash( $params );

Status & tagging log