Skip to content

Commit e1c0158

Browse files
committed
Update README.md
1 parent 141df23 commit e1c0158

1 file changed

Lines changed: 17 additions & 17 deletions

File tree

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ If you're not using PHP but still need a proxy for _html2canvas_, check out the
2424

2525
## Requirements
2626

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)
2929
1. cURL PHP extension to use the `CurlDriver`
3030
1. `allow_url_fopen` must be set to `1` on `php.ini` to use `StreamDriver`
3131

@@ -104,30 +104,30 @@ Method | Description
104104
`getMaxDownloadSize(): int` | Get the maximum allowed download size
105105
`setMaxRedirs(int $value): void` | Set the maximum number of HTTP redirects
106106
`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
109109
`setTimeout(int $value): void` | Set the connection timeout in seconds
110110
`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
113113
`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
115115
`setControlAllowHeaders(array $headers): void` | Set the list of allowed headers
116116
`setOptions(string $key, mixed $value): void` | Set generic options
117117
`getOptions([string $key]): mixed` | Get generic options
118118
`getOptionsUpdate(): int` | Returns an internal incremental counter used to determine whether driver options have changed
119119
`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)
123123
`setTemporary(string $path): void` | Set the temporary storage path or stream for downloaded content (e.g., `/mnt/storage/`, `php://temp`, `php://memory`).
124124
`getTemporary(): resource\|null` | Get the temporary stream resource used for downloaded content
125125
`download(string $url): void` | Perform the download
126126
`setResponseCacheTime(int $seconds): void` | Set the cache duration (in seconds) or disable cache for `Proxy::response()` or `Proxy::jsonp()`
127127
`response(): void` | Dump response to output
128128
`jsonp(string $callback): void` | Output JSONP callback with URL or data URI content
129129
`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
131131
`getHttpStatus(): int\|null` | If last download was successful, HTTP status will be returned
132132
`reset(): void` | Reset last download
133133

@@ -182,11 +182,11 @@ $proxy->setOptions('stream', [
182182
]);
183183
```
184184

185-
## Content-Type allowed
185+
## `Content-Type` allowed
186186

187-
When executing the `download()` method, a Content-Type validation will be performed, by default the following Content-Types are allowed:
187+
When executing the `download()` method, a `Content-Type` validation will be performed, by default the following `Content-Type`s are allowed:
188188

189-
Content-Type | `Proxy::jsonp()`
189+
`Content-Type` | `Proxy::jsonp()`
190190
--- | ---
191191
`image/apng` | base64
192192
`image/png` | base64
@@ -206,7 +206,7 @@ $proxy->addAllowedType('image/vnd.microsoft.icon', true);
206206

207207
The method's second parameter specifies whether `Proxy::jsonp()` should use _URL encoding_ or _Base64_ encoding in the data URI scheme.
208208

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:
210210

211211
```php
212212
$proxy->removeAllowedType('image/apng');
@@ -233,7 +233,7 @@ $proxy->download($url);
233233
$proxy->response();
234234
```
235235

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:
237237

238238
```php
239239
use Inphinit\Proxy\Proxy;
@@ -259,7 +259,7 @@ try {
259259
}
260260
```
261261

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:
263263

264264
```php
265265
use Inphinit\Proxy\Proxy;

0 commit comments

Comments
 (0)