Skip to content

Commit 11f8b59

Browse files
committed
chore(logs): add more logs into zip folder archive WebDAV plug-in
should enable better understanding of what happen Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
1 parent b8bda08 commit 11f8b59

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

apps/dav/lib/Connector/Sabre/ZipFolderPlugin.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,11 @@ protected function streamNode(Streamer $streamer, NcNode $node, string $rootPath
7878
}
7979
$streamer->addFileFromStream($resource, $filename, $node->getSize(), $mtime);
8080
} elseif ($node instanceof NcFolder) {
81+
$this->logger->info('Creating new archive', ['filename' => $filename]);
8182
$streamer->addEmptyDir($filename, $mtime);
8283
$content = $node->getDirectoryListing();
8384
foreach ($content as $subNode) {
85+
$this->logger->info('Adding new file', ['filename' => $filename, 'file' => $subNode->getPath()]);
8486
$this->streamNode($streamer, $subNode, $rootPath);
8587
}
8688
}
@@ -101,6 +103,8 @@ public function handleDownload(Request $request, Response $response): ?bool {
101103
return null;
102104
}
103105

106+
$this->logger->info('Going to create an archive for folder', ['path' => $request->getPath()]);
107+
104108
$query = $request->getQueryParameters();
105109

106110
// Get accept header - or if set overwrite with accept GET-param
@@ -173,9 +177,11 @@ public function handleDownload(Request $request, Response $response): ?bool {
173177
$streamer->sendHeaders($archiveName);
174178
// For full folder downloads we also add the folder itself to the archive
175179
if (empty($files)) {
180+
$this->logger->info('Creating new archive', ['archiveName' => $archiveName, 'path' => $request->getPath()]);
176181
$streamer->addEmptyDir($archiveName);
177182
}
178183
foreach ($content as $node) {
184+
$this->logger->info('Adding a new file in the archive', ['fileName' => $node->getPath(), 'path' => $request->getPath()]);
179185
$this->streamNode($streamer, $node, $rootPath);
180186
}
181187
$streamer->finalize();

0 commit comments

Comments
 (0)