ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\FileDelivery\Delivery\LegacyDelivery Class Reference
+ Inheritance diagram for ILIAS\FileDelivery\Delivery\LegacyDelivery:
+ Collaboration diagram for ILIAS\FileDelivery\Delivery\LegacyDelivery:

Public Member Functions

 attached (string $path_to_file, ?string $download_file_name=null, ?string $mime_type=null, ?bool $delete_file=false)
 
 inline (string $path_to_file, ?string $download_file_name=null, ?string $mime_type=null, ?bool $delete_file=false)
 
- Public Member Functions inherited from ILIAS\FileDelivery\Delivery\BaseDelivery
 __construct (protected Services $http, protected ResponseBuilder $response_builder, protected ResponseBuilder $fallback_response_builder,)
 

Private Member Functions

 deliver (string $path_to_file, Disposition $disposition, ?string $download_file_name=null, ?string $mime_type=null, ?bool $delete_file=false)
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS\FileDelivery\Delivery\BaseDelivery
 saveAndClose (ResponseInterface $r, ?string $path_to_delete=null)
 
 setGeneralHeaders (ResponseInterface $r, string $uri, string $mime_type, string $file_name, Disposition $disposition=Disposition::INLINE)
 
- Protected Attributes inherited from ILIAS\FileDelivery\Delivery\BaseDelivery
const MIME_TYPE_MAP = __DIR__ . '/../../../FileUpload/src/mime_type_map.php'
 
array $mime_type_map
 

Detailed Description

Author
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

Definition at line 28 of file LegacyDelivery.php.

Member Function Documentation

◆ attached()

ILIAS\FileDelivery\Delivery\LegacyDelivery::attached ( string  $path_to_file,
?string  $download_file_name = null,
?string  $mime_type = null,
?bool  $delete_file = false 
)

Definition at line 30 of file LegacyDelivery.php.

35 : never {
36 $this->deliver(
38 Disposition::ATTACHMENT,
42 );
43 }
deliver(string $path_to_file, Disposition $disposition, ?string $download_file_name=null, ?string $mime_type=null, ?bool $delete_file=false)

◆ deliver()

ILIAS\FileDelivery\Delivery\LegacyDelivery::deliver ( string  $path_to_file,
Disposition  $disposition,
?string  $download_file_name = null,
?string  $mime_type = null,
?bool  $delete_file = false 
)
private

Definition at line 60 of file LegacyDelivery.php.

66 : never {
67 $r = $this->setGeneralHeaders(
68 $this->http->response(),
70 $mime_type ?? mime_content_type($path_to_file),
73 );
74 $r = $this->response_builder->buildForStream(
75 $this->http->request(),
76 $r,
78 );
79 $this->saveAndClose($r, $delete_file ? $path_to_file : null);
80 }
setGeneralHeaders(ResponseInterface $r, string $uri, string $mime_type, string $file_name, Disposition $disposition=Disposition::INLINE)
saveAndClose(ResponseInterface $r, ?string $path_to_delete=null)
static ofResource($resource)
Wraps an already created resource with the stream abstraction.
Definition: Streams.php:64
static http()
Fetches the global http state from ILIAS.

◆ inline()

ILIAS\FileDelivery\Delivery\LegacyDelivery::inline ( string  $path_to_file,
?string  $download_file_name = null,
?string  $mime_type = null,
?bool  $delete_file = false 
)

Definition at line 45 of file LegacyDelivery.php.

50 : never {
51 $this->deliver(
53 Disposition::INLINE,
57 );
58 }

References ILIAS\FileDelivery\Delivery\$delete_file, ILIAS\FileDelivery\Delivery\$download_file_name, ILIAS\FileDelivery\Delivery\$mime_type, and ILIAS\FileDelivery\Delivery\deliver().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: