1 | <?php |
||
7 | class ChunkFile |
||
8 | { |
||
9 | /** |
||
10 | * TMPFILE_EXTENSION. |
||
11 | * |
||
12 | * @var string |
||
13 | */ |
||
14 | const TMPFILE_EXTENSION = '.part'; |
||
15 | |||
16 | /** |
||
17 | * $files. |
||
18 | * |
||
19 | * @var \Recca0120\Upload\Filesystem |
||
20 | */ |
||
21 | protected $files; |
||
22 | |||
23 | /** |
||
24 | * $token. |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $token = null; |
||
29 | |||
30 | /** |
||
31 | * $chunkPath. |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $chunkPath = null; |
||
36 | |||
37 | /** |
||
38 | * $storagePath. |
||
39 | * |
||
40 | * @var string |
||
41 | */ |
||
42 | protected $storagePath = null; |
||
43 | |||
44 | /** |
||
45 | * $name. |
||
46 | * |
||
47 | * @var string |
||
48 | */ |
||
49 | protected $name = null; |
||
50 | |||
51 | /** |
||
52 | * $mimeType. |
||
53 | * |
||
54 | * @var string |
||
55 | */ |
||
56 | protected $mimeType = null; |
||
57 | |||
58 | /** |
||
59 | * $tmpfilename. |
||
60 | * |
||
61 | * @var string |
||
62 | */ |
||
63 | protected $tmpfilename = null; |
||
64 | |||
65 | /** |
||
66 | * __construct. |
||
67 | * |
||
68 | * @param \Recca0120\Upload\Filesystem $files |
||
69 | */ |
||
70 | 13 | public function __construct(Filesystem $files = null) |
|
74 | |||
75 | /** |
||
76 | * setToken. |
||
77 | * |
||
78 | * @param string $token |
||
79 | * @return $this |
||
80 | */ |
||
81 | 2 | public function setToken($token) |
|
87 | |||
88 | /** |
||
89 | * setChunkPath. |
||
90 | * |
||
91 | * @param string $chunkPath |
||
92 | * @return $this |
||
93 | */ |
||
94 | 2 | public function setChunkPath($chunkPath) |
|
100 | |||
101 | /** |
||
102 | * setStoragePath. |
||
103 | * |
||
104 | * @param string $storagePath |
||
105 | * @return $this |
||
106 | */ |
||
107 | 1 | public function setStoragePath($storagePath) |
|
113 | |||
114 | /** |
||
115 | * setName. |
||
116 | * |
||
117 | * @param string $name |
||
118 | * @return $this |
||
119 | */ |
||
120 | 2 | public function setName($name) |
|
121 | { |
||
122 | 2 | $this->name = $name; |
|
123 | |||
124 | 2 | return $this; |
|
125 | } |
||
126 | |||
127 | /** |
||
128 | * setMimeType. |
||
129 | * |
||
130 | * @param string $mimeType |
||
131 | * @return $this |
||
132 | */ |
||
133 | 1 | public function setMimeType($mimeType) |
|
139 | |||
140 | /** |
||
141 | * throwException. |
||
142 | * |
||
143 | * @param mixed $message |
||
144 | * @param array $headers |
||
145 | * @throws \Recca0120\Upload\Exceptions\ChunkedResponseException |
||
146 | */ |
||
147 | 2 | public function throwException($message = '', $headers = []) |
|
151 | |||
152 | /** |
||
153 | * appendStream. |
||
154 | * |
||
155 | * @param mixed $source |
||
156 | * @param int $offset |
||
157 | * @return $this |
||
158 | */ |
||
159 | 1 | public function appendStream($source, $offset = 0, $index = null) |
|
167 | |||
168 | /** |
||
169 | * createUploadedFile. |
||
170 | * |
||
171 | * @return \Illuminate\Http\UploadedFile |
||
172 | */ |
||
173 | 1 | public function createUploadedFile($chunks = null, $storageFile = null) |
|
195 | |||
196 | /** |
||
197 | * tmpfilename. |
||
198 | * |
||
199 | * @return string |
||
200 | */ |
||
201 | 2 | protected function tmpfilename() |
|
209 | |||
210 | /** |
||
211 | * chunkFile. |
||
212 | * |
||
213 | * @return string |
||
214 | */ |
||
215 | 2 | protected function chunkFile() |
|
219 | |||
220 | /** |
||
221 | * storageFile. |
||
222 | * |
||
223 | * @return string |
||
224 | */ |
||
225 | 1 | protected function storageFile() |
|
229 | } |
||
230 |