Skip to content
This repository was archived by the owner on Jan 13, 2022. It is now read-only.

Commit 62ba2c9

Browse files
authored
Merge branch '5.x' into patch-1
2 parents f85ffc2 + 6d1eb5a commit 62ba2c9

File tree

9 files changed

+7
-39
lines changed

9 files changed

+7
-39
lines changed

CHANGELOG.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
Starting with version 5, the Facebook PHP SDK follows [SemVer](http://semver.org/).
44

5-
65
## 5.x
76

87
Version 5 of the Facebook PHP SDK is a complete refactor of version 4. It comes loaded with lots of new features and a friendlier API.
@@ -87,12 +86,10 @@ Version 5 of the Facebook PHP SDK is a complete refactor of version 4. It comes
8786
- Added `ext-mbstring` to composer require
8887
- Added this CHANGELOG. Hi! :)
8988

90-
9189
## 4.1-dev
9290

9391
Since the Facebook PHP SDK didn't follow SemVer in version 4.x, the master branch was going to be released as 4.1. However, the SDK switched to SemVer in v5.0. So any references on the internet to version 4.1 can be assumed to be an alias to version `5.0.0`
9492

95-
9693
## 4.0.x
9794

9895
Version 4.0 of the Facebook PHP SDK did not follow [SemVer](http://semver.org/). The versioning format used was as follows: `4.MAJOR.(MINOR|PATCH)`. The `MINOR` and `PATCH` versions were squashed together.

CONTRIBUTING.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ The v5 (`5.x` branch) is maintained only for bug fixes, node/edge updates or doc
1414
## Code of Conduct
1515
The code of conduct is described in [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md)
1616

17-
1817
## Pull Requests
1918

2019
- **Sign the CLA** - For us to accept contributions you will have to first have signed the
@@ -38,14 +37,12 @@ The code of conduct is described in [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md)
3837

3938
- **Ensure no coding standards violations** - Please [run PHP Code Sniffer](#running-php-code-sniffer) using the PSR-2 standard before submitting your pull request. A violation will cause the build to fail, so please make sure there are no violations. We can't accept a patch if the build fails.
4039

41-
4240
## Running Tests
4341

4442
``` bash
4543
$ ./vendor/bin/phpunit
4644
```
4745

48-
4946
## Running PHP Code Sniffer
5047

5148
You can install [PHP Code Sniffer](https://github.com/squizlabs/PHP_CodeSniffer) globally with composer.

README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/facebook/facebook-php-sdk-v4/badges/quality-score.png?b=5.x)](https://scrutinizer-ci.com/g/facebook/facebook-php-sdk-v4/?branch=5.x)
55
[![Latest Stable Version](http://img.shields.io/badge/Latest%20Stable-5.6.2-blue.svg)](https://packagist.org/packages/facebook/graph-sdk)
66

7-
87
This repository contains the open source PHP SDK that allows you to access the Facebook Platform from your PHP app.
98

10-
119
## Installation
1210

1311
The Facebook PHP SDK can be installed with [Composer](https://getcomposer.org/). Run this command:
@@ -16,13 +14,12 @@ The Facebook PHP SDK can be installed with [Composer](https://getcomposer.org/).
1614
composer require facebook/graph-sdk
1715
```
1816

19-
Please be aware, that there are issues when using the Facebook SDK together with [Guzzle](https://github.com/guzzle/guzzle) 6.x. php-graph-sdk v5.x only works with Guzzle 5.x out of the box. However, [there is a workaround to make it work with Guzzle 6.x](https://www.sammyk.me/how-to-inject-your-own-http-client-in-the-facebook-php-sdk-v5#writing-a-guzzle-6-http-client-implementation-from-scratch).
17+
Please be aware, that there are issues when using the Facebook SDK together with [Guzzle](https://github.com/guzzle/guzzle) 6.x. php-graph-sdk v5.x only works with Guzzle 5.x out of the box. However, [there is a workaround to make it work with Guzzle 6.x](https://www.sammyk.me/how-to-inject-your-own-http-client-in-the-facebook-php-sdk-v5#writing-a-guzzle-6-http-client-implementation-from-scratch).
2018

2119
## Upgrading to v5.x
2220

2321
Upgrading from v4.x? Facebook PHP SDK v5.x introduced breaking changes. Please [read the upgrade guide](https://www.sammyk.me/upgrading-the-facebook-php-sdk-from-v4-to-v5) before upgrading.
2422

25-
2623
## Usage
2724

2825
> **Note:** This version of the Facebook SDK for PHP requires PHP 5.4 or greater.
@@ -65,7 +62,6 @@ echo 'Logged in as ' . $me->getName();
6562

6663
Complete documentation, installation instructions, and examples are available [here](docs/).
6764

68-
6965
## Tests
7066

7167
1. [Composer](https://getcomposer.org/) is a prerequisite for running the tests. Install composer globally, then run `composer install` to install required files.
@@ -82,17 +78,14 @@ By default the tests will send live HTTP requests to the Graph API. If you are w
8278
$ ./vendor/bin/phpunit --exclude-group integration
8379
```
8480

85-
8681
## Contributing
8782

8883
For us to accept contributions you will have to first have signed the [Contributor License Agreement](https://developers.facebook.com/opensource/cla). Please see [CONTRIBUTING](https://github.com/facebook/php-graph-sdk/blob/master/CONTRIBUTING.md) for details.
8984

90-
9185
## License
9286

9387
Please see the [license file](https://github.com/facebook/php-graph-sdk/blob/master/LICENSE) for more information.
9488

95-
9689
## Security Vulnerabilities
9790

9891
If you have found a security issue, please contact the maintainers directly at [[email protected]](mailto:[email protected]).

docs/getting_started.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ composer require facebook/graph-sdk
2727

2828
> The Facebook SDK starting adhering to [SemVer](http://semver.org/) with version 5. Previous to version 5, the SDK did not follow SemVer.
2929
30-
3130
Once you do this, composer will edit your `composer.json` file and download the latest version of the SDK and put it in the `/vendor/` directory.
3231

3332
Make sure to include the Composer autoloader at the top of your script.
@@ -50,7 +49,6 @@ require_once __DIR__ . '/path/to/php-graph-sdk/src/Facebook/autoload.php';
5049

5150
The autoloader should be able to auto-detect the proper location of the source code.
5251

53-
5452
### Keeping things tidy
5553

5654
The source code includes myriad files that aren't necessary for use in a production environment. If you'd like to strip out everything except the core files, follow this example.
@@ -102,7 +100,6 @@ The SDK can be used to support logging a Facebook user into your site using Face
102100

103101
Most all request made to the Graph API require an access token. We can obtain user access tokens with the SDK using the [helper classes](reference.md).
104102

105-
106103
### Obtaining an access token from redirect
107104

108105
For most websites, you'll use the [`Facebook\Helpers\FacebookRedirectLoginHelper`](reference/FacebookRedirectLoginHelper.md) to generate a login URL with the `getLoginUrl()` method. The link will take the user to an app authorization screen and upon approval, will redirect them back to a URL that you specified. On the redirect callback page we can obtain the user access token as an [`AccessToken`](reference/AccessToken.md) entity.
@@ -148,7 +145,6 @@ if (isset($accessToken)) {
148145
}
149146
```
150147

151-
152148
### Obtaining an access token from a Facebook Canvas context
153149

154150
If your app is on Facebook Canvas, use the `getAccessToken()` method on [`Facebook\Helpers\FacebookCanvasHelper`](reference/FacebookCanvasHelper.md) to get an [`AccessToken`](reference/AccessToken.md) entity for the user.
@@ -179,7 +175,6 @@ if (isset($accessToken)) {
179175

180176
> If your app exists within the context of a Page tab, you can obtain an access token using the example above since a Page tab is very similar to a Facebook Canvas app. But if you'd like to use a Page-tab-specific helper, you can use the [`Facebook\Helpers\FacebookPageTabHelper`](reference/FacebookPageTabHelper.md)
181177
182-
183178
### Obtaining an access token from the SDK for JavaScript
184179

185180
If you're already using the Facebook SDK for JavaScript to authenticate users, you can obtain the access token with PHP by using the [FacebookJavaScriptHelper](reference/FacebookJavaScriptHelper.md). The `getAccessToken()` method will return an [`AccessToken`](reference/AccessToken.md) entity.

docs/reference.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ These classes are used in a Graph API request/response cycle.
3434
| [`Facebook\FacebookBatchResponse`](reference/FacebookBatchResponse.md) | An entity that represents an HTTP response from Graph after sending a batch request. |
3535
| [`Facebook\FacebookClient`](reference/FacebookClient.md) | A service object that sends HTTP requests and receives HTTP responses to and from the Graph API. |
3636

37-
3837
# Signed Requests
3938

4039
Classes to help obtain and manage signed requests.
@@ -55,7 +54,6 @@ These are the core exceptions that the SDK will throw when an error occurs.
5554
| [`Facebook\Exceptions\FacebookSDKException`](reference/FacebookSDKException.md) | The base exception to all exceptions thrown by the SDK. Thrown when there is a non-Graph-response-related error. |
5655
| [`Facebook\Exceptions\FacebookResponseException`](reference/FacebookResponseException.md) | The base exception to all Graph error responses. This exception is never thrown directly. |
5756

58-
5957
# Graph Nodes and Edges
6058

6159
Graph nodes are collections that represent nodes returned by the Graph API. And Graph edges are a collection of nodes returned from an edge on the Graph API.
@@ -71,7 +69,6 @@ Graph nodes are collections that represent nodes returned by the Graph API. And
7169
| [`Facebook\GraphNodes\GraphPicture`](reference/GraphNode.md#graphpicture-instance-methods) | A collection that represents a Picture node. |
7270
| [`Facebook\GraphNodes\GraphUser`](reference/GraphNode.md#graphuser-instance-methods) | A collection that represents a User node. |
7371

74-
7572
# File Uploads
7673

7774
These are entities that represent files to be uploaded with a Graph request.

docs/reference/FacebookRedirectLoginHelper.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ The most commonly used helper is the `FacebookRedirectLoginHelper` which allows
66

77
Facebook Login is achieved via OAuth 2.0. But you don't really have to know much about OAuth 2.0 since the SDK for PHP does all the heavy lifting for you.
88

9-
109
### Obtaining an instance of FacebookRedirectLoginHelper
1110

1211
You can obtain an instance of the `FacebookRedirectLoginHelper` from the `getRedirectLoginHelper()` method on the `Facebook\Facebook` service.
@@ -116,19 +115,16 @@ If no authorization code could be found from the `code` param in the URL, this m
116115

117116
The `FacebookRedirectLoginHelper` has to orchestrate a number of components from the hosting environment to make the OAuth 2.0 authorization process as easy as possible to integrate. Out of the box it auto-detects all the things it needs, but sometimes you'll want to control these components.
118117

119-
120118
### Sessions (persistent data)
121119

122120
In order to prevent [CSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery)'s, a unique value is generated with each login link and stored in a session.
123121

124122
Most modern web frameworks have custom session handlers that allow you to manage your sessions with something other than the default flat-file storage. You can integrate your framework's custom session handling by coding to the [`PersistentDataInterface`](PersistentDataInterface.md).
125123

126-
127124
### CSPRNG
128125

129126
The CSRF value that the `getLoginUrl()`, `getReRequestUrl()`, and `getReAuthenticationUrl()` methods generate are all _cryptographically secure_ random strings. PHP's native support of CSPRNG's is spotty at best. The PHP SDK goes to great lengths to to detect a suitable CSPRNG but in rare cases, it might not find a suitable one. The [`PseudoRandomStringGeneratorInterface`](PseudoRandomStringGeneratorInterface.md) allows you to inject your own custom CSPRNG.
130127

131-
132128
### URL detection
133129

134130
In order to not make you pass the callback URL to the `getAccessToken()` method, the SDK will do its best to detect the callback's URL for you. Most modern web frameworks have URL detection built-in. You can code your specific web framework's URL detection logic by coding to the [`UrlDetectionInterface`](UrlDetectionInterface.md).

docs/reference/FacebookRequest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ You can instantiate a new `FacebookRequest` entity directly by sending the argum
99
```php
1010
use Facebook\FacebookRequest;
1111

12-
$request = new FacebookRequest(
12+
$request = new FacebookRequest(
1313
Facebook\FacebookApp $app,
1414
string $accessToken,
1515
string $method,

docs/reference/FacebookResponseException.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,23 @@ These exceptions are derived from the [error responses from the Graph API](https
3333
`FacebookResponseException` extends from the base `\Exception` class, so `getCode()` and `getMessage()` are available by default.
3434

3535
### getHttpStatusCode
36-
`getHttpStatusCode()`
36+
`getHttpStatusCode()`
3737
Returns the HTTP status code returned with this exception.
3838

3939
### getSubErrorCode
40-
`getSubErrorCode()`
40+
`getSubErrorCode()`
4141
Returns the numeric sub-error code returned from the Graph API.
4242

4343
### getErrorType
44-
`getErrorType()`
44+
`getErrorType()`
4545
Returns the type of error as a string.
4646

4747
### getResponseData
4848
`getResponseData()`
4949
Returns the decoded response body used to create the exception as an array.
5050

5151
### getRawResponse
52-
`getRawResponse()`
52+
`getRawResponse()`
5353
Returns the raw response body used to create the exception as a string.
5454

5555
### getResponse

docs/reference/GraphNode.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,29 +63,24 @@ $total = count($graphNode);
6363

6464
## GraphNode Instance Methods
6565

66-
6766
### asArray
68-
`asArray()`
67+
`asArray()`
6968
Returns the raw representation (associative arrays, nested) of the node's underlying data.
7069

71-
7270
### asJson
7371
`asJson()`
7472
Returns the data as a JSON string.
7573

76-
7774
### getField
7875
`getField(string $name, string $default = 'foo')`
7976
Gets the value from the field of a Graph node. If the value is a scalar (string, number, etc.) it will be returned. If it's an associative array, it will be returned as a GraphNode.
8077

8178
The second argument lets you define a default value to return if the field doesn't exist.
8279

83-
8480
### getFieldNames
8581
`getFieldNames()`
8682
Returns an array with the names of all fields present on the graph node.
8783

88-
8984
### map
9085
`map(Closure $callback)`
9186
Provides a way to map over the data within the collection just like `array_map()`.
@@ -180,7 +175,6 @@ The following properties on the `GraphPage` collection will get automatically ca
180175
| `global_brand_parent_page` | [`Facebook\GraphNodes\GraphPage`](graph#page-instance-methods) |
181176
| `location` | [`Facebook\GraphNodes\GraphLocation`](#graphlocation-instance-methods) |
182177

183-
184178
All getter methods return `null` if the property does not exist on the node.
185179

186180
### getId()
@@ -394,7 +388,6 @@ Returns the `id` property for the achievement as a string if present.
394388

395389
All getter methods return `null` if the property does not exist on the node.
396390

397-
398391
### getId()
399392
```php
400393
public string|null getId()

0 commit comments

Comments
 (0)