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
* Added finer control over general usage settings.
* Enhanced usage descriptions for better clarity.
* Implemented various performance optimizations for increased efficiency.
* Introduced a maximum download size limit to improve stability.
* StreamDriver: Resolved issues with HTTP status code detection.
`setResponseCacheTime(int $seconds): void` | Enable or disable cache for `Proxy::respose()` or `Proxy::jsonp()`
96
107
`response(): void` | Dump response to output
97
108
`jsonp(string $callback): void` | Output JSONP callback with URL or data URI content
98
109
`getContents([int $length[, int $offset]]): string` | If last download was successful, contents will be returned
99
-
`getContentType(): string` | If last download was successful, content-type will be returned
110
+
`getContentType(): string` | If last download was successful, Content-Type will be returned
100
111
`getHttpStatus(): int` | If last download was successful, HTTP status will be returned
101
-
`getLastErrorCode(): int` | If last download was failed, error code will be returned
102
-
`getLastErrorMessage(): string` | If last download was failed, error message will be returned
112
+
`getErrorCode(): int` | If last download was failed, error code will be returned
113
+
`getErrorMessage(): string` | If last download was failed, error message will be returned
103
114
`reset(): void` | Reset last download
104
115
105
116
## Generic options
106
117
118
+
Generic options are primarily used for driver configurations. Since each driver may require different types of settings, the most flexible approach is to allow these options to store any value. This is particularly useful when developing a new driver. Existing options include:
119
+
107
120
Usage | Description
108
121
--- | ---
109
-
`setOptions('max_redirs', int $value)` | Set the redirect limit
110
-
`setOptions('timeout', int $value)` | Set timeout for connections
111
-
`setOptions('user_agent', string $value)` | Set Browser User-Agent
112
-
`setOptions('referer', string $value)` | Set request header contains the absolute or partial address from which a resource has been requested
113
122
`setOptions('curl', array $value)` | Options for `CurlDriver`. See: https://www.php.net/manual/en/curl.constants.php
114
123
`setOptions('stream', array $value)` | Options for `StreamDriver`. See: https://www.php.net/manual/en/context.php
You can define another allowed content-type, example:
182
+
You can define another allowed Content-Type, example:
174
183
175
184
```php
176
185
$proxy->addAllowedType('image/x-icon', true);
@@ -231,39 +240,35 @@ try {
231
240
}
232
241
```
233
242
234
-
If you need to handle content or errors manually, you can use the `Proxy::getContents`, `Proxy::getContentType`, `Proxy::getHttpStatus`, `Proxy::getLastErrorCode`, `Proxy::getLastErrorMessage` methods:
243
+
If you need to handle content, you can use the `Proxy::getContents`, `Proxy::getContentType`, `Proxy::getHttpStatus` methods:
0 commit comments