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

Commit 1007d86

Browse files
committed
Update the "Getting Started" docs to reflect Composer-install only for v6
1 parent e3fabe6 commit 1007d86

File tree

1 file changed

+1
-51
lines changed

1 file changed

+1
-51
lines changed

docs/getting_started.md

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,14 @@
22

33
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.
44

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-
115
## System requirements
126

137
- PHP 5.6 or greater
148
- [Composer](https://getcomposer.org/)
159

1610
## Installing the Facebook SDK for PHP
1711

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.
2313

2414
```
2515
composer require facebook/graph-sdk
@@ -36,46 +26,6 @@ Make sure to include the Composer autoloader at the top of your script.
3626
require_once __DIR__ . '/vendor/autoload.php';
3727
```
3828

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.
46-
47-
```php
48-
require_once __DIR__ . '/path/to/php-graph-sdk/src/Facebook/autoload.php';
49-
```
50-
51-
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.
67-
68-
```php
69-
require_once __DIR__ . '/facebook-sdk-v5/autoload.php';
70-
```
71-
72-
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.
73-
74-
```php
75-
define('FACEBOOK_SDK_V4_SRC_DIR', __DIR__ . '/facebook-sdk-v5/');
76-
require_once __DIR__ . '/facebook-sdk-v5/autoload.php';
77-
```
78-
7929
## Configuration and setup
8030

8131
> **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

Comments
 (0)