ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Archive.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types=1);
3 
4 namespace ZipStream\Option;
5 
6 final class Archive
7 {
12  private $comment = '';
22  private $largeFileSize = 20 * 1024 * 1024;
41  private $sendHttpHeaders = false;
47  private $httpHeaderCallback = 'header';
54  private $enableZip64 = true;
64  private $zeroHeader = false;
77  private $statFiles = true;
82  private $flushOutput = false;
93  private $contentDisposition = 'attachment';
100  private $contentType = 'application/x-zip';
104  private $deflateLevel = 6;
105 
109  private $outputStream;
110 
114  public function __construct()
115  {
116  $this->largeFileMethod = Method::STORE();
117  $this->outputStream = fopen('php://output', 'wb');
118  }
119 
120  public function getComment(): string
121  {
122  return $this->comment;
123  }
124 
125  public function setComment(string $comment): void
126  {
127  $this->comment = $comment;
128  }
129 
130  public function getLargeFileSize(): int
131  {
132  return $this->largeFileSize;
133  }
134 
135  public function setLargeFileSize(int $largeFileSize): void
136  {
137  $this->largeFileSize = $largeFileSize;
138  }
139 
140  public function getLargeFileMethod(): Method
141  {
142  return $this->largeFileMethod;
143  }
144 
146  {
147  $this->largeFileMethod = $largeFileMethod;
148  }
149 
150  public function isSendHttpHeaders(): bool
151  {
152  return $this->sendHttpHeaders;
153  }
154 
155  public function setSendHttpHeaders(bool $sendHttpHeaders): void
156  {
157  $this->sendHttpHeaders = $sendHttpHeaders;
158  }
159 
160  public function getHttpHeaderCallback(): Callable
161  {
163  }
164 
165  public function setHttpHeaderCallback(Callable $httpHeaderCallback): void
166  {
167  $this->httpHeaderCallback = $httpHeaderCallback;
168  }
169 
170  public function isEnableZip64(): bool
171  {
172  return $this->enableZip64;
173  }
174 
175  public function setEnableZip64(bool $enableZip64): void
176  {
177  $this->enableZip64 = $enableZip64;
178  }
179 
180  public function isZeroHeader(): bool
181  {
182  return $this->zeroHeader;
183  }
184 
185  public function setZeroHeader(bool $zeroHeader): void
186  {
187  $this->zeroHeader = $zeroHeader;
188  }
189 
190  public function isFlushOutput(): bool
191  {
192  return $this->flushOutput;
193  }
194 
195  public function setFlushOutput(bool $flushOutput): void
196  {
197  $this->flushOutput = $flushOutput;
198  }
199 
200  public function isStatFiles(): bool
201  {
202  return $this->statFiles;
203  }
204 
205  public function setStatFiles(bool $statFiles): void
206  {
207  $this->statFiles = $statFiles;
208  }
209 
210  public function getContentDisposition(): string
211  {
213  }
214 
215  public function setContentDisposition(string $contentDisposition): void
216  {
217  $this->contentDisposition = $contentDisposition;
218  }
219 
220  public function getContentType(): string
221  {
222  return $this->contentType;
223  }
224 
225  public function setContentType(string $contentType): void
226  {
227  $this->contentType = $contentType;
228  }
229 
233  public function getOutputStream()
234  {
235  return $this->outputStream;
236  }
237 
241  public function setOutputStream($outputStream): void
242  {
243  $this->outputStream = $outputStream;
244  }
245 
249  public function getDeflateLevel(): int
250  {
251  return $this->deflateLevel;
252  }
253 
257  public function setDeflateLevel(int $deflateLevel): void
258  {
259  $this->deflateLevel = $deflateLevel;
260  }
261 }
setContentType(string $contentType)
Definition: Archive.php:225
__construct()
Options constructor.
Definition: Archive.php:114
setEnableZip64(bool $enableZip64)
Definition: Archive.php:175
setDeflateLevel(int $deflateLevel)
Definition: Archive.php:257
setOutputStream($outputStream)
Definition: Archive.php:241
setLargeFileSize(int $largeFileSize)
Definition: Archive.php:135
setStatFiles(bool $statFiles)
Definition: Archive.php:205
setZeroHeader(bool $zeroHeader)
Definition: Archive.php:185
comment()
Definition: comment.php:2
setHttpHeaderCallback(Callable $httpHeaderCallback)
Definition: Archive.php:165
setSendHttpHeaders(bool $sendHttpHeaders)
Definition: Archive.php:155
setContentDisposition(string $contentDisposition)
Definition: Archive.php:215
setComment(string $comment)
Definition: Archive.php:125
setFlushOutput(bool $flushOutput)
Definition: Archive.php:195
setLargeFileMethod(Method $largeFileMethod)
Definition: Archive.php:145
Methods enum.
Definition: Method.php:15