Index: branches/FileBackend/phase3/includes/filerepo/backend/FSFileBackend.php |
— | — | @@ -17,6 +17,9 @@ |
18 | 18 | protected $containerPaths = array(); |
19 | 19 | protected $fileMode; // file permission mode |
20 | 20 | |
| 21 | + /** |
| 22 | + * @see FileBackend::__construct() |
| 23 | + */ |
21 | 24 | function __construct( array $config ) { |
22 | 25 | parent::__construct( $config ); |
23 | 26 | $this->containerPaths = (array)$config['containerPaths']; |
— | — | @@ -30,6 +33,9 @@ |
31 | 34 | : 0644; |
32 | 35 | } |
33 | 36 | |
| 37 | + /** |
| 38 | + * @see FileBackend::resolveContainerPath() |
| 39 | + */ |
34 | 40 | protected function resolveContainerPath( $container, $relStoragePath ) { |
35 | 41 | // Get absolute path given the container base dir |
36 | 42 | if ( isset( $this->containerPaths[$container] ) ) { |
— | — | @@ -38,6 +44,9 @@ |
39 | 45 | return null; |
40 | 46 | } |
41 | 47 | |
| 48 | + /** |
| 49 | + * @see FileBackend::doStore() |
| 50 | + */ |
42 | 51 | protected function doStore( array $params ) { |
43 | 52 | $status = Status::newGood(); |
44 | 53 | |
— | — | @@ -79,6 +88,9 @@ |
80 | 89 | return $status; |
81 | 90 | } |
82 | 91 | |
| 92 | + /** |
| 93 | + * @see FileBackend::doCopy() |
| 94 | + */ |
83 | 95 | protected function doCopy( array $params ) { |
84 | 96 | $status = Status::newGood(); |
85 | 97 | |
— | — | @@ -127,6 +139,9 @@ |
128 | 140 | return $status; |
129 | 141 | } |
130 | 142 | |
| 143 | + /** |
| 144 | + * @see FileBackend::doMove() |
| 145 | + */ |
131 | 146 | protected function doMove( array $params ) { |
132 | 147 | $status = Status::newGood(); |
133 | 148 | |
— | — | @@ -176,6 +191,9 @@ |
177 | 192 | return $status; |
178 | 193 | } |
179 | 194 | |
| 195 | + /** |
| 196 | + * @see FileBackend::doDelete() |
| 197 | + */ |
180 | 198 | protected function doDelete( array $params ) { |
181 | 199 | $status = Status::newGood(); |
182 | 200 | |
— | — | @@ -203,6 +221,9 @@ |
204 | 222 | return $status; |
205 | 223 | } |
206 | 224 | |
| 225 | + /** |
| 226 | + * @see FileBackend::doConcatenate() |
| 227 | + */ |
207 | 228 | protected function doConcatenate( array $params ) { |
208 | 229 | $status = Status::newGood(); |
209 | 230 | |
— | — | @@ -301,6 +322,9 @@ |
302 | 323 | return $status; |
303 | 324 | } |
304 | 325 | |
| 326 | + /** |
| 327 | + * @see FileBackend::doCreate() |
| 328 | + */ |
305 | 329 | protected function doCreate( array $params ) { |
306 | 330 | $status = Status::newGood(); |
307 | 331 | |
— | — | @@ -343,6 +367,9 @@ |
344 | 368 | return $status; |
345 | 369 | } |
346 | 370 | |
| 371 | + /** |
| 372 | + * @see FileBackend::prepare() |
| 373 | + */ |
347 | 374 | function prepare( array $params ) { |
348 | 375 | $status = Status::newGood(); |
349 | 376 | list( $c, $dir ) = $this->resolveStoragePath( $params['dir'] ); |
— | — | @@ -363,6 +390,9 @@ |
364 | 391 | return $status; |
365 | 392 | } |
366 | 393 | |
| 394 | + /** |
| 395 | + * @see FileBackend::secure() |
| 396 | + */ |
367 | 397 | function secure( array $params ) { |
368 | 398 | $status = Status::newGood(); |
369 | 399 | list( $c, $dir ) = $this->resolveStoragePath( $params['dir'] ); |
— | — | @@ -397,6 +427,9 @@ |
398 | 428 | return $status; |
399 | 429 | } |
400 | 430 | |
| 431 | + /** |
| 432 | + * @see FileBackend::clean() |
| 433 | + */ |
401 | 434 | function clean( array $params ) { |
402 | 435 | $status = Status::newGood(); |
403 | 436 | list( $c, $dir ) = $this->resolveStoragePath( $params['dir'] ); |
— | — | @@ -412,6 +445,9 @@ |
413 | 446 | return $status; |
414 | 447 | } |
415 | 448 | |
| 449 | + /** |
| 450 | + * @see FileBackend::fileExists() |
| 451 | + */ |
416 | 452 | function fileExists( array $params ) { |
417 | 453 | list( $c, $source ) = $this->resolveStoragePath( $params['src'] ); |
418 | 454 | if ( $source === null ) { |
— | — | @@ -423,6 +459,9 @@ |
424 | 460 | return $exists; |
425 | 461 | } |
426 | 462 | |
| 463 | + /** |
| 464 | + * @see FileBackend::getFileTimestamp() |
| 465 | + */ |
427 | 466 | function getFileTimestamp( array $params ) { |
428 | 467 | list( $c, $source ) = $this->resolveStoragePath( $params['src'] ); |
429 | 468 | if ( $source === null ) { |
— | — | @@ -432,6 +471,9 @@ |
433 | 472 | return $fsFile->getTimestamp(); |
434 | 473 | } |
435 | 474 | |
| 475 | + /** |
| 476 | + * @see FileBackend::getFileList() |
| 477 | + */ |
436 | 478 | function getFileList( array $params ) { |
437 | 479 | list( $c, $dir ) = $this->resolveStoragePath( $params['dir'] ); |
438 | 480 | if ( $dir === null ) { // invalid storage path |
— | — | @@ -452,6 +494,9 @@ |
453 | 495 | return new FSFileIterator( $dir ); |
454 | 496 | } |
455 | 497 | |
| 498 | + /** |
| 499 | + * @see FileBackend::getLocalReference() |
| 500 | + */ |
456 | 501 | function getLocalReference( array $params ) { |
457 | 502 | list( $c, $source ) = $this->resolveStoragePath( $params['src'] ); |
458 | 503 | if ( $source === null ) { |
— | — | @@ -460,6 +505,9 @@ |
461 | 506 | return new FSFile( $source ); |
462 | 507 | } |
463 | 508 | |
| 509 | + /** |
| 510 | + * @see FileBackend::getLocalCopy() |
| 511 | + */ |
464 | 512 | function getLocalCopy( array $params ) { |
465 | 513 | list( $c, $source ) = $this->resolveStoragePath( $params['src'] ); |
466 | 514 | if ( $source === null ) { |
Index: branches/FileBackend/phase3/includes/filerepo/backend/FileBackend.php |
— | — | @@ -481,7 +481,7 @@ |
482 | 482 | * Create a file in the backend with the given contents. |
483 | 483 | * Do not call this function from places outside FileBackend and FileOp. |
484 | 484 | * $params include: |
485 | | - * contents : the raw file contents |
| 485 | + * content : the raw file contents |
486 | 486 | * dst : destination storage path |
487 | 487 | * overwriteDest : do nothing and pass if an identical file exists at destination |
488 | 488 | * |
— | — | @@ -499,18 +499,30 @@ |
500 | 500 | */ |
501 | 501 | abstract protected function doCreate( array $params ); |
502 | 502 | |
| 503 | + /** |
| 504 | + * @see FileBackendBase::prepare() |
| 505 | + */ |
503 | 506 | public function prepare( array $params ) { |
504 | 507 | return Status::newGood(); |
505 | 508 | } |
506 | 509 | |
| 510 | + /** |
| 511 | + * @see FileBackendBase::secure() |
| 512 | + */ |
507 | 513 | public function secure( array $params ) { |
508 | 514 | return Status::newGood(); |
509 | 515 | } |
510 | 516 | |
| 517 | + /** |
| 518 | + * @see FileBackendBase::clean() |
| 519 | + */ |
511 | 520 | public function clean( array $params ) { |
512 | 521 | return Status::newGood(); |
513 | 522 | } |
514 | 523 | |
| 524 | + /** |
| 525 | + * @see FileBackendBase::getFileSha1Base36() |
| 526 | + */ |
515 | 527 | public function getFileSha1Base36( array $params ) { |
516 | 528 | $path = $params['src']; |
517 | 529 | if ( isset( $this->cache[$path]['sha1'] ) ) { |
— | — | @@ -529,6 +541,9 @@ |
530 | 542 | } |
531 | 543 | } |
532 | 544 | |
| 545 | + /** |
| 546 | + * @see FileBackendBase::getFileProps() |
| 547 | + */ |
533 | 548 | public function getFileProps( array $params ) { |
534 | 549 | $fsFile = $this->getLocalReference( array( 'src' => $params['src'] ) ); |
535 | 550 | if ( !$fsFile ) { |
— | — | @@ -538,10 +553,16 @@ |
539 | 554 | } |
540 | 555 | } |
541 | 556 | |
| 557 | + /** |
| 558 | + * @see FileBackendBase::getLocalReference() |
| 559 | + */ |
542 | 560 | public function getLocalReference( array $params ) { |
543 | 561 | return $this->getLocalCopy( $params ); |
544 | 562 | } |
545 | 563 | |
| 564 | + /** |
| 565 | + * @see FileBackendBase::streamFile() |
| 566 | + */ |
546 | 567 | function streamFile( array $params ) { |
547 | 568 | $status = Status::newGood(); |
548 | 569 | |
— | — | @@ -611,6 +632,9 @@ |
612 | 633 | return $performOps; |
613 | 634 | } |
614 | 635 | |
| 636 | + /** |
| 637 | + * @see FileBackendBase::doOperations() |
| 638 | + */ |
615 | 639 | final public function doOperations( array $ops, array $opts = array() ) { |
616 | 640 | $status = Status::newGood(); |
617 | 641 | |