From a649103e398f3079ed7aa9379a92b6f8c3e1b56d Mon Sep 17 00:00:00 2001 From: Philipp Kamps Date: Mon, 20 May 2019 08:10:19 -0400 Subject: [PATCH] Implementation for function "filePurge" --- .../clusterfilehandlers/ezdfsfilehandler.php | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/kernel/private/classes/clusterfilehandlers/ezdfsfilehandler.php b/kernel/private/classes/clusterfilehandlers/ezdfsfilehandler.php index daea24b49cc..8f4e3143c14 100644 --- a/kernel/private/classes/clusterfilehandlers/ezdfsfilehandler.php +++ b/kernel/private/classes/clusterfilehandlers/ezdfsfilehandler.php @@ -1023,6 +1023,28 @@ public function fileDelete( $path, $fnamePart = false ) } } + /** + * @param string $path + * @return bool|eZMySQLBackendError + */ + public function filePurge( $path ) + { + $path = self::cleanPath( $path ); + $return = self::$dbbackend->_purge( $path ); + + // Remove local copies + if ( is_file( $path ) ) + { + @unlink( $path ); + } + elseif ( is_dir( $path ) ) + { + eZDir::recursiveDelete( $path ); + } + + return $return; + } + /** * Deletes specified file/directory. *