From fdc58b5d58274b7fbe2e928313d5a9e4e2dafc0c Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Wed, 19 Nov 2025 15:01:32 +0100 Subject: [PATCH] chore(logs): add more logs into zip folder archive WebDAV plug-in should enable better understanding of what happen Signed-off-by: Matthieu Gallien --- apps/dav/lib/Connector/Sabre/ZipFolderPlugin.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/dav/lib/Connector/Sabre/ZipFolderPlugin.php b/apps/dav/lib/Connector/Sabre/ZipFolderPlugin.php index 1807ce1604756..4e71bbc157838 100644 --- a/apps/dav/lib/Connector/Sabre/ZipFolderPlugin.php +++ b/apps/dav/lib/Connector/Sabre/ZipFolderPlugin.php @@ -78,9 +78,11 @@ protected function streamNode(Streamer $streamer, NcNode $node, string $rootPath } $streamer->addFileFromStream($resource, $filename, $node->getSize(), $mtime); } elseif ($node instanceof NcFolder) { + $this->logger->info('Creating new archive', ['filename' => $filename]); $streamer->addEmptyDir($filename, $mtime); $content = $node->getDirectoryListing(); foreach ($content as $subNode) { + $this->logger->info('Adding new file', ['filename' => $filename, 'file' => $subNode->getPath()]); $this->streamNode($streamer, $subNode, $rootPath); } } @@ -101,6 +103,8 @@ public function handleDownload(Request $request, Response $response): ?bool { return null; } + $this->logger->info('Going to create an archive for folder', ['path' => $request->getPath()]); + $query = $request->getQueryParameters(); // Get accept header - or if set overwrite with accept GET-param @@ -173,9 +177,11 @@ public function handleDownload(Request $request, Response $response): ?bool { $streamer->sendHeaders($archiveName); // For full folder downloads we also add the folder itself to the archive if (empty($files)) { + $this->logger->info('Creating new archive', ['archiveName' => $archiveName, 'path' => $request->getPath()]); $streamer->addEmptyDir($archiveName); } foreach ($content as $node) { + $this->logger->info('Adding a new file in the archive', ['fileName' => $node->getPath(), 'path' => $request->getPath()]); $this->streamNode($streamer, $node, $rootPath); } $streamer->finalize();