ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
XSendFileResponseBuilder.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
26 
31 {
32  private const X_SENDFILE_HEADER = 'X-Sendfile';
33 
34  public function getName(): string
35  {
36  return 'xsendfile';
37  }
38 
39  public function buildForStream(
40  ServerRequestInterface $request,
41  ResponseInterface $response,
42  FileStream $stream,
43  ): ResponseInterface {
44  return $response->withHeader(
45  self::X_SENDFILE_HEADER,
46  $stream->getMetadata('uri')
47  );
48  }
49 
50  public function supportPartial(): bool
51  {
52  return true;
53  }
54 
55  public function supportStreaming(): bool
56  {
57  return true;
58  }
59 
60  public function supportFileDeletion(): bool
61  {
62  return false;
63  }
64 
65  public function supportsInlineDelivery(): bool
66  {
67  return true;
68  }
69 
70  public function supportsAttachmentDelivery(): bool
71  {
72  return true;
73  }
74 }
$response
Definition: xapitoken.php:93
buildForStream(ServerRequestInterface $request, ResponseInterface $response, FileStream $stream,)
The base interface for all filesystem streams.
Definition: FileStream.php:31