8require_once(
'./Services/FileDelivery/interfaces/int.ilFileDeliveryType.php');
19 use HeaderBasedDeliveryHelper;
36 $this->httpService = $httpState;
45 return is_readable($path_to_file);
62 public function deliver($path_to_file, $file_marked_to_delete)
64 $delivery =
function () use ($path_to_file) {
65 $response = $this->httpService->response()
66 ->withHeader(self::X_SENDFILE, realpath($path_to_file));
67 $this->httpService->saveResponse(
$response);
68 $this->httpService->sendResponse();
71 if ($file_marked_to_delete) {
72 $this->sendFileUnbufferedUsingHeaders($delivery);
113 unlink($path_to_file);
An exception for terminatinating execution or to throw for unit testing.
const X_SENDFILE_TEMPORARY
__construct(GlobalHttpState $httpState)
PHP constructor.
prepare($path_to_file)
bool
handleFileDeletion($path_to_file)
bool
deliver($path_to_file, $file_marked_to_delete)
bool
doesFileExists($path_to_file)
@inheritDoc
supportsAttachmentDelivery()
bool
supportsInlineDelivery()
bool
Interface ilFileDeliveryType.
Interface GlobalHttpState.