Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
6 | public function __construct($filePath, $outputFilename) |
||
7 | { |
||
8 | if (!is_readable($filePath)) { |
||
9 | throw new \WebServCo\Framework\Exceptions\NotFoundException('File not found'); |
||
10 | } |
||
11 | |||
12 | parent::__construct( |
||
13 | null, // content |
||
14 | 200, // statusCode |
||
15 | [ |
||
16 | 'Content-Type' => 'application/octet-stream', |
||
17 | 'Content-Disposition' => sprintf( |
||
18 | 'attachment; filename=%s', |
||
19 | $outputFilename |
||
20 | ), |
||
21 | 'X-Sendfile' => $filePath, |
||
22 | ] // headers |
||
26 |