Index: trunk/phase3/includes/filerepo/backend/SwiftFileBackend.php |
— | — | @@ -508,7 +508,8 @@ |
509 | 509 | |
510 | 510 | try { |
511 | 511 | $container = $this->getContainer( $fullCont ); |
512 | | - $files = $container->list_objects( $limit, $after, "{$dir}/" ); |
| 512 | + $prefix = ( $dir == '' ) ? null : "{$dir}/"; |
| 513 | + $files = $container->list_objects( $limit, $after, $prefix ); |
513 | 514 | } catch ( NoSuchContainerException $e ) { |
514 | 515 | } catch ( NoSuchObjectException $e ) { |
515 | 516 | } catch ( InvalidResponseException $e ) { |
— | — | @@ -686,6 +687,13 @@ |
687 | 688 | } |
688 | 689 | |
689 | 690 | /** |
| 691 | + * @see FileBackend::doClearCache() |
| 692 | + */ |
| 693 | + protected function doClearCache( array $paths = null ) { |
| 694 | + $this->connContainers = array(); // clear container object cache |
| 695 | + } |
| 696 | + |
| 697 | + /** |
690 | 698 | * Get a Swift container object, possibly from process cache. |
691 | 699 | * Use $reCache if the file count or byte count is needed. |
692 | 700 | * |
— | — | @@ -784,7 +792,11 @@ |
785 | 793 | if ( substr( $this->dir, -1 ) === '/' ) { |
786 | 794 | $this->dir = substr( $this->dir, 0, -1 ); // remove trailing slash |
787 | 795 | } |
788 | | - $this->suffixStart = strlen( $dir ) + 1; // size of "path/to/dir/" |
| 796 | + if ( $this->dir == '' ) { // whole container |
| 797 | + $this->suffixStart = 0; |
| 798 | + } else { // dir within container |
| 799 | + $this->suffixStart = strlen( $dir ) + 1; // size of "path/to/dir/" |
| 800 | + } |
789 | 801 | } |
790 | 802 | |
791 | 803 | public function current() { |
Index: trunk/phase3/includes/filerepo/backend/FileBackend.php |
— | — | @@ -1300,7 +1300,7 @@ |
1301 | 1301 | // This accounts for Swift and S3 restrictions while leaving room |
1302 | 1302 | // for things like '.xxx' (hex shard chars) or '.seg' (segments). |
1303 | 1303 | // Note that matching strings URL encode to the same string; |
1304 | | - // in Swift, the length resriction is *after* URL encoding. |
| 1304 | + // in Swift, the length restriction is *after* URL encoding. |
1305 | 1305 | return preg_match( '/^[a-z0-9][a-z0-9-_]{0,199}$/i', $container ); |
1306 | 1306 | } |
1307 | 1307 | |
Index: trunk/phase3/includes/filerepo/FileRepo.php |
— | — | @@ -1084,7 +1084,7 @@ |
1085 | 1085 | 'dst' => $archivePath, |
1086 | 1086 | // We may have 2+ identical files being deleted, |
1087 | 1087 | // all of which will map to the same destination file |
1088 | | - 'overwriteSame' => true |
| 1088 | + 'overwriteSame' => true // also see bug 31792 |
1089 | 1089 | ); |
1090 | 1090 | } |
1091 | 1091 | |