Index: trunk/phase3/tests/phpunit/includes/filerepo/FileBackendTest.php |
— | — | @@ -1223,6 +1223,15 @@ |
1224 | 1224 | |
1225 | 1225 | $this->assertEquals( $expected, $list, "Correct file listing ($backendName)." ); |
1226 | 1226 | |
| 1227 | + // Actual listing (using iterator second time) |
| 1228 | + $list = array(); |
| 1229 | + foreach ( $iter as $file ) { |
| 1230 | + $list[] = $file; |
| 1231 | + } |
| 1232 | + sort( $list ); |
| 1233 | + |
| 1234 | + $this->assertEquals( $expected, $list, "Correct file listing ($backendName), second iteration." ); |
| 1235 | + |
1227 | 1236 | foreach ( $files as $file ) { // clean up |
1228 | 1237 | $this->backend->doOperation( array( 'op' => 'delete', 'src' => $file ) ); |
1229 | 1238 | } |
Index: trunk/phase3/includes/filerepo/backend/FileBackend.php |
— | — | @@ -531,11 +531,14 @@ |
532 | 532 | |
533 | 533 | /** |
534 | 534 | * Get an iterator to list out all stored files under a storage directory. |
535 | | - * If the directory is of the form "mwstore://container", then all items in |
536 | | - * the container should be listed. If of the form "mwstore://container/dir", |
537 | | - * then all items under that container directory should be listed. |
| 535 | + * If the directory is of the form "mwstore://backend/container", |
| 536 | + * then all files in the container should be listed. |
| 537 | + * If the directory is of form "mwstore://backend/container/dir", |
| 538 | + * then all files under that container directory should be listed. |
538 | 539 | * Results should be storage paths relative to the given directory. |
539 | 540 | * |
| 541 | + * Storage backends with eventual consistency might return stale data. |
| 542 | + * |
540 | 543 | * $params include: |
541 | 544 | * dir : storage path directory |
542 | 545 | * |