Skip to content

Commit 639fb31

Browse files
mgallienbackportbot[bot]
authored andcommitted
chore(logs): add more logs into zip folder archive WebDAV plug-in
should enable better understanding of what happen Signed-off-by: Matthieu Gallien <[email protected]>
1 parent c0f0bf9 commit 639fb31

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
@@ -169,9 +173,11 @@ public function handleDownload(Request $request, Response $response): ?bool {
169173
$streamer->sendHeaders($archiveName);
170174
// For full folder downloads we also add the folder itself to the archive
171175
if (empty($files)) {
176+
$this->logger->info('Creating new archive', ['archiveName' => $archiveName, 'path' => $request->getPath()]);
172177
$streamer->addEmptyDir($archiveName);
173178
}
174179
foreach ($content as $node) {
180+
$this->logger->info('Adding a new file in the archive', ['fileName' => $node->getPath(), 'path' => $request->getPath()]);
175181
$this->streamNode($streamer, $node, $rootPath);
176182
}
177183
$streamer->finalize();

0 commit comments

Comments
 (0)