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
{{ message }}
This repository was archived by the owner on Jan 13, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,10 @@ Starting with version 5, the Facebook PHP SDK follows [SemVer](http://semver.org
11
11
- Replace custom CSPRNG implementation with `paragonie/random_compat` (#644)
12
12
- Removed the built-in autoloader in favor of composer's autoloader (#646)
13
13
- Big integers in signed requests get decoded as `string` instead of `float` (#699)
14
+
- We use an HTTP client abstraction called HTTPlug to give the user more control over *how* to send PSR7 messages. See updated installation instructions.
15
+
- Removed option `http_client_handler`
16
+
- Added option `http_client` which should be an object implementing `\Http\Client\HttpClient`
17
+
- Removed functions `FacebookClient::setHttpClientHandler()` and `FacebookClient::getHttpClientHandler()` in favor for `FacebookClient::getHttpClient()` and `FacebookClient::setHttpClient()`.
Why the extra packages? We give you the flexibility to choose what HTTP client (e.g. cURL or Guzzle) to use and what PSR-7 implementation you prefer. Read more about this at the [HTTPlug documentation](http://php-http.readthedocs.io/en/latest/httplug/users.html).
Partial file uploads are possible using the `$maxLength` and `$offset` parameters which provide the same functionality as the `$maxlen` and `$offset` parameters on the [`stream_get_contents()` PHP function](http://php.net/stream_get_contents).
26
26
27
+
> **Warning:** Uploading videos may cause a timeout. Make sure to configure your HTTP client to increase timeout time before uploading videos.
28
+
27
29
## Usage
28
30
29
31
In Graph v2.3, functionality was added to [upload video files in chunks](https://developers.facebook.com/docs/graph-api/video-uploads#resumable). The PHP SDK provides a handy API to easily upload video files in chunks via the [`uploadVideo()` method](Facebook.md#uploadvideo).
@@ -128,13 +128,16 @@ public function __construct(array $config = [])
128
128
if (!$config['app_secret']) {
129
129
thrownewFacebookSDKException('Required "app_secret" key not supplied in config and could not find fallback environment variable "' . static::APP_SECRET_ENV_NAME . '"');
130
130
}
131
+
if ($config['http_client'] !== null && !$config['http_client'] instanceof HttpClient) {
132
+
thrownew \InvalidArgumentException('Required "http_client" key to be null or an instance of \Http\Client\HttpClient');
133
+
}
131
134
if (!$config['default_graph_version']) {
132
135
thrownew \InvalidArgumentException('Required "default_graph_version" key not supplied in config');
0 commit comments