/** * @see FileBackend::doCopyInternal() */ function doCopyInternal(array $params) { $status = Status::newGood(); list($srcContainer, $srcDir) = $this->resolveStoragePath($params['src']); list($dstContainer, $dstDir) = $this->resolveStoragePath($params['dst']); if ($srcDir === null) { $status->fatal('backend-fail-invalidpath', $params['src']); return $status; } if ($dstDir === null) { $status->fatal('backend-fail-invalidpath', $params['dst']); return $status; } if (empty($params['overwrite'])) { //Blob should not be overridden if ($this->storageClient->blobExists($dstContainer, $dstDir)) { $status->fatal('backend-fail-alreadyexists', $params['dst']); return $status; } } try { $result = $this->storageClient->copyBlob($srcContainer, $srcDir, $dstContainer, $dstDir); } catch (Exception $e) { $status->fatal('backend-fail-copy', $e->getMessage()); } return $status; }
/** * @see FileBackend::doCopyInternal() */ function doCopyInternal( array $params ) { $status = Status::newGood(); list( $srcContainer, $srcDir ) = $this->resolveStoragePath( $params['src'] ); list( $dstContainer, $dstDir ) = $this->resolveStoragePath( $params['dst'] ); // TODO: check for null try { $result = $this->storageClient->copyBlob( $srcContainer, $srcDir, $dstContainer, $dstDir); } catch ( Exception $e ) { $status->fatal( 'backend-fail-copy', $e->getMessage() ); } return $status; }