'dst' => $archivePath,
// We may have 2+ identical files being deleted,
// all of which will map to the same destination file
- 'overwriteSame' => true
+ 'overwriteSame' => true // also see bug 31792
);
}
// This accounts for Swift and S3 restrictions while leaving room
// for things like '.xxx' (hex shard chars) or '.seg' (segments).
// Note that matching strings URL encode to the same string;
- // in Swift, the length resriction is *after* URL encoding.
+ // in Swift, the length restriction is *after* URL encoding.
return preg_match( '/^[a-z0-9][a-z0-9-_]{0,199}$/i', $container );
}
try {
$container = $this->getContainer( $fullCont );
- $files = $container->list_objects( $limit, $after, "{$dir}/" );
+ $prefix = ( $dir == '' ) ? null : "{$dir}/";
+ $files = $container->list_objects( $limit, $after, $prefix );
} catch ( NoSuchContainerException $e ) {
} catch ( NoSuchObjectException $e ) {
} catch ( InvalidResponseException $e ) {
return $this->conn;
}
+ /**
+ * @see FileBackend::doClearCache()
+ */
+ protected function doClearCache( array $paths = null ) {
+ $this->connContainers = array(); // clear container object cache
+ }
+
/**
* Get a Swift container object, possibly from process cache.
* Use $reCache if the file count or byte count is needed.
if ( substr( $this->dir, -1 ) === '/' ) {
$this->dir = substr( $this->dir, 0, -1 ); // remove trailing slash
}
- $this->suffixStart = strlen( $dir ) + 1; // size of "path/to/dir/"
+ if ( $this->dir == '' ) { // whole container
+ $this->suffixStart = 0;
+ } else { // dir within container
+ $this->suffixStart = strlen( $dir ) + 1; // size of "path/to/dir/"
+ }
}
public function current() {