ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
XSendFileResponseBuilder.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
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(
48  self::X_SENDFILE_HEADER,
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 }
$response
Definition: xapitoken.php:93
buildForStream(ServerRequestInterface $request, ResponseInterface $response, FileStream $stream,)
The base interface for all filesystem streams.
Definition: FileStream.php:31