◆ __construct()
ILIAS\LegalDocuments\Consumer\BaseHTTPResponseBasedConsumer::__construct |
( |
Services |
$http, |
|
|
StorableResource |
$resource, |
|
|
StreamAccess |
$stream_access, |
|
|
FileNamePolicy |
$file_name_policy |
|
) |
| |
◆ getDisposition()
ILIAS\LegalDocuments\Consumer\BaseHTTPResponseBasedConsumer::getDisposition |
( |
| ) |
|
|
abstractprotected |
◆ run()
ILIAS\LegalDocuments\Consumer\BaseHTTPResponseBasedConsumer::run |
( |
| ) |
|
This runs the actual DeliveryConsumer.
E.g. a DownloadConsumer will pass the Stream of a Ressource to the HTTP-Service and download the file.
Implements ILIAS\LegalDocuments\Consumer\DeliveryConsumer.
Definition at line 54 of file BaseHTTPResponseBasedConsumer.php.
References ILIAS\LegalDocuments\Consumer\BaseHTTPResponseBasedConsumer\getDisposition().
56 $revision = $this->getRevision();
57 $filename_with_extension = $this->file_name ?? $revision->getInformation()->getTitle();
58 $extension = pathinfo($filename_with_extension, PATHINFO_EXTENSION);
59 $file_name_for_consumer = $this->file_name_policy->prepareFileNameForConsumer($filename_with_extension);
61 $mime_type = $this->file_name_policy->isValidExtension($extension)
62 ? $revision->getInformation()->getMimeType()
63 : self::NON_VALID_EXTENSION_MIME;
66 $revision = $this->stream_access->populateRevision($revision);
69 'attachment' => $this->delivery->attached(
70 $revision->maybeStreamResolver()?->getStream(),
71 $file_name_for_consumer,
74 'inline' => $this->delivery->inline(
75 $revision->maybeStreamResolver()?->getStream(),
76 $file_name_for_consumer,
◆ $delivery
StreamDelivery ILIAS\LegalDocuments\Consumer\BaseHTTPResponseBasedConsumer::$delivery |
|
private |
◆ $http
Services ILIAS\LegalDocuments\Consumer\BaseHTTPResponseBasedConsumer::$http |
|
private |
◆ NON_VALID_EXTENSION_MIME
The documentation for this class was generated from the following file: