ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
XSendFileResponseBuilder.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use Psr\Http\Message\ResponseInterface;
25use Psr\Http\Message\ServerRequestInterface;
26
31{
35 private const X_SENDFILE_HEADER = 'X-Sendfile';
36
37 public function getName(): string
38 {
39 return 'xsendfile';
40 }
41
42 public function buildForStream(
43 ServerRequestInterface $request,
44 ResponseInterface $response,
45 FileStream $stream,
46 ): ResponseInterface {
47 return $response->withHeader(
49 $stream->getMetadata('uri')
50 );
51 }
52
53 public function supportPartial(): bool
54 {
55 return true;
56 }
57
58 public function supportStreaming(): bool
59 {
60 return true;
61 }
62
63 public function supportFileDeletion(): bool
64 {
65 return false;
66 }
67
68 public function supportsInlineDelivery(): bool
69 {
70 return true;
71 }
72
73 public function supportsAttachmentDelivery(): bool
74 {
75 return true;
76 }
77}
buildForStream(ServerRequestInterface $request, ResponseInterface $response, FileStream $stream,)
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
The base interface for all filesystem streams.
Definition: FileStream.php:32
$response
Definition: xapitoken.php:93