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: docs/getting_started.md
+1-51Lines changed: 1 addition & 51 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,24 +2,14 @@
2
2
3
3
Whether you're developing a website with Facebook login, creating a Facebook Canvas app or Page tab, the Facebook SDK for PHP does all the heavy lifting for you making it as easy as possible to deeply integrate into the Facebook platform.
4
4
5
-
## Autoloading & namespaces
6
-
7
-
The Facebook SDK for PHP v5 is coded in compliance with [PSR-4](http://www.php-fig.org/psr/psr-4/). This means it relies heavily on namespaces so that class files can be loaded for you automatically.
8
-
9
-
It would be advantageous to familiarize yourself with the concepts of [namespacing](http://php.net/manual/en/language.namespaces.rationale.php) and [autoloading](http://php.net/manual/en/function.spl-autoload-register.php) if you are not already acquainted with them.
10
-
11
5
## System requirements
12
6
13
7
- PHP 5.6 or greater
14
8
-[Composer](https://getcomposer.org/)
15
9
16
10
## Installing the Facebook SDK for PHP
17
11
18
-
There are two methods to install the Facebook SDK for PHP. The recommended installation method is by using [Composer](#installing-with-composer-recommended). If are unable to use Composer for your project, you can still [install the SDK manually](#manually-installing-if-you-really-have-to) by downloading the source files and including the autoloader.
19
-
20
-
## Installing with Composer (recommended)
21
-
22
-
[Composer](https://getcomposer.org/) is the recommended way to install the Facebook SDK for PHP. Simply run the following in the root of your project.
12
+
The Facebook SDK for PHP is installed with [Composer](#installing-with-composer-recommended). Simply run the following in the root of your project.
23
13
24
14
```
25
15
composer require facebook/graph-sdk
@@ -36,46 +26,6 @@ Make sure to include the Composer autoloader at the top of your script.
36
26
require_once __DIR__ . '/vendor/autoload.php';
37
27
```
38
28
39
-
## Manually installing (if you really have to)
40
-
41
-
First, download the source code and unzip it wherever you like in your project.
42
-
43
-
[Download the SDK for PHP v5.0](https://github.com/facebook/php-graph-sdk/archive/5.4.zip)
44
-
45
-
Then include the autoloader provided in the SDK at the top of your script.
The autoloader should be able to auto-detect the proper location of the source code.
52
-
53
-
54
-
### Keeping things tidy
55
-
56
-
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.
57
-
58
-
> For this example we'll assume the root of your website is `/var/html`.
59
-
60
-
After downloading the source code with the button above, extract the files in a temporary directory.
61
-
62
-
Move the folder `src/Facebook` to the root of your website installation or where ever you like to put third-party code. For this example we'll rename the `Facebook` directory to `facebook-sdk-v5`.
63
-
64
-
The path the the core SDK files should now be located in `/var/html/facebook-sdk-v5` and inside will also be the `autoload.php` file.
65
-
66
-
Assuming we have a script called `index.php` in the root of our web project, we need to include the autoloader at the top of our script.
If the autoloader is having trouble detecting the path to the source files, we can define the location of the source code before the `require_once` statement.
> **Warning:** This assumes you have already created and configured a Facebook App, which you can obtain from the [App Dashboard](https://developers.facebook.com/apps).
0 commit comments