r110261 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110260‎ | r110261 | r110262 >
Date:22:22, 29 January 2012
Author:aaron
Status:ok
Tags:filebackend 
Comment:
Renamed FileBackend to FileBackendStore and ugly FileBackendBase to FileBackend. Callers doing things like FileBackend::extensionFromPath() are now more proper.
Modified paths:
  • /trunk/extensions/WindowsAzureStorage/includes/filerepo/backend/WindowsAzureFileBackend.php (modified) (history)
  • /trunk/phase3/includes/AutoLoader.php (modified) (history)
  • /trunk/phase3/includes/filerepo/FileRepo.php (modified) (history)
  • /trunk/phase3/includes/filerepo/backend/FSFileBackend.php (modified) (history)
  • /trunk/phase3/includes/filerepo/backend/FileBackend.php (modified) (history)
  • /trunk/phase3/includes/filerepo/backend/FileBackendGroup.php (modified) (history)
  • /trunk/phase3/includes/filerepo/backend/FileBackendMultiWrite.php (modified) (history)
  • /trunk/phase3/includes/filerepo/backend/FileOp.php (modified) (history)
  • /trunk/phase3/includes/filerepo/backend/SwiftFileBackend.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/backend/FileBackendMultiWrite.php
@@ -20,17 +20,17 @@
2121 * @ingroup FileBackend
2222 * @since 1.19
2323 */
24 -class FileBackendMultiWrite extends FileBackendBase {
25 - /** @var Array Prioritized list of FileBackend objects */
 24+class FileBackendMultiWrite extends FileBackend {
 25+ /** @var Array Prioritized list of FileBackendStore objects */
2626 protected $backends = array(); // array of (backend index => backends)
27 - protected $masterIndex = -1; // index of master backend
 27+ protected $masterIndex = -1; // integer; index of master backend
2828
2929 /**
3030 * Construct a proxy backend that consists of several internal backends.
3131 * Additional $config params include:
3232 * 'backends' : Array of backend config and multi-backend settings.
3333 * Each value is the config used in the constructor of a
34 - * FileBackend class, but with these additional settings:
 34+ * FileBackendStore class, but with these additional settings:
3535 * 'class' : The name of the backend class
3636 * 'isMultiMaster' : This must be set for one backend.
3737 * @param $config Array
@@ -64,7 +64,7 @@
6565 }
6666
6767 /**
68 - * @see FileBackendBase::doOperationsInternal()
 68+ * @see FileBackend::doOperationsInternal()
6969 */
7070 final protected function doOperationsInternal( array $ops, array $opts ) {
7171 $status = Status::newGood();
@@ -196,10 +196,10 @@
197197 * for a set of operations with that of a given internal backend.
198198 *
199199 * @param $ops Array List of file operation arrays
200 - * @param $backend FileBackend
 200+ * @param $backend FileBackendStore
201201 * @return Array
202202 */
203 - protected function substOpBatchPaths( array $ops, FileBackend $backend ) {
 203+ protected function substOpBatchPaths( array $ops, FileBackendStore $backend ) {
204204 $newOps = array(); // operations
205205 foreach ( $ops as $op ) {
206206 $newOp = $op; // operation
@@ -217,10 +217,10 @@
218218 * Same as substOpBatchPaths() but for a single operation
219219 *
220220 * @param $op File operation array
221 - * @param $backend FileBackend
 221+ * @param $backend FileBackendStore
222222 * @return Array
223223 */
224 - protected function substOpPaths( array $ops, FileBackend $backend ) {
 224+ protected function substOpPaths( array $ops, FileBackendStore $backend ) {
225225 $newOps = $this->substOpBatchPaths( array( $ops ), $backend );
226226 return $newOps[0];
227227 }
@@ -229,10 +229,10 @@
230230 * Substitute the backend of storage paths with an internal backend's name
231231 *
232232 * @param $paths Array|string List of paths or single string path
233 - * @param $backend FileBackend
 233+ * @param $backend FileBackendStore
234234 * @return Array|string
235235 */
236 - protected function substPaths( $paths, FileBackend $backend ) {
 236+ protected function substPaths( $paths, FileBackendStore $backend ) {
237237 return preg_replace(
238238 '!^mwstore://' . preg_quote( $this->name ) . '/!',
239239 'mwstore://' . $backend->getName() . '/',
@@ -255,7 +255,7 @@
256256 }
257257
258258 /**
259 - * @see FileBackendBase::doPrepare()
 259+ * @see FileBackend::doPrepare()
260260 */
261261 public function doPrepare( array $params ) {
262262 $status = Status::newGood();
@@ -267,7 +267,7 @@
268268 }
269269
270270 /**
271 - * @see FileBackendBase::doSecure()
 271+ * @see FileBackend::doSecure()
272272 */
273273 public function doSecure( array $params ) {
274274 $status = Status::newGood();
@@ -279,7 +279,7 @@
280280 }
281281
282282 /**
283 - * @see FileBackendBase::doClean()
 283+ * @see FileBackend::doClean()
284284 */
285285 public function doClean( array $params ) {
286286 $status = Status::newGood();
@@ -291,7 +291,7 @@
292292 }
293293
294294 /**
295 - * @see FileBackendBase::getFileList()
 295+ * @see FileBackend::getFileList()
296296 */
297297 public function concatenate( array $params ) {
298298 // We are writing to an FS file, so we don't need to do this per-backend
@@ -300,7 +300,7 @@
301301 }
302302
303303 /**
304 - * @see FileBackendBase::fileExists()
 304+ * @see FileBackend::fileExists()
305305 */
306306 public function fileExists( array $params ) {
307307 $realParams = $this->substOpPaths( $params, $this->backends[$this->masterIndex] );
@@ -308,7 +308,7 @@
309309 }
310310
311311 /**
312 - * @see FileBackendBase::getFileTimestamp()
 312+ * @see FileBackend::getFileTimestamp()
313313 */
314314 public function getFileTimestamp( array $params ) {
315315 $realParams = $this->substOpPaths( $params, $this->backends[$this->masterIndex] );
@@ -316,7 +316,7 @@
317317 }
318318
319319 /**
320 - * @see FileBackendBase::getFileSize()
 320+ * @see FileBackend::getFileSize()
321321 */
322322 public function getFileSize( array $params ) {
323323 $realParams = $this->substOpPaths( $params, $this->backends[$this->masterIndex] );
@@ -324,7 +324,7 @@
325325 }
326326
327327 /**
328 - * @see FileBackendBase::getFileStat()
 328+ * @see FileBackend::getFileStat()
329329 */
330330 public function getFileStat( array $params ) {
331331 $realParams = $this->substOpPaths( $params, $this->backends[$this->masterIndex] );
@@ -332,7 +332,7 @@
333333 }
334334
335335 /**
336 - * @see FileBackendBase::getFileContents()
 336+ * @see FileBackend::getFileContents()
337337 */
338338 public function getFileContents( array $params ) {
339339 $realParams = $this->substOpPaths( $params, $this->backends[$this->masterIndex] );
@@ -340,7 +340,7 @@
341341 }
342342
343343 /**
344 - * @see FileBackendBase::getFileSha1Base36()
 344+ * @see FileBackend::getFileSha1Base36()
345345 */
346346 public function getFileSha1Base36( array $params ) {
347347 $realParams = $this->substOpPaths( $params, $this->backends[$this->masterIndex] );
@@ -348,7 +348,7 @@
349349 }
350350
351351 /**
352 - * @see FileBackendBase::getFileProps()
 352+ * @see FileBackend::getFileProps()
353353 */
354354 public function getFileProps( array $params ) {
355355 $realParams = $this->substOpPaths( $params, $this->backends[$this->masterIndex] );
@@ -356,7 +356,7 @@
357357 }
358358
359359 /**
360 - * @see FileBackendBase::streamFile()
 360+ * @see FileBackend::streamFile()
361361 */
362362 public function streamFile( array $params ) {
363363 $realParams = $this->substOpPaths( $params, $this->backends[$this->masterIndex] );
@@ -364,7 +364,7 @@
365365 }
366366
367367 /**
368 - * @see FileBackendBase::getLocalReference()
 368+ * @see FileBackend::getLocalReference()
369369 */
370370 public function getLocalReference( array $params ) {
371371 $realParams = $this->substOpPaths( $params, $this->backends[$this->masterIndex] );
@@ -372,7 +372,7 @@
373373 }
374374
375375 /**
376 - * @see FileBackendBase::getLocalCopy()
 376+ * @see FileBackend::getLocalCopy()
377377 */
378378 public function getLocalCopy( array $params ) {
379379 $realParams = $this->substOpPaths( $params, $this->backends[$this->masterIndex] );
@@ -380,7 +380,7 @@
381381 }
382382
383383 /**
384 - * @see FileBackendBase::getFileList()
 384+ * @see FileBackend::getFileList()
385385 */
386386 public function getFileList( array $params ) {
387387 $realParams = $this->substOpPaths( $params, $this->backends[$this->masterIndex] );
@@ -388,7 +388,7 @@
389389 }
390390
391391 /**
392 - * @see FileBackendBase::clearCache()
 392+ * @see FileBackend::clearCache()
393393 */
394394 public function clearCache( array $paths = null ) {
395395 foreach ( $this->backends as $backend ) {
Index: trunk/phase3/includes/filerepo/backend/FileOp.php
@@ -18,7 +18,7 @@
1919 abstract class FileOp {
2020 /** @var Array */
2121 protected $params = array();
22 - /** @var FileBackendBase */
 22+ /** @var FileBackendStore */
2323 protected $backend;
2424
2525 protected $state = self::STATE_NEW; // integer
@@ -40,11 +40,11 @@
4141 /**
4242 * Build a new file operation transaction
4343 *
44 - * @params $backend FileBackend
 44+ * @params $backend FileBackendStore
4545 * @params $params Array
4646 * @throws MWException
4747 */
48 - final public function __construct( FileBackendBase $backend, array $params ) {
 48+ final public function __construct( FileBackendStore $backend, array $params ) {
4949 $this->backend = $backend;
5050 list( $required, $optional ) = $this->allowedParams();
5151 foreach ( $required as $name ) {
@@ -387,7 +387,7 @@
388388
389389 /**
390390 * Store a file into the backend from a file on the file system.
391 - * Parameters similar to FileBackend::storeInternal(), which include:
 391+ * Parameters similar to FileBackendStore::storeInternal(), which include:
392392 * src : source path on file system
393393 * dst : destination storage path
394394 * overwrite : do nothing and pass if an identical file exists at destination
@@ -449,7 +449,7 @@
450450
451451 /**
452452 * Create a file in the backend with the given content.
453 - * Parameters similar to FileBackend::createInternal(), which include:
 453+ * Parameters similar to FileBackendStore::createInternal(), which include:
454454 * content : the raw file contents
455455 * dst : destination storage path
456456 * overwrite : do nothing and pass if an identical file exists at destination
@@ -501,7 +501,7 @@
502502
503503 /**
504504 * Copy a file from one storage path to another in the backend.
505 - * Parameters similar to FileBackend::copyInternal(), which include:
 505+ * Parameters similar to FileBackendStore::copyInternal(), which include:
506506 * src : source storage path
507507 * dst : destination storage path
508508 * overwrite : do nothing and pass if an identical file exists at destination
@@ -556,7 +556,7 @@
557557
558558 /**
559559 * Move a file from one storage path to another in the backend.
560 - * Parameters similar to FileBackend::moveInternal(), which include:
 560+ * Parameters similar to FileBackendStore::moveInternal(), which include:
561561 * src : source storage path
562562 * dst : destination storage path
563563 * overwrite : do nothing and pass if an identical file exists at destination
@@ -617,7 +617,7 @@
618618
619619 /**
620620 * Delete a file at the given storage path from the backend.
621 - * Parameters similar to FileBackend::deleteInternal(), which include:
 621+ * Parameters similar to FileBackendStore::deleteInternal(), which include:
622622 * src : source storage path
623623 * ignoreMissingSource : don't return an error if the file does not exist
624624 */
Index: trunk/phase3/includes/filerepo/backend/FSFileBackend.php
@@ -21,7 +21,7 @@
2222 * @ingroup FileBackend
2323 * @since 1.19
2424 */
25 -class FSFileBackend extends FileBackend {
 25+class FSFileBackend extends FileBackendStore {
2626 protected $basePath; // string; directory holding the container directories
2727 /** @var Array Map of container names to root paths */
2828 protected $containerPaths = array(); // for custom container paths
@@ -30,7 +30,7 @@
3131 protected $hadWarningErrors = array();
3232
3333 /**
34 - * @see FileBackend::__construct()
 34+ * @see FileBackendStore::__construct()
3535 * Additional $config params include:
3636 * basePath : File system directory that holds containers.
3737 * containerPaths : Map of container names to custom file system directories.
@@ -58,7 +58,7 @@
5959 }
6060
6161 /**
62 - * @see FileBackend::resolveContainerName()
 62+ * @see FileBackendStore::resolveContainerName()
6363 */
6464 protected function resolveContainerName( $container ) {
6565 if ( $container !== '.' ) {
@@ -68,7 +68,7 @@
6969 }
7070
7171 /**
72 - * @see FileBackend::resolveContainerPath()
 72+ * @see FileBackendStore::resolveContainerPath()
7373 */
7474 protected function resolveContainerPath( $container, $relStoragePath ) {
7575 if ( isset( $this->containerPaths[$container] ) || isset( $this->basePath ) ) {
@@ -114,7 +114,7 @@
115115 }
116116
117117 /**
118 - * @see FileBackend::isPathUsableInternal()
 118+ * @see FileBackendStore::isPathUsableInternal()
119119 */
120120 public function isPathUsableInternal( $storagePath ) {
121121 $fsPath = $this->resolveToFSPath( $storagePath );
@@ -135,7 +135,7 @@
136136 }
137137
138138 /**
139 - * @see FileBackend::doStoreInternal()
 139+ * @see FileBackendStore::doStoreInternal()
140140 */
141141 protected function doStoreInternal( array $params ) {
142142 $status = Status::newGood();
@@ -175,7 +175,7 @@
176176 }
177177
178178 /**
179 - * @see FileBackend::doCopyInternal()
 179+ * @see FileBackendStore::doCopyInternal()
180180 */
181181 protected function doCopyInternal( array $params ) {
182182 $status = Status::newGood();
@@ -221,7 +221,7 @@
222222 }
223223
224224 /**
225 - * @see FileBackend::doMoveInternal()
 225+ * @see FileBackendStore::doMoveInternal()
226226 */
227227 protected function doMoveInternal( array $params ) {
228228 $status = Status::newGood();
@@ -269,7 +269,7 @@
270270 }
271271
272272 /**
273 - * @see FileBackend::doDeleteInternal()
 273+ * @see FileBackendStore::doDeleteInternal()
274274 */
275275 protected function doDeleteInternal( array $params ) {
276276 $status = Status::newGood();
@@ -299,7 +299,7 @@
300300 }
301301
302302 /**
303 - * @see FileBackend::doCreateInternal()
 303+ * @see FileBackendStore::doCreateInternal()
304304 */
305305 protected function doCreateInternal( array $params ) {
306306 $status = Status::newGood();
@@ -339,7 +339,7 @@
340340 }
341341
342342 /**
343 - * @see FileBackend::doPrepareInternal()
 343+ * @see FileBackendStore::doPrepareInternal()
344344 */
345345 protected function doPrepareInternal( $fullCont, $dirRel, array $params ) {
346346 $status = Status::newGood();
@@ -357,7 +357,7 @@
358358 }
359359
360360 /**
361 - * @see FileBackend::doSecureInternal()
 361+ * @see FileBackendStore::doSecureInternal()
362362 */
363363 protected function doSecureInternal( $fullCont, $dirRel, array $params ) {
364364 $status = Status::newGood();
@@ -391,7 +391,7 @@
392392 }
393393
394394 /**
395 - * @see FileBackend::doCleanInternal()
 395+ * @see FileBackendStore::doCleanInternal()
396396 */
397397 protected function doCleanInternal( $fullCont, $dirRel, array $params ) {
398398 $status = Status::newGood();
@@ -407,7 +407,7 @@
408408 }
409409
410410 /**
411 - * @see FileBackend::doFileExists()
 411+ * @see FileBackendStore::doFileExists()
412412 */
413413 protected function doGetFileStat( array $params ) {
414414 $source = $this->resolveToFSPath( $params['src'] );
@@ -432,14 +432,14 @@
433433 }
434434
435435 /**
436 - * @see FileBackend::doClearCache()
 436+ * @see FileBackendStore::doClearCache()
437437 */
438438 protected function doClearCache( array $paths = null ) {
439439 clearstatcache(); // clear the PHP file stat cache
440440 }
441441
442442 /**
443 - * @see FileBackend::getFileListInternal()
 443+ * @see FileBackendStore::getFileListInternal()
444444 */
445445 public function getFileListInternal( $fullCont, $dirRel, array $params ) {
446446 list( $b, $shortCont, $r ) = FileBackend::splitStoragePath( $params['dir'] );
@@ -461,7 +461,7 @@
462462 }
463463
464464 /**
465 - * @see FileBackend::getLocalReference()
 465+ * @see FileBackendStore::getLocalReference()
466466 */
467467 public function getLocalReference( array $params ) {
468468 $source = $this->resolveToFSPath( $params['src'] );
@@ -472,7 +472,7 @@
473473 }
474474
475475 /**
476 - * @see FileBackend::getLocalCopy()
 476+ * @see FileBackendStore::getLocalCopy()
477477 */
478478 public function getLocalCopy( array $params ) {
479479 $source = $this->resolveToFSPath( $params['src'] );
Index: trunk/phase3/includes/filerepo/backend/FileBackendGroup.php
@@ -124,7 +124,7 @@
125125 * Get the backend object with a given name
126126 *
127127 * @param $name string
128 - * @return FileBackendBase
 128+ * @return FileBackend
129129 * @throws MWException
130130 */
131131 public function get( $name ) {
@@ -144,7 +144,7 @@
145145 * Get an appropriate backend object from a storage path
146146 *
147147 * @param $storagePath string
148 - * @return FileBackendBase|null Backend or null on failure
 148+ * @return FileBackend|null Backend or null on failure
149149 */
150150 public function backendFromPath( $storagePath ) {
151151 list( $backend, $c, $p ) = FileBackend::splitStoragePath( $storagePath );
Index: trunk/phase3/includes/filerepo/backend/SwiftFileBackend.php
@@ -19,7 +19,7 @@
2020 * @ingroup FileBackend
2121 * @since 1.19
2222 */
23 -class SwiftFileBackend extends FileBackend {
 23+class SwiftFileBackend extends FileBackendStore {
2424 /** @var CF_Authentication */
2525 protected $auth; // Swift authentication handler
2626 protected $authTTL; // integer seconds
@@ -32,7 +32,7 @@
3333 protected $connContainers = array(); // container object cache
3434
3535 /**
36 - * @see FileBackend::__construct()
 36+ * @see FileBackendStore::__construct()
3737 * Additional $config params include:
3838 * swiftAuthUrl : Swift authentication server URL
3939 * swiftUser : Swift user used by MediaWiki (account:username)
@@ -63,7 +63,7 @@
6464 }
6565
6666 /**
67 - * @see FileBackend::resolveContainerPath()
 67+ * @see FileBackendStore::resolveContainerPath()
6868 */
6969 protected function resolveContainerPath( $container, $relStoragePath ) {
7070 if ( strlen( urlencode( $relStoragePath ) ) > 1024 ) {
@@ -73,7 +73,7 @@
7474 }
7575
7676 /**
77 - * @see FileBackend::isPathUsableInternal()
 77+ * @see FileBackendStore::isPathUsableInternal()
7878 */
7979 public function isPathUsableInternal( $storagePath ) {
8080 list( $container, $rel ) = $this->resolveStoragePathReal( $storagePath );
@@ -94,7 +94,7 @@
9595 }
9696
9797 /**
98 - * @see FileBackend::doCopyInternal()
 98+ * @see FileBackendStore::doCopyInternal()
9999 */
100100 protected function doCreateInternal( array $params ) {
101101 $status = Status::newGood();
@@ -156,7 +156,7 @@
157157 }
158158
159159 /**
160 - * @see FileBackend::doStoreInternal()
 160+ * @see FileBackendStore::doStoreInternal()
161161 */
162162 protected function doStoreInternal( array $params ) {
163163 $status = Status::newGood();
@@ -224,7 +224,7 @@
225225 }
226226
227227 /**
228 - * @see FileBackend::doCopyInternal()
 228+ * @see FileBackendStore::doCopyInternal()
229229 */
230230 protected function doCopyInternal( array $params ) {
231231 $status = Status::newGood();
@@ -279,7 +279,7 @@
280280 }
281281
282282 /**
283 - * @see FileBackend::doDeleteInternal()
 283+ * @see FileBackendStore::doDeleteInternal()
284284 */
285285 protected function doDeleteInternal( array $params ) {
286286 $status = Status::newGood();
@@ -310,7 +310,7 @@
311311 }
312312
313313 /**
314 - * @see FileBackend::doPrepareInternal()
 314+ * @see FileBackendStore::doPrepareInternal()
315315 */
316316 protected function doPrepareInternal( $fullCont, $dir, array $params ) {
317317 $status = Status::newGood();
@@ -355,7 +355,7 @@
356356 }
357357
358358 /**
359 - * @see FileBackend::doSecureInternal()
 359+ * @see FileBackendStore::doSecureInternal()
360360 */
361361 protected function doSecureInternal( $fullCont, $dir, array $params ) {
362362 $status = Status::newGood();
@@ -389,7 +389,7 @@
390390 }
391391
392392 /**
393 - * @see FileBackend::doCleanInternal()
 393+ * @see FileBackendStore::doCleanInternal()
394394 */
395395 protected function doCleanInternal( $fullCont, $dir, array $params ) {
396396 $status = Status::newGood();
@@ -433,7 +433,7 @@
434434 }
435435
436436 /**
437 - * @see FileBackend::doFileExists()
 437+ * @see FileBackendStore::doFileExists()
438438 */
439439 protected function doGetFileStat( array $params ) {
440440 list( $srcCont, $srcRel ) = $this->resolveStoragePathReal( $params['src'] );
@@ -494,7 +494,7 @@
495495 }
496496
497497 /**
498 - * @see FileBackendBase::getFileContents()
 498+ * @see FileBackend::getFileContents()
499499 */
500500 public function getFileContents( array $params ) {
501501 list( $srcCont, $srcRel ) = $this->resolveStoragePathReal( $params['src'] );
@@ -521,7 +521,7 @@
522522 }
523523
524524 /**
525 - * @see FileBackend::getFileListInternal()
 525+ * @see FileBackendStore::getFileListInternal()
526526 */
527527 public function getFileListInternal( $fullCont, $dir, array $params ) {
528528 return new SwiftFileBackendFileList( $this, $fullCont, $dir );
@@ -554,7 +554,7 @@
555555 }
556556
557557 /**
558 - * @see FileBackend::doGetFileSha1base36()
 558+ * @see FileBackendStore::doGetFileSha1base36()
559559 */
560560 public function doGetFileSha1base36( array $params ) {
561561 $stat = $this->getFileStat( $params );
@@ -566,7 +566,7 @@
567567 }
568568
569569 /**
570 - * @see FileBackend::doStreamFile()
 570+ * @see FileBackendStore::doStreamFile()
571571 */
572572 protected function doStreamFile( array $params ) {
573573 $status = Status::newGood();
@@ -592,7 +592,6 @@
593593
594594 try {
595595 $output = fopen( 'php://output', 'w' );
596 - // FileBackend::streamFile() already checks existence
597596 $obj = new CF_Object( $cont, $srcRel, false, false ); // skip HEAD request
598597 $obj->stream( $output, $this->headersFromParams( $params ) );
599598 } catch ( InvalidResponseException $e ) { // 404? connection problem?
@@ -606,7 +605,7 @@
607606 }
608607
609608 /**
610 - * @see FileBackend::getLocalCopy()
 609+ * @see FileBackendStore::getLocalCopy()
611610 */
612611 public function getLocalCopy( array $params ) {
613612 list( $srcCont, $srcRel ) = $this->resolveStoragePathReal( $params['src'] );
@@ -722,7 +721,7 @@
723722 }
724723
725724 /**
726 - * @see FileBackend::doClearCache()
 725+ * @see FileBackendStore::doClearCache()
727726 */
728727 protected function doClearCache( array $paths = null ) {
729728 $this->connContainers = array(); // clear container object cache
Index: trunk/phase3/includes/filerepo/backend/FileBackend.php
@@ -29,7 +29,7 @@
3030 * @ingroup FileBackend
3131 * @since 1.19
3232 */
33 -abstract class FileBackendBase {
 33+abstract class FileBackend {
3434 protected $name; // string; unique backend name
3535 protected $wikiId; // string; unique wiki name
3636 protected $readOnly; // string; read-only explanation message
@@ -170,7 +170,7 @@
171171 }
172172
173173 /**
174 - * @see FileBackendBase::doOperations()
 174+ * @see FileBackend::doOperations()
175175 */
176176 abstract protected function doOperationsInternal( array $ops, array $opts );
177177
@@ -179,7 +179,7 @@
180180 * If you are doing a batch of operations that should either
181181 * all succeed or all fail, then use that function instead.
182182 *
183 - * @see FileBackendBase::doOperations()
 183+ * @see FileBackend::doOperations()
184184 *
185185 * @param $op Array Operation
186186 * @param $opts Array Operation options
@@ -193,7 +193,7 @@
194194 * Performs a single create operation.
195195 * This sets $params['op'] to 'create' and passes it to doOperation().
196196 *
197 - * @see FileBackendBase::doOperation()
 197+ * @see FileBackend::doOperation()
198198 *
199199 * @param $params Array Operation parameters
200200 * @param $opts Array Operation options
@@ -208,7 +208,7 @@
209209 * Performs a single store operation.
210210 * This sets $params['op'] to 'store' and passes it to doOperation().
211211 *
212 - * @see FileBackendBase::doOperation()
 212+ * @see FileBackend::doOperation()
213213 *
214214 * @param $params Array Operation parameters
215215 * @param $opts Array Operation options
@@ -223,7 +223,7 @@
224224 * Performs a single copy operation.
225225 * This sets $params['op'] to 'copy' and passes it to doOperation().
226226 *
227 - * @see FileBackendBase::doOperation()
 227+ * @see FileBackend::doOperation()
228228 *
229229 * @param $params Array Operation parameters
230230 * @param $opts Array Operation options
@@ -238,7 +238,7 @@
239239 * Performs a single move operation.
240240 * This sets $params['op'] to 'move' and passes it to doOperation().
241241 *
242 - * @see FileBackendBase::doOperation()
 242+ * @see FileBackend::doOperation()
243243 *
244244 * @param $params Array Operation parameters
245245 * @param $opts Array Operation options
@@ -253,7 +253,7 @@
254254 * Performs a single delete operation.
255255 * This sets $params['op'] to 'delete' and passes it to doOperation().
256256 *
257 - * @see FileBackendBase::doOperation()
 257+ * @see FileBackend::doOperation()
258258 *
259259 * @param $params Array Operation parameters
260260 * @param $opts Array Operation options
@@ -297,7 +297,7 @@
298298 }
299299
300300 /**
301 - * @see FileBackendBase::prepare()
 301+ * @see FileBackend::prepare()
302302 */
303303 abstract protected function doPrepare( array $params );
304304
@@ -328,7 +328,7 @@
329329 }
330330
331331 /**
332 - * @see FileBackendBase::secure()
 332+ * @see FileBackend::secure()
333333 */
334334 abstract protected function doSecure( array $params );
335335
@@ -351,7 +351,7 @@
352352 }
353353
354354 /**
355 - * @see FileBackendBase::clean()
 355+ * @see FileBackend::clean()
356356 */
357357 abstract protected function doClean( array $params );
358358
@@ -681,14 +681,14 @@
682682 * This class defines the methods as abstract that subclasses must implement.
683683 * Outside callers should *not* use functions with "Internal" in the name.
684684 *
685 - * The FileBackendBase operations are implemented using basic functions
 685+ * The FileBackend operations are implemented using basic functions
686686 * such as storeInternal(), copyInternal(), deleteInternal() and the like.
687687 * This class is also responsible for path resolution and sanitization.
688688 *
689689 * @ingroup FileBackend
690690 * @since 1.19
691691 */
692 -abstract class FileBackend extends FileBackendBase {
 692+abstract class FileBackendStore extends FileBackend {
693693 /** @var Array Map of paths to small (RAM/disk) cache items */
694694 protected $cache = array(); // (storage path => key => value)
695695 protected $maxCacheSize = 100; // integer; max paths with entries
@@ -747,7 +747,7 @@
748748 }
749749
750750 /**
751 - * @see FileBackend::createInternal()
 751+ * @see FileBackendStore::createInternal()
752752 */
753753 abstract protected function doCreateInternal( array $params );
754754
@@ -776,7 +776,7 @@
777777 }
778778
779779 /**
780 - * @see FileBackend::storeInternal()
 780+ * @see FileBackendStore::storeInternal()
781781 */
782782 abstract protected function doStoreInternal( array $params );
783783
@@ -801,7 +801,7 @@
802802 }
803803
804804 /**
805 - * @see FileBackend::copyInternal()
 805+ * @see FileBackendStore::copyInternal()
806806 */
807807 abstract protected function doCopyInternal( array $params );
808808
@@ -825,7 +825,7 @@
826826 }
827827
828828 /**
829 - * @see FileBackend::deleteInternal()
 829+ * @see FileBackendStore::deleteInternal()
830830 */
831831 abstract protected function doDeleteInternal( array $params );
832832
@@ -850,7 +850,7 @@
851851 }
852852
853853 /**
854 - * @see FileBackend::moveInternal()
 854+ * @see FileBackendStore::moveInternal()
855855 */
856856 protected function doMoveInternal( array $params ) {
857857 // Copy source to dest
@@ -864,7 +864,7 @@
865865 }
866866
867867 /**
868 - * @see FileBackendBase::concatenate()
 868+ * @see FileBackend::concatenate()
869869 */
870870 final public function concatenate( array $params ) {
871871 wfProfileIn( __METHOD__ );
@@ -882,7 +882,7 @@
883883 }
884884
885885 /**
886 - * @see FileBackend::concatenate()
 886+ * @see FileBackendStore::concatenate()
887887 */
888888 protected function doConcatenate( array $params ) {
889889 $status = Status::newGood();
@@ -937,7 +937,7 @@
938938 }
939939
940940 /**
941 - * @see FileBackendBase::doPrepare()
 941+ * @see FileBackend::doPrepare()
942942 */
943943 final protected function doPrepare( array $params ) {
944944 wfProfileIn( __METHOD__ );
@@ -965,14 +965,14 @@
966966 }
967967
968968 /**
969 - * @see FileBackend::doPrepare()
 969+ * @see FileBackendStore::doPrepare()
970970 */
971971 protected function doPrepareInternal( $container, $dir, array $params ) {
972972 return Status::newGood();
973973 }
974974
975975 /**
976 - * @see FileBackendBase::doSecure()
 976+ * @see FileBackend::doSecure()
977977 */
978978 final protected function doSecure( array $params ) {
979979 wfProfileIn( __METHOD__ );
@@ -1000,14 +1000,14 @@
10011001 }
10021002
10031003 /**
1004 - * @see FileBackend::doSecure()
 1004+ * @see FileBackendStore::doSecure()
10051005 */
10061006 protected function doSecureInternal( $container, $dir, array $params ) {
10071007 return Status::newGood();
10081008 }
10091009
10101010 /**
1011 - * @see FileBackendBase::doClean()
 1011+ * @see FileBackend::doClean()
10121012 */
10131013 final protected function doClean( array $params ) {
10141014 wfProfileIn( __METHOD__ );
@@ -1043,14 +1043,14 @@
10441044 }
10451045
10461046 /**
1047 - * @see FileBackend::doClean()
 1047+ * @see FileBackendStore::doClean()
10481048 */
10491049 protected function doCleanInternal( $container, $dir, array $params ) {
10501050 return Status::newGood();
10511051 }
10521052
10531053 /**
1054 - * @see FileBackendBase::fileExists()
 1054+ * @see FileBackend::fileExists()
10551055 */
10561056 final public function fileExists( array $params ) {
10571057 wfProfileIn( __METHOD__ );
@@ -1060,7 +1060,7 @@
10611061 }
10621062
10631063 /**
1064 - * @see FileBackendBase::getFileTimestamp()
 1064+ * @see FileBackend::getFileTimestamp()
10651065 */
10661066 final public function getFileTimestamp( array $params ) {
10671067 wfProfileIn( __METHOD__ );
@@ -1070,7 +1070,7 @@
10711071 }
10721072
10731073 /**
1074 - * @see FileBackendBase::getFileSize()
 1074+ * @see FileBackend::getFileSize()
10751075 */
10761076 final public function getFileSize( array $params ) {
10771077 wfProfileIn( __METHOD__ );
@@ -1080,7 +1080,7 @@
10811081 }
10821082
10831083 /**
1084 - * @see FileBackendBase::getFileStat()
 1084+ * @see FileBackend::getFileStat()
10851085 */
10861086 final public function getFileStat( array $params ) {
10871087 wfProfileIn( __METHOD__ );
@@ -1108,12 +1108,12 @@
11091109 }
11101110
11111111 /**
1112 - * @see FileBackend::getFileStat()
 1112+ * @see FileBackendStore::getFileStat()
11131113 */
11141114 abstract protected function doGetFileStat( array $params );
11151115
11161116 /**
1117 - * @see FileBackendBase::getFileContents()
 1117+ * @see FileBackend::getFileContents()
11181118 */
11191119 public function getFileContents( array $params ) {
11201120 wfProfileIn( __METHOD__ );
@@ -1130,7 +1130,7 @@
11311131 }
11321132
11331133 /**
1134 - * @see FileBackendBase::getFileSha1Base36()
 1134+ * @see FileBackend::getFileSha1Base36()
11351135 */
11361136 final public function getFileSha1Base36( array $params ) {
11371137 wfProfileIn( __METHOD__ );
@@ -1149,7 +1149,7 @@
11501150 }
11511151
11521152 /**
1153 - * @see FileBackend::getFileSha1Base36()
 1153+ * @see FileBackendStore::getFileSha1Base36()
11541154 */
11551155 protected function doGetFileSha1Base36( array $params ) {
11561156 $fsFile = $this->getLocalReference( $params );
@@ -1161,7 +1161,7 @@
11621162 }
11631163
11641164 /**
1165 - * @see FileBackendBase::getFileProps()
 1165+ * @see FileBackend::getFileProps()
11661166 */
11671167 final public function getFileProps( array $params ) {
11681168 wfProfileIn( __METHOD__ );
@@ -1172,7 +1172,7 @@
11731173 }
11741174
11751175 /**
1176 - * @see FileBackendBase::getLocalReference()
 1176+ * @see FileBackend::getLocalReference()
11771177 */
11781178 public function getLocalReference( array $params ) {
11791179 wfProfileIn( __METHOD__ );
@@ -1191,7 +1191,7 @@
11921192 }
11931193
11941194 /**
1195 - * @see FileBackendBase::streamFile()
 1195+ * @see FileBackend::streamFile()
11961196 */
11971197 final public function streamFile( array $params ) {
11981198 wfProfileIn( __METHOD__ );
@@ -1218,7 +1218,7 @@
12191219 }
12201220
12211221 /**
1222 - * @see FileBackend::streamFile()
 1222+ * @see FileBackendStore::streamFile()
12231223 */
12241224 protected function doStreamFile( array $params ) {
12251225 $status = Status::newGood();
@@ -1234,7 +1234,7 @@
12351235 }
12361236
12371237 /**
1238 - * @see FileBackendBase::getFileList()
 1238+ * @see FileBackend::getFileList()
12391239 */
12401240 final public function getFileList( array $params ) {
12411241 list( $fullCont, $dir, $shard ) = $this->resolveStoragePath( $params['dir'] );
@@ -1248,7 +1248,7 @@
12491249 wfDebug( __METHOD__ . ": iterating over all container shards.\n" );
12501250 // File listing spans multiple containers/shards
12511251 list( $b, $shortCont, $r ) = self::splitStoragePath( $params['dir'] );
1252 - return new FileBackendShardListIterator( $this,
 1252+ return new FileBackendStoreShardListIterator( $this,
12531253 $fullCont, $dir, $this->getContainerSuffixes( $shortCont ), $params );
12541254 }
12551255 }
@@ -1256,7 +1256,7 @@
12571257 /**
12581258 * Do not call this function from places outside FileBackend
12591259 *
1260 - * @see FileBackend::getFileList()
 1260+ * @see FileBackendStore::getFileList()
12611261 *
12621262 * @param $container string Resolved container name
12631263 * @param $dir string Resolved path relative to container
@@ -1314,7 +1314,7 @@
13151315 }
13161316
13171317 /**
1318 - * @see FileBackendBase::doOperationsInternal()
 1318+ * @see FileBackend::doOperationsInternal()
13191319 */
13201320 protected function doOperationsInternal( array $ops, array $opts ) {
13211321 wfProfileIn( __METHOD__ );
@@ -1359,7 +1359,7 @@
13601360 }
13611361
13621362 /**
1363 - * @see FileBackendBase::clearCache()
 1363+ * @see FileBackend::clearCache()
13641364 */
13651365 final public function clearCache( array $paths = null ) {
13661366 if ( is_array( $paths ) ) {
@@ -1381,7 +1381,7 @@
13821382 /**
13831383 * Clears any additional stat caches for storage paths
13841384 *
1385 - * @see FileBackendBase::clearCache()
 1385+ * @see FileBackend::clearCache()
13861386 *
13871387 * @param $paths Array Storage paths (optional)
13881388 * @return void
@@ -1469,7 +1469,7 @@
14701470 * Like resolveStoragePath() except null values are returned if
14711471 * the container is sharded and the shard could not be determined.
14721472 *
1473 - * @see FileBackend::resolveStoragePath()
 1473+ * @see FileBackendStore::resolveStoragePath()
14741474 *
14751475 * @param $storagePath string
14761476 * @return Array (container, path) or (null, null) if invalid
@@ -1587,13 +1587,13 @@
15881588 }
15891589
15901590 /**
1591 - * FileBackend helper function to handle file listings that span container shards.
1592 - * Do not use this class from places outside of FileBackend.
 1591+ * FileBackendStore helper function to handle file listings that span container shards.
 1592+ * Do not use this class from places outside of FileBackendStore.
15931593 *
1594 - * @ingroup FileBackend
 1594+ * @ingroup FileBackendStore
15951595 */
1596 -class FileBackendShardListIterator implements Iterator {
1597 - /* @var FileBackend */
 1596+class FileBackendStoreShardListIterator implements Iterator {
 1597+ /* @var FileBackendStore */
15981598 protected $backend;
15991599 /* @var Array */
16001600 protected $params;
@@ -1608,14 +1608,14 @@
16091609 protected $pos = 0; // integer
16101610
16111611 /**
1612 - * @param $backend FileBackend
 1612+ * @param $backend FileBackendStore
16131613 * @param $container string Full storage container name
16141614 * @param $dir string Storage directory relative to container
16151615 * @param $suffixes Array List of container shard suffixes
16161616 * @param $params Array
16171617 */
16181618 public function __construct(
1619 - FileBackend $backend, $container, $dir, array $suffixes, array $params
 1619+ FileBackendStore $backend, $container, $dir, array $suffixes, array $params
16201620 ) {
16211621 $this->backend = $backend;
16221622 $this->container = $container;
Index: trunk/phase3/includes/filerepo/FileRepo.php
@@ -19,7 +19,7 @@
2020 const OVERWRITE_SAME = 4;
2121 const SKIP_LOCKING = 8;
2222
23 - /** @var FileBackendBase */
 23+ /** @var FileBackend */
2424 protected $backend;
2525 /** @var Array Map of zones to config */
2626 protected $zones = array();
@@ -51,7 +51,7 @@
5252
5353 // Required settings
5454 $this->name = $info['name'];
55 - if ( $info['backend'] instanceof FileBackendBase ) {
 55+ if ( $info['backend'] instanceof FileBackend ) {
5656 $this->backend = $info['backend']; // useful for testing
5757 } else {
5858 $this->backend = FileBackendGroup::singleton()->get( $info['backend'] );
@@ -105,7 +105,7 @@
106106 /**
107107 * Get the file backend instance
108108 *
109 - * @return FileBackendBase
 109+ * @return FileBackend
110110 */
111111 public function getBackend() {
112112 return $this->backend;
Index: trunk/phase3/includes/AutoLoader.php
@@ -494,10 +494,10 @@
495495
496496 # includes/filerepo/backend
497497 'FileBackendGroup' => 'includes/filerepo/backend/FileBackendGroup.php',
498 - 'FileBackendBase' => 'includes/filerepo/backend/FileBackend.php',
499498 'FileBackend' => 'includes/filerepo/backend/FileBackend.php',
 499+ 'FileBackendStore' => 'includes/filerepo/backend/FileBackend.php',
500500 'FileBackendMultiWrite' => 'includes/filerepo/backend/FileBackendMultiWrite.php',
501 - 'FileBackendShardListIterator' => 'includes/filerepo/backend/FileBackend.php',
 501+ 'FileBackendStoreShardListIterator' => 'includes/filerepo/backend/FileBackend.php',
502502 'FSFileBackend' => 'includes/filerepo/backend/FSFileBackend.php',
503503 'FSFileBackendFileList' => 'includes/filerepo/backend/FSFileBackend.php',
504504 'SwiftFileBackend' => 'includes/filerepo/backend/SwiftFileBackend.php',
Index: trunk/extensions/WindowsAzureStorage/includes/filerepo/backend/WindowsAzureFileBackend.php
@@ -22,7 +22,7 @@
2323 *
2424 * @ingroup FileBackend
2525 */
26 -class WindowsAzureFileBackend extends FileBackend {
 26+class WindowsAzureFileBackend extends FileBackendStore {
2727
2828 /** @var Microsoft_WindowsAzure_Storage_Blob */
2929 protected $storageClient = null;

Status & tagging log