Skip to content

Commit d1f863b

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 <[email protected]>
1 parent d4cede3 commit d1f863b

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
@@ -75,9 +75,11 @@ protected function streamNode(Streamer $streamer, NcNode $node, string $rootPath
7575
}
7676
$streamer->addFileFromStream($resource, $filename, $node->getSize(), $node->getMTime());
7777
} elseif ($node instanceof NcFolder) {
78+
$this->logger->info('Creating new archive', ['filename' => $filename]);
7879
$streamer->addEmptyDir($filename);
7980
$content = $node->getDirectoryListing();
8081
foreach ($content as $subNode) {
82+
$this->logger->info('Adding new file', ['filename' => $filename, 'file' => $subNode->getPath()]);
8183
$this->streamNode($streamer, $subNode, $rootPath);
8284
}
8385
}
@@ -98,6 +100,8 @@ public function handleDownload(Request $request, Response $response): ?bool {
98100
return null;
99101
}
100102

103+
$this->logger->info('Going to create an archive for folder', ['path' => $request->getPath()]);
104+
101105
$query = $request->getQueryParameters();
102106

103107
// Get accept header - or if set overwrite with accept GET-param
@@ -166,9 +170,11 @@ public function handleDownload(Request $request, Response $response): ?bool {
166170
$streamer->sendHeaders($archiveName);
167171
// For full folder downloads we also add the folder itself to the archive
168172
if (empty($files)) {
173+
$this->logger->info('Creating new archive', ['archiveName' => $archiveName, 'path' => $request->getPath()]);
169174
$streamer->addEmptyDir($archiveName);
170175
}
171176
foreach ($content as $node) {
177+
$this->logger->info('Adding a new file in the archive', ['fileName' => $node->getPath(), 'path' => $request->getPath()]);
172178
$this->streamNode($streamer, $node, $rootPath);
173179
}
174180
$streamer->finalize();

0 commit comments

Comments
 (0)