From: Aaron Schulz Date: Tue, 12 Mar 2013 07:50:16 +0000 (-0700) Subject: [FileBackend] Suppress missing container errors with "ignoreMissingSource". X-Git-Tag: 1.31.0-rc.0~20381 X-Git-Url: http://git.cyclocoop.org/%22.%28%24lien.?a=commitdiff_plain;h=70eabe29c59a003e296fa9ee9ffbb157682e4755;p=lhc%2Fweb%2Fwiklou.git [FileBackend] Suppress missing container errors with "ignoreMissingSource". Change-Id: I2b9f4764c4938dcee61f17c31ed4d4b84fbfbcb2 --- diff --git a/includes/filebackend/SwiftFileBackend.php b/includes/filebackend/SwiftFileBackend.php index 6357b86312..0f3d97a310 100644 --- a/includes/filebackend/SwiftFileBackend.php +++ b/includes/filebackend/SwiftFileBackend.php @@ -411,7 +411,9 @@ class SwiftFileBackend extends FileBackendStore { $sContObj = $this->getContainer( $srcCont ); $dContObj = $this->getContainer( $dstCont ); } catch ( NoSuchContainerException $e ) { - $status->fatal( 'backend-fail-copy', $params['src'], $params['dst'] ); + if ( empty( $params['ignoreMissingSource'] ) || isset( $sContObj ) ) { + $status->fatal( 'backend-fail-copy', $params['src'], $params['dst'] ); + } return $status; } catch ( CloudFilesException $e ) { // some other exception? $this->handleException( $e, $status, __METHOD__, $params ); @@ -481,7 +483,9 @@ class SwiftFileBackend extends FileBackendStore { $sContObj = $this->getContainer( $srcCont ); $dContObj = $this->getContainer( $dstCont ); } catch ( NoSuchContainerException $e ) { - $status->fatal( 'backend-fail-move', $params['src'], $params['dst'] ); + if ( empty( $params['ignoreMissingSource'] ) || isset( $sContObj ) ) { + $status->fatal( 'backend-fail-move', $params['src'], $params['dst'] ); + } return $status; } catch ( CloudFilesException $e ) { // some other exception? $this->handleException( $e, $status, __METHOD__, $params ); @@ -557,7 +561,9 @@ class SwiftFileBackend extends FileBackendStore { } catch ( CDNNotEnabledException $e ) { // CDN not enabled; nothing to see here } catch ( NoSuchContainerException $e ) { - $status->fatal( 'backend-fail-delete', $params['src'] ); + if ( empty( $params['ignoreMissingSource'] ) ) { + $status->fatal( 'backend-fail-delete', $params['src'] ); + } } catch ( NoSuchObjectException $e ) { if ( empty( $params['ignoreMissingSource'] ) ) { $status->fatal( 'backend-fail-delete', $params['src'] );