Index: branches/FileBackend/phase3/includes/filerepo/backend/FileBackend.php |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | * Base class for all file backend classes (including multi-write backends). |
10 | 10 | * This class defines the methods as abstract that must be implemented subclasses. |
11 | 11 | * |
12 | | - * All "storage paths" are of the format "mwstore://container/path". |
| 12 | + * All "storage paths" are of the format "mwstore://backend/container/path". |
13 | 13 | * The paths use typical file system notation, though any particular backend may |
14 | 14 | * not actually be using a local filesystem. Therefore, the paths are only virtual. |
15 | 15 | * |
— | — | @@ -362,12 +362,14 @@ |
363 | 363 | */ |
364 | 364 | final protected function resolveVirtualPath( $storagePath ) { |
365 | 365 | if ( strpos( $storagePath, 'mwstore://' ) === 0 ) { |
366 | | - $m = explode( '/', substr( $storagePath, 10 ), 2 ); |
367 | | - if ( count( $m ) == 2 ) { |
368 | | - list( $container, $relPath ) = $m; |
369 | | - $relPath = $this->resolveContainerPath( $container, $relPath ); |
370 | | - if ( $relPath !== null ) { |
371 | | - return array( $container, $relPath ); // (container, path) |
| 366 | + $m = explode( '/', substr( $storagePath, 10 ), 3 ); |
| 367 | + if ( count( $m ) == 3 ) { |
| 368 | + list( $backend, $container, $relPath ) = $m; |
| 369 | + if ( $backend === $this->name ) { // sanity |
| 370 | + $relPath = $this->resolveContainerPath( $container, $relPath ); |
| 371 | + if ( $relPath !== null ) { |
| 372 | + return array( $container, $relPath ); // (container, path) |
| 373 | + } |
372 | 374 | } |
373 | 375 | } |
374 | 376 | } |