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>
This commit is contained in:
Matthieu Gallien 2025-11-19 15:01:32 +01:00
parent 3aaa599f1c
commit fdc58b5d58
No known key found for this signature in database
GPG key ID: 7D0F74F05C22F553

View file

@ -78,9 +78,11 @@ class ZipFolderPlugin extends ServerPlugin {
}
$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 @@ class ZipFolderPlugin extends ServerPlugin {
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 @@ class ZipFolderPlugin extends ServerPlugin {
$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();