File tree Expand file tree Collapse file tree 6 files changed +11
-16
lines changed Expand file tree Collapse file tree 6 files changed +11
-16
lines changed Original file line number Diff line number Diff line change @@ -42,9 +42,6 @@ $proxy->setDrivers([
42
42
StreamDriver::class
43
43
]);
44
44
45
- // Set temporary location
46
- $proxy->setTemporary('php://temp');
47
-
48
45
// Execute download
49
46
$proxy->download($_GET['url']);
50
47
@@ -204,7 +201,6 @@ $proxy->setDrivers([
204
201
StreamDriver::class
205
202
]);
206
203
207
- $proxy->setTemporary('php://temp');
208
204
$proxy->download($url);
209
205
210
206
$proxy->response();
@@ -228,8 +224,6 @@ $proxy->setDrivers([
228
224
StreamDriver::class
229
225
]);
230
226
231
- $proxy->setTemporary('php://temp');
232
-
233
227
try {
234
228
$proxy->download($url);
235
229
$proxy->jsonp($_GET['callback']);
@@ -255,7 +249,6 @@ $proxy->setDrivers([
255
249
StreamDriver::class
256
250
]);
257
251
258
- $proxy->setTemporary('php://temp');
259
252
$proxy->download($url, true);
260
253
261
254
$errcode = $proxy->getLastErrorCode();
@@ -293,7 +286,6 @@ $proxy->urls([
293
286
'*://other.io/', // Allows HTTPS and HTTP requests to other.io
294
287
]);
295
288
296
- $proxy->setTemporary('php://temp');
297
289
$proxy->download($url);
298
290
```
299
291
Original file line number Diff line number Diff line change 66
66
StreamDriver::class
67
67
]);
68
68
69
- // Set temporary location
70
- $ proxy ->setTemporary ('php://temp ' );
71
-
72
69
// Use specific directory
73
70
// $proxy->setTemporary(__DIR__ . '/cache');
74
71
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- * Inphinit
3
+ * Inphinit Proxy
4
4
*
5
5
* Copyright (c) 2025 Guilherme Nascimento
6
6
*
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- * Inphinit
3
+ * Inphinit Proxy
4
4
*
5
5
* Copyright (c) 2025 Guilherme Nascimento
6
6
*
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- * Inphinit
3
+ * Inphinit Proxy
4
4
*
5
5
* Copyright (c) 2025 Guilherme Nascimento
6
6
*
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- * Inphinit
3
+ * Inphinit Proxy
4
4
*
5
5
* Copyright (c) 2025 Guilherme Nascimento
6
6
*
@@ -181,7 +181,13 @@ public function getTemporary()
181
181
public function download ($ url , $ ignoreDownloadError = false )
182
182
{
183
183
if ($ this ->temporary === null ) {
184
- $ this ->raise ('Temporary not defined, you need set Proxy::setTemporary() ' );
184
+ $ temporary = tmpfile ();
185
+
186
+ if ($ temporary ) {
187
+ $ this ->temporary = $ temporary ;
188
+ } else {
189
+ $ this ->raise ('Failed to open temporary file ' );
190
+ }
185
191
}
186
192
187
193
if ($ this ->validateUrl ($ url ) === false ) {
You can’t perform that action at this time.
0 commit comments