PHPackages                             pitpit/faceboo - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. pitpit/faceboo

AbandonedArchivedLibrary[API Development](/categories/api)

pitpit/faceboo
==============

Integrate Facebook SDK into Symfony2 or Silex

1.0.x-dev(12y ago)145896[3 issues](https://github.com/pitpit/Faceboo/issues)MITPHPPHP &gt;=5.3.0

Since Jun 17Pushed 12y agoCompare

[ Source](https://github.com/pitpit/Faceboo)[ Packagist](https://packagist.org/packages/pitpit/faceboo)[ RSS](/packages/pitpit-faceboo/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Faceboo
=======

[](#faceboo)

Integrate Facebook SDK into Silex micro-framework (FacebookServiceProvider) or Symfony2 (FacebooBundle).

Provide several methods to do common tasks with Facebook.

- authentification
- permissions management
- fan-gate management

Installation
------------

[](#installation)

Add faceboo to your dependencies using composer:

```
php composer.phar require "pitpit/faceboo":"2.0.*@dev"

```

To use Faceboo with Silex &lt;= 1.0, please use:

```
php composer.phar require "pitpit/faceboo":"1.0.*@dev"

```

Parameters
----------

[](#parameters)

- app\_id: App ID
- secret: App Secret
- permissions: array of facebook [oAuth permissions](http://developers.facebook.com/docs/reference/api/permissions) needed for the app
- namespace: App namespace
- canvas: true if the app is called through facebook iframe
- proxy: to make facebook requests work behind non-transparent proxy
- timeout: ...
- connect\_timeout: ...
- protect: true|false, disable the redirection when accessing the server, in canvas mode

Usage
-----

[](#usage)

### Silex

[](#silex)

Register the namespace and the extension, in top of index.php:

```
$app->register(new Faceboo\Provider\FacebooServiceProvider(), array(
    'faceboo.app_id' => 'xxx',
    'faceboo.secret' => 'xxx'
));

```

> See above for a [complete list of avalaible parameters](#parameters).

Login and ask user for [Facebook oAuth permissions](http://developers.facebook.com/docs/reference/api/permissions):

```
$app['faceboo.permissions'] = array();

$app->match('/', function () use ($app) {

    if ($response = $app['faceboo']->auth()) return $response;

    //...
});

```

In canvas mode, protect your canvas app from direct access to the source server:

```
$app->before(function(Request $request) use ($app) {
    if ($response = $app['faceboo']->protect()) return $response;
});

* do not rely on it, it's based on HTTP_REFERER so it's not really secured

```

In a fan page tab, is the current user admin of the fan page :

```
$app->match('/', function () use ($app) {

    $isAdmin = $app['faceboo']->isFanPageAdmin();

    //...
}

* you need to define "secret" parameter

```

In a fan page tab, what is the fan page id :

```
$app->match('/', function () use ($app) {

    $pageId = $app['faceboo']->getFanPageId();

    //...
}

* you need to define "secret" parameter

```

In a fan page tab, does the current user like the fan page :

```
$app->match('/', function () use ($app) {

    $isFan = $app['faceboo']->isFan();

    //...
}

* you need to define "secret" parameter

```

Get the current facebook user id:

```
$app['faceboo']->getUser();

```

Call the Facebook api:

```
$data =  $app['faceboo']->api('/me);

```

### Symfony2

[](#symfony2)

Register the bundle in app/AppKernel.php:

```
    $bundles = array(
        //...
        new Faceboo\FacebooBundle\FacebooFacebooBundle(),
    );

```

Add the following in app/config/config.yml:

```
faceboo:
    app_id: 297720976910223
    secret: b151a27351e91dab2ee18986d8c47052

```

> See above for a [complete list of avalaible parameters](#parameters).

Login and ask user for permissions if needed:

```
public function indexAction()
{
    if ($response = $this->get('faceboo')->auth()) return $response;

    //...
}

```

TODO
----

[](#todo)

- developp permissions authorization on website mode
- get rid of SilexEvent dependency to make it work with Symfony
- In canvas mode, override UrlGenerator to have the canvas URL when generate() is called with $absolute = true
- fan page
    - does the user like the fan page ?
    - route according to local

[![Bitdeli Badge](https://camo.githubusercontent.com/5e2a08e003c19daa4c1dc332d27978683b26e8fe9cbee5762c33b1b84bb81c1d/68747470733a2f2f64327765637a68766c38323376302e636c6f756466726f6e742e6e65742f7069747069742f66616365626f6f2f7472656e642e706e67)](https://bitdeli.com/free "Bitdeli Badge")

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 70.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4718d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0097d294b2f26fb737d68e1dd37c954870bce0db01b61fad25caae641fe29f54?d=identicon)[emgiezet](/maintainers/emgiezet)

![](https://www.gravatar.com/avatar/f8abf06489ebaa309c525e136ffa1ad463682ccd7addff0e7199d903132735a5?d=identicon)[pitpit](/maintainers/pitpit)

---

Top Contributors

[![pitpit](https://avatars.githubusercontent.com/u/283481?v=4)](https://github.com/pitpit "pitpit (45 commits)")[![emgiezet](https://avatars.githubusercontent.com/u/1410665?v=4)](https://github.com/emgiezet "emgiezet (17 commits)")[![bitdeli-chef](https://avatars.githubusercontent.com/u/3092978?v=4)](https://github.com/bitdeli-chef "bitdeli-chef (1 commits)")[![dmouse](https://avatars.githubusercontent.com/u/198571?v=4)](https://github.com/dmouse "dmouse (1 commits)")

### Embed Badge

![Health badge](/badges/pitpit-faceboo/health.svg)

```
[![Health](https://phpackages.com/badges/pitpit-faceboo/health.svg)](https://phpackages.com/packages/pitpit-faceboo)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[phpdocumentor/phpdocumentor

Documentation Generator for PHP

4.4k3.1M878](/packages/phpdocumentor-phpdocumentor)[overblog/graphiql-bundle

Symfony GraphiQLBundle makes possible to render the UI into your symfony project

766.0M24](/packages/overblog-graphiql-bundle)[harmbandstra/swagger-ui-bundle

Exposes swagger UI inside your Symfony project through a route (eg. /docs)

42867.3k](/packages/harmbandstra-swagger-ui-bundle)[sourcebroker/t3api

REST API for your TYPO3 project. Config with annotations, build in filtering, pagination, typolinks, image processing, serialization contexts, responses in Hydra/JSON-LD format.

3880.8k4](/packages/sourcebroker-t3api)[ezsystems/ezplatform-rest

eZ Platform REST bundle

11446.5k20](/packages/ezsystems-ezplatform-rest)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
