}
// Resolve source to a storage path if virtual
- if ( self::isVirtualUrl( $srcPath ) ) {
- $srcPath = $this->resolveVirtualUrl( $srcPath );
- }
+ $srcPath = $this->resolveToStoragePath( $srcPath );
// Get the appropriate file operation
if ( FileBackend::isStoragePath( $srcPath ) ) {
$path = $this->getZonePath( $zone ) . "/$rel";
} else {
// Resolve source to a storage path if virtual
- if ( self::isVirtualUrl( $path ) ) {
- $path = $this->resolveVirtualUrl( $path );
- }
+ $path = $this->resolveToStoragePath( $path );
}
$operations[] = array( 'op' => 'delete', 'src' => $path );
}
foreach ( $triplets as $i => $triplet ) {
list( $srcPath, $dstRel, $archiveRel ) = $triplet;
// Resolve source to a storage path if virtual
- if ( $this->isVirtualUrl( $srcPath ) ) {
- $srcPath = $this->resolveVirtualUrl( $srcPath );
- }
+ $srcPath = $this->resolveToStoragePath( $srcPath );
if ( !$this->validateFilename( $dstRel ) ) {
throw new MWException( 'Validation error in $dstRel' );
}
public function fileExistsBatch( array $files ) {
$result = array();
foreach ( $files as $key => $file ) {
- if ( self::isVirtualUrl( $file ) ) {
- $file = $this->resolveVirtualUrl( $file );
- }
+ $file = $this->resolveToStoragePath( $file );
$result[$key] = $this->backend->fileExists( array( 'src' => $file ) );
}
return $result;