19declare(strict_types=1);
49 public function run(): void
54 $temp = tempnam($directory,
'zip');
55 $zip = new \ZipArchive();
56 $zip->open($temp, \ZipArchive::CREATE | \ZipArchive::OVERWRITE);
59 $revision = $this->stream_access->populateRevision($resource->getCurrentRevision());
60 if ($this->use_revision_titles) {
61 $file_name = $this->file_name_policy->prepareFileNameForConsumer($revision->getTitle());
63 $file_name = $this->file_name_policy->prepareFileNameForConsumer(
64 $revision->getInformation()->getTitle()
68 $zip->addFile($revision->maybeStreamResolver()->getStream()->getMetadata(
'uri'), $file_name);
80 . $this->zip_file_name
83 $fopen = fopen($temp,
'rb');
86 $DIC->http()->sendResponse();
89 $DIC->http()->close();
107 $this->zip_file_name = $file_name;
Stream factory which enables the user to create streams without the knowledge of the concrete class.
static ofResource($resource)
Wraps an already created resource with the stream abstraction.
Class ResourceCollection.
overrideFileName(string $file_name)
__construct(protected array $resources, private StreamAccess $stream_access, protected FileNamePolicy $file_name_policy, protected string $zip_file_name)
bool $use_revision_titles
ResourceCollection $collection
setRevisionNumber(int $revision_number)
run()
This runs the actual DeliveryConsumer.
useRevisionTitlesForFileNames(bool $use_revision_titles)
Interface DeliveryConsumer.
Interface FileNamePolicy.
Interface StorageResource.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...