1 | <?php |
||
7 | class File extends AbstractResponse { |
||
8 | |||
9 | /** |
||
10 | * The name of the File from Response |
||
11 | * @var string |
||
12 | */ |
||
13 | protected $fileName; |
||
14 | |||
15 | /** |
||
16 | * File Path for response |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $destinationPath; |
||
20 | |||
21 | public function __construct($curlResponse, $curlRequest,$destination = null) { |
||
29 | |||
30 | /** |
||
31 | * Configure the Destination path to store the File response |
||
32 | * @param null $destination |
||
33 | */ |
||
34 | protected function setupDestination($destination = null){ |
||
43 | |||
44 | /** |
||
45 | * Extract the filename from the Headers, and store it in filename property |
||
46 | */ |
||
47 | protected function extractFileName(){ |
||
55 | |||
56 | /** |
||
57 | * Return the filename found in response |
||
58 | * @return mixed |
||
59 | */ |
||
60 | public function getFileName(){ |
||
63 | |||
64 | /** |
||
65 | * Write the downloaded file |
||
66 | */ |
||
67 | protected function writeFile(){ |
||
72 | |||
73 | /** |
||
74 | * Return the full File path, where Response was stored |
||
75 | * @return string |
||
76 | */ |
||
77 | public function file(){ |
||
80 | |||
81 | } |