mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
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:
parent
3aaa599f1c
commit
fdc58b5d58
1 changed files with 6 additions and 0 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue