r108889 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108888‎ | r108889 | r108890 >
Date:01:52, 14 January 2012
Author:aaron
Status:ok
Tags:
Comment:
* Renamed ContainerShardListIterator -> FileBackendShardListIterator
* Renamed FSFileIterator -> FSFileBackendFileList
* Renamed SwiftFileIterator -> SwiftFileBackendFileList and added it to autoloader
* A few minor doc fixes
Modified paths:
  • /trunk/phase3/includes/AutoLoader.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/SwiftFileBackend.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/backend/FSFileBackend.php
@@ -417,7 +417,7 @@
418418 if ( !$readable ) {
419419 return null; // bad permissions?
420420 }
421 - return new FSFileIterator( $dir );
 421+ return new FSFileBackendFileList( $dir );
422422 }
423423
424424 /**
@@ -508,15 +508,13 @@
509509 *
510510 * @ingroup FileBackend
511511 */
512 -class FSFileIterator implements Iterator {
 512+class FSFileBackendFileList implements Iterator {
513513 /** @var RecursiveIteratorIterator */
514514 protected $iter;
515515 protected $suffixStart; // integer
516516
517517 /**
518 - * Get an FSFileIterator from a file system directory
519 - *
520 - * @param $dir string
 518+ * @param $dir string file system directory
521519 */
522520 public function __construct( $dir ) {
523521 $dir = realpath( $dir ); // normalize
Index: trunk/phase3/includes/filerepo/backend/SwiftFileBackend.php
@@ -454,11 +454,11 @@
455455 * @see FileBackend::getFileListInternal()
456456 */
457457 public function getFileListInternal( $fullCont, $dir, array $params ) {
458 - return new SwiftFileIterator( $this, $fullCont, $dir );
 458+ return new SwiftFileBackendFileList( $this, $fullCont, $dir );
459459 }
460460
461461 /**
462 - * Do not call this function outside of SwiftFileIterator
 462+ * Do not call this function outside of SwiftFileBackendFileList
463463 *
464464 * @param $fullCont string Resolved container name
465465 * @param $dir string Resolved storage directory with no trailing slash
@@ -653,7 +653,7 @@
654654 *
655655 * @ingroup FileBackend
656656 */
657 -class SwiftFileIterator implements Iterator {
 657+class SwiftFileBackendFileList implements Iterator {
658658 /** @var Array */
659659 protected $bufferIter = array();
660660 protected $bufferAfter = null; // string; list items *after* this path
@@ -668,11 +668,9 @@
669669 const PAGE_SIZE = 5000; // file listing buffer size
670670
671671 /**
672 - * Get an FSFileIterator from a file system directory
673 - *
674672 * @param $backend SwiftFileBackend
675673 * @param $fullCont string Resolved container name
676 - * @param $dir string Resolved relative directory
 674+ * @param $dir string Resolved directory relative to container
677675 */
678676 public function __construct( SwiftFileBackend $backend, $fullCont, $dir ) {
679677 $this->backend = $backend;
Index: trunk/phase3/includes/filerepo/backend/FileBackend.php
@@ -1052,7 +1052,7 @@
10531053 wfDebug( __METHOD__ . ": iterating over all container shards.\n" );
10541054 // File listing spans multiple containers/shards
10551055 list( $b, $shortCont, $r ) = self::splitStoragePath( $params['dir'] );
1056 - return new ContainerShardListIterator( $this,
 1056+ return new FileBackendShardListIterator( $this,
10571057 $fullCont, $this->getContainerSuffixes( $shortCont ), $params );
10581058 }
10591059 }
@@ -1431,7 +1431,7 @@
14321432 *
14331433 * @ingroup FileBackend
14341434 */
1435 -class ContainerShardListIterator implements Iterator {
 1435+class FileBackendShardListIterator implements Iterator {
14361436 /* @var FileBackend */
14371437 protected $backend;
14381438 /* @var Array */
Index: trunk/phase3/includes/AutoLoader.php
@@ -485,14 +485,15 @@
486486 'TempFSFile' => 'includes/filerepo/file/TempFSFile.php',
487487
488488 # includes/filerepo/backend
489 - 'ContainerShardListIterator' => 'includes/filerepo/backend/FileBackend.php',
490489 'FileBackendGroup' => 'includes/filerepo/backend/FileBackendGroup.php',
491490 'FileBackendBase' => 'includes/filerepo/backend/FileBackend.php',
492491 'FileBackend' => 'includes/filerepo/backend/FileBackend.php',
493492 'FileBackendMultiWrite' => 'includes/filerepo/backend/FileBackendMultiWrite.php',
 493+ 'FileBackendShardListIterator' => 'includes/filerepo/backend/FileBackend.php',
494494 'FSFileBackend' => 'includes/filerepo/backend/FSFileBackend.php',
 495+ 'FSFileBackendFileList' => 'includes/filerepo/backend/FSFileBackend.php',
495496 'SwiftFileBackend' => 'includes/filerepo/backend/SwiftFileBackend.php',
496 - 'FSFileIterator' => 'includes/filerepo/backend/FSFileBackend.php',
 497+ 'SwiftFileBackendFileList' => 'includes/filerepo/backend/SwiftFileBackend.php',
497498 'LockManagerGroup' => 'includes/filerepo/backend/lockmanager/LockManagerGroup.php',
498499 'LockManager' => 'includes/filerepo/backend/lockmanager/LockManager.php',
499500 'ScopedLock' => 'includes/filerepo/backend/lockmanager/LockManager.php',

Status & tagging log