You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-17Lines changed: 17 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,8 +24,8 @@ If you're not using PHP but still need a proxy for _html2canvas_, check out the
24
24
25
25
## Requirements
26
26
27
-
1._PHP 8.4_ is highly recommended (https://www.php.net/supported-versions.php)
28
-
*Minimal: PHP 5.4 compatibility is retained for environments with upgrade constraints
27
+
1.Recommended: _PHP 8_ (see the currently supported versions at https://www.php.net/supported-versions.php)
28
+
*Minimum: _PHP 5.4_ (backward compatibility is preserved for environments with upgrade limitations)
29
29
1. cURL PHP extension to use the `CurlDriver`
30
30
1.`allow_url_fopen` must be set to `1` on `php.ini` to use `StreamDriver`
31
31
@@ -104,30 +104,30 @@ Method | Description
104
104
`getMaxDownloadSize(): int` | Get the maximum allowed download size
105
105
`setMaxRedirs(int $value): void` | Set the maximum number of HTTP redirects
106
106
`getMaxRedirs(): int` | Get the maximum number of HTTP redirects
107
-
`setReferer(string $value): void` | Set the Referer request header
108
-
`getReferer(): string` | Get the Referer request header
107
+
`setReferer(string $value): void` | Set the `Referer` request header
108
+
`getReferer(): string` | Get the `Referer` request header
109
109
`setTimeout(int $value): void` | Set the connection timeout in seconds
110
110
`getTimeout(): int` | Get the connection timeout in seconds
111
-
`setUserAgent(string $value): void` | Set the User-Agent request header
112
-
`getUserAgent(): string` | Get the User-Agent request header
111
+
`setUserAgent(string $value): void` | Set the `User-Agent` request header
112
+
`getUserAgent(): string` | Get the `User-Agent` request header
113
113
`setDrivers(array $drivers): void` | Set the list of driver class names used for downloading resources
114
-
`setControlAllowOrigin(string $origin): void` | Set the Access-Control-Allow-Origin header
114
+
`setControlAllowOrigin(string $origin): void` | Set the `Access-Control-Allow-Origin` header
115
115
`setControlAllowHeaders(array $headers): void` | Set the list of allowed headers
116
116
`setOptions(string $key, mixed $value): void` | Set generic options
117
117
`getOptions([string $key]): mixed` | Get generic options
118
118
`getOptionsUpdate(): int` | Returns an internal incremental counter used to determine whether driver options have changed
119
119
`setAllowedUrls(array $urls): void` | Set the list of allowed URLs for download
120
-
`addAllowedType(string $type, bool $binary): void` | Add a Content-Type to the allowed list, `true` = Base64 encoding, `false` = URL encoding
121
-
`removeAllowedType(string $type): void` | Remove a Content-Type from the allowed list
122
-
`isAllowedType(string $type, string &$errorMessage): bool` | Check if a given Content-Type is allowed (this method will be used by drivers)
120
+
`addAllowedType(string $type, bool $binary): void` | Add a `Content-Type` to the allowed list, `true` = Base64 encoding, `false` = URL encoding
121
+
`removeAllowedType(string $type): void` | Remove a `Content-Type` from the allowed list
122
+
`isAllowedType(string $type, string &$errorMessage): bool` | Check if a given `Content-Type` is allowed (this method will be used by drivers)
123
123
`setTemporary(string $path): void` | Set the temporary storage path or stream for downloaded content (e.g., `/mnt/storage/`, `php://temp`, `php://memory`).
124
124
`getTemporary(): resource\|null` | Get the temporary stream resource used for downloaded content
125
125
`download(string $url): void` | Perform the download
126
126
`setResponseCacheTime(int $seconds): void` | Set the cache duration (in seconds) or disable cache for `Proxy::response()` or `Proxy::jsonp()`
127
127
`response(): void` | Dump response to output
128
128
`jsonp(string $callback): void` | Output JSONP callback with URL or data URI content
129
129
`getContents([int $length[, int $offset]]): string\|null` | If last download was successful, contents will be returned
130
-
`getContentType(): string\|null` | If last download was successful, Content-Type will be returned
130
+
`getContentType(): string\|null` | If last download was successful, `Content-Type` will be returned
131
131
`getHttpStatus(): int\|null` | If last download was successful, HTTP status will be returned
The method's second parameter specifies whether `Proxy::jsonp()` should use _URL encoding_ or _Base64_ encoding in the data URI scheme.
208
208
209
-
To remove an allowed Content-Type use the `Proxy::removeAllowedType()` method, example:
209
+
To remove an allowed `Content-Type` use the `Proxy::removeAllowedType()` method, example:
210
210
211
211
```php
212
212
$proxy->removeAllowedType('image/apng');
@@ -233,7 +233,7 @@ $proxy->download($url);
233
233
$proxy->response();
234
234
```
235
235
236
-
If you want to use the JSONP format, replace the `Proxy::response` method with `Proxy::jsonp`. In this example, the callback will return and receive the content in _DATA URI_ format:
236
+
If you want to use the JSONP format, replace the `Proxy::response` method with `Proxy::jsonp()`. In this example, the callback will return and receive the content in _DATA URI_ format:
237
237
238
238
```php
239
239
use Inphinit\Proxy\Proxy;
@@ -259,7 +259,7 @@ try {
259
259
}
260
260
```
261
261
262
-
If you need to handle content, you can use the `Proxy::getContents`, `Proxy::getContentType`, `Proxy::getHttpStatus` methods:
262
+
If you need to handle content, you can use the `Proxy::getContents()`, `Proxy::getContentType()`, `Proxy::getHttpStatus()` methods:
0 commit comments