r106627 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106626‎ | r106627 | r106628 >
Date:06:19, 19 December 2011
Author:aaron
Status:ok
Tags:
Comment:
Various comment fixes and tweaks
Modified paths:
  • /branches/FileBackend/phase3/includes/filerepo/backend/FSFileBackend.php (modified) (history)
  • /branches/FileBackend/phase3/includes/filerepo/backend/FileBackend.php (modified) (history)

Diff [purge]

Index: branches/FileBackend/phase3/includes/filerepo/backend/FSFileBackend.php
@@ -17,6 +17,9 @@
1818 protected $containerPaths = array();
1919 protected $fileMode; // file permission mode
2020
 21+ /**
 22+ * @see FileBackend::__construct()
 23+ */
2124 function __construct( array $config ) {
2225 parent::__construct( $config );
2326 $this->containerPaths = (array)$config['containerPaths'];
@@ -30,6 +33,9 @@
3134 : 0644;
3235 }
3336
 37+ /**
 38+ * @see FileBackend::resolveContainerPath()
 39+ */
3440 protected function resolveContainerPath( $container, $relStoragePath ) {
3541 // Get absolute path given the container base dir
3642 if ( isset( $this->containerPaths[$container] ) ) {
@@ -38,6 +44,9 @@
3945 return null;
4046 }
4147
 48+ /**
 49+ * @see FileBackend::doStore()
 50+ */
4251 protected function doStore( array $params ) {
4352 $status = Status::newGood();
4453
@@ -79,6 +88,9 @@
8089 return $status;
8190 }
8291
 92+ /**
 93+ * @see FileBackend::doCopy()
 94+ */
8395 protected function doCopy( array $params ) {
8496 $status = Status::newGood();
8597
@@ -127,6 +139,9 @@
128140 return $status;
129141 }
130142
 143+ /**
 144+ * @see FileBackend::doMove()
 145+ */
131146 protected function doMove( array $params ) {
132147 $status = Status::newGood();
133148
@@ -176,6 +191,9 @@
177192 return $status;
178193 }
179194
 195+ /**
 196+ * @see FileBackend::doDelete()
 197+ */
180198 protected function doDelete( array $params ) {
181199 $status = Status::newGood();
182200
@@ -203,6 +221,9 @@
204222 return $status;
205223 }
206224
 225+ /**
 226+ * @see FileBackend::doConcatenate()
 227+ */
207228 protected function doConcatenate( array $params ) {
208229 $status = Status::newGood();
209230
@@ -301,6 +322,9 @@
302323 return $status;
303324 }
304325
 326+ /**
 327+ * @see FileBackend::doCreate()
 328+ */
305329 protected function doCreate( array $params ) {
306330 $status = Status::newGood();
307331
@@ -343,6 +367,9 @@
344368 return $status;
345369 }
346370
 371+ /**
 372+ * @see FileBackend::prepare()
 373+ */
347374 function prepare( array $params ) {
348375 $status = Status::newGood();
349376 list( $c, $dir ) = $this->resolveStoragePath( $params['dir'] );
@@ -363,6 +390,9 @@
364391 return $status;
365392 }
366393
 394+ /**
 395+ * @see FileBackend::secure()
 396+ */
367397 function secure( array $params ) {
368398 $status = Status::newGood();
369399 list( $c, $dir ) = $this->resolveStoragePath( $params['dir'] );
@@ -397,6 +427,9 @@
398428 return $status;
399429 }
400430
 431+ /**
 432+ * @see FileBackend::clean()
 433+ */
401434 function clean( array $params ) {
402435 $status = Status::newGood();
403436 list( $c, $dir ) = $this->resolveStoragePath( $params['dir'] );
@@ -412,6 +445,9 @@
413446 return $status;
414447 }
415448
 449+ /**
 450+ * @see FileBackend::fileExists()
 451+ */
416452 function fileExists( array $params ) {
417453 list( $c, $source ) = $this->resolveStoragePath( $params['src'] );
418454 if ( $source === null ) {
@@ -423,6 +459,9 @@
424460 return $exists;
425461 }
426462
 463+ /**
 464+ * @see FileBackend::getFileTimestamp()
 465+ */
427466 function getFileTimestamp( array $params ) {
428467 list( $c, $source ) = $this->resolveStoragePath( $params['src'] );
429468 if ( $source === null ) {
@@ -432,6 +471,9 @@
433472 return $fsFile->getTimestamp();
434473 }
435474
 475+ /**
 476+ * @see FileBackend::getFileList()
 477+ */
436478 function getFileList( array $params ) {
437479 list( $c, $dir ) = $this->resolveStoragePath( $params['dir'] );
438480 if ( $dir === null ) { // invalid storage path
@@ -452,6 +494,9 @@
453495 return new FSFileIterator( $dir );
454496 }
455497
 498+ /**
 499+ * @see FileBackend::getLocalReference()
 500+ */
456501 function getLocalReference( array $params ) {
457502 list( $c, $source ) = $this->resolveStoragePath( $params['src'] );
458503 if ( $source === null ) {
@@ -460,6 +505,9 @@
461506 return new FSFile( $source );
462507 }
463508
 509+ /**
 510+ * @see FileBackend::getLocalCopy()
 511+ */
464512 function getLocalCopy( array $params ) {
465513 list( $c, $source ) = $this->resolveStoragePath( $params['src'] );
466514 if ( $source === null ) {
Index: branches/FileBackend/phase3/includes/filerepo/backend/FileBackend.php
@@ -481,7 +481,7 @@
482482 * Create a file in the backend with the given contents.
483483 * Do not call this function from places outside FileBackend and FileOp.
484484 * $params include:
485 - * contents : the raw file contents
 485+ * content : the raw file contents
486486 * dst : destination storage path
487487 * overwriteDest : do nothing and pass if an identical file exists at destination
488488 *
@@ -499,18 +499,30 @@
500500 */
501501 abstract protected function doCreate( array $params );
502502
 503+ /**
 504+ * @see FileBackendBase::prepare()
 505+ */
503506 public function prepare( array $params ) {
504507 return Status::newGood();
505508 }
506509
 510+ /**
 511+ * @see FileBackendBase::secure()
 512+ */
507513 public function secure( array $params ) {
508514 return Status::newGood();
509515 }
510516
 517+ /**
 518+ * @see FileBackendBase::clean()
 519+ */
511520 public function clean( array $params ) {
512521 return Status::newGood();
513522 }
514523
 524+ /**
 525+ * @see FileBackendBase::getFileSha1Base36()
 526+ */
515527 public function getFileSha1Base36( array $params ) {
516528 $path = $params['src'];
517529 if ( isset( $this->cache[$path]['sha1'] ) ) {
@@ -529,6 +541,9 @@
530542 }
531543 }
532544
 545+ /**
 546+ * @see FileBackendBase::getFileProps()
 547+ */
533548 public function getFileProps( array $params ) {
534549 $fsFile = $this->getLocalReference( array( 'src' => $params['src'] ) );
535550 if ( !$fsFile ) {
@@ -538,10 +553,16 @@
539554 }
540555 }
541556
 557+ /**
 558+ * @see FileBackendBase::getLocalReference()
 559+ */
542560 public function getLocalReference( array $params ) {
543561 return $this->getLocalCopy( $params );
544562 }
545563
 564+ /**
 565+ * @see FileBackendBase::streamFile()
 566+ */
546567 function streamFile( array $params ) {
547568 $status = Status::newGood();
548569
@@ -611,6 +632,9 @@
612633 return $performOps;
613634 }
614635
 636+ /**
 637+ * @see FileBackendBase::doOperations()
 638+ */
615639 final public function doOperations( array $ops, array $opts = array() ) {
616640 $status = Status::newGood();
617641

Status & tagging log