[FileBackend] Support "ignoreMissingSource" for copy and move operations.
[lhc/web/wiklou.git] / includes / filebackend / SwiftFileBackend.php
index 5dfad9e..8441f8f 100644 (file)
@@ -400,7 +400,9 @@ class SwiftFileBackend extends FileBackendStore {
                } catch ( CDNNotEnabledException $e ) {
                        // CDN not enabled; nothing to see here
                } catch ( NoSuchObjectException $e ) { // source object does not exist
-                       $status->fatal( 'backend-fail-copy', $params['src'], $params['dst'] );
+                       if ( empty( $params['ignoreMissingSource'] ) ) {
+                               $status->fatal( 'backend-fail-copy', $params['src'], $params['dst'] );
+                       }
                } catch ( CloudFilesException $e ) { // some other exception?
                        $this->handleException( $e, $status, __METHOD__, $params );
                }
@@ -471,7 +473,9 @@ class SwiftFileBackend extends FileBackendStore {
                } catch ( CDNNotEnabledException $e ) {
                        // CDN not enabled; nothing to see here
                } catch ( NoSuchObjectException $e ) { // source object does not exist
-                       $status->fatal( 'backend-fail-move', $params['src'], $params['dst'] );
+                       if ( empty( $params['ignoreMissingSource'] ) ) {
+                               $status->fatal( 'backend-fail-move', $params['src'], $params['dst'] );
+                       }
                } catch ( CloudFilesException $e ) { // some other exception?
                        $this->handleException( $e, $status, __METHOD__, $params );
                }