PHPackages                             emgiezet/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. emgiezet/faceboo

AbandonedLibrary

emgiezet/faceboo
================

Faceboo

095PHP

Since Oct 1Pushed 13y ago1 watchersCompare

[ Source](https://github.com/emgiezet/Faceboo)[ Packagist](https://packagist.org/packages/emgiezet/faceboo)[ RSS](/packages/emgiezet-faceboo/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)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)

Composer

- modify your composer.json

    ```
    {
      "repositories": {
          "faceboo": {
              "type": "package",
              "package": {
                  "name": "faceboo",
                  "version": "1.0",
                  "source": {
                      "url": "https://github.com/pitpit/Faceboo.git",
                      "type": "git",
                      "reference": "master"
                  }
              }
          }
      },
      "require": { ... }
      }

    ```
- Then add to your require section in composer.json following line

    ```
    "require": {
        "faceboo": "1.*"
    }

    ```
- Finally update your composer:

    ```
    $php composer.phar update

    ```

Get the sources:

```
cd vendor
git clone https://github.com/dpitard/Faceboo.git faceboo
cd faceboo
git submodule update --init

```

Parameters
----------

[](#parameters)

- app\_id: you app id
- secret: your app secret
- permissions: array of facebook permissions needed to access the app
    -
- namespace: your app namespace
- canvas: true if your app work under a 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
- class\_path (silex only): define another path to reach Facebook PHP SDK

Usage
-----

[](#usage)

### Silex

[](#silex)

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

```
$app['autoloader']->registerNamespace('Faceboo', __DIR__.'/../vendor/faceboo/src');

$app->register(new Faceboo\Provider\FacebookServiceProvider(), array(
    'facebook.app_id' => 'YOUR_APP_ID'
));

```

The parameters are formated as : facebook.

Login and ask user for permissions if needed:

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

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

    if ($response = $app['facebook']->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['facebook']->protect()) return $response;
});

* do not rely on it for security, it's based on HTTP_REFERER so it's not safe

```

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

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

    $isAdmin = $app['facebook']->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['facebook']->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['facebook']->isFan();

    //...
}

* you need to define "secret" parameter

```

Get the current facebook user id:

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

```

Call the Facebook api:

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

```

### Symfony2

[](#symfony2)

Register the autoload in app/autoload.php:

```
$loader->registerNamespaces(array(
    //...
    'Faceboo'        => __DIR__.'/../vendor/faceboo/src'
));

//...

require_once __DIR__.'/../. /vendor/php-sdk/src/facebook.php';

```

Register the bundle in app/AppKernel.php:

```
    $bundles = array(
        //...
        new Faceboo\FacebookBundle\FacebooFacebookBundle(),
    );

```

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

```
faceboo_facebook:
    app_id: 297720976910223
    secret: b151a27351e91dab2ee18986d8c47052

```

Parameters:

- facebook.app\_id: you app id
- facebook.secret: your app secret
- facebook.permissions: array of facebook permissions needed to access the app
    -
- facebook.namespace: your app namespace
- facebook.canvas: true if your app work under a facebook iframe
- facebook.proxy: to make facebook requests work behind non-transparent proxy
- facebook.timeout
- facebook.connect\_timeout
- facebook.protect: true|false, disable the redirection when accessing the server, in canvas mode
- facebook.class\_path: define another path to reach Facebook PHP SDK

Login and ask user for permissions if needed:

```
public function indexAction()
{
    if ($response = $this->get('facebook')->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

Changelog
---------

[](#changelog)

- added symfony support
- app\_id and secret are now mandatory
- updated to last version of Silex
- updated parameter prefix (now "facebook")

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63.8% 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.

### Community

Maintainers

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

---

Top Contributors

[![pitpit](https://avatars.githubusercontent.com/u/283481?v=4)](https://github.com/pitpit "pitpit (30 commits)")[![emgiezet](https://avatars.githubusercontent.com/u/1410665?v=4)](https://github.com/emgiezet "emgiezet (17 commits)")

### Embed Badge

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

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

PHPackages © 2026

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