[FLOW3-general] Inject Facebook-API-Object

Bernhard Marx bernhard.marx at marxdesign.de
Wed Nov 9 22:36:58 CET 2011


Hello,

 

how can I inject the php facebook-api in flow3?

 

Facebook has 2 phpfiles with classes.

 

require_once "base_facebook.php";

 

/**

* Extends the BaseFacebook class with the intent of using

* PHP sessions to store user ids and access tokens.

*/

class Facebook extends BaseFacebook

{

  /**

   * Identical to the parent constructor, except that

   * we start a PHP session to store the user ID and

   * access token if during the course of execution

   * we discover them.

   *

   * @param Array $config the application configuration.

   * @see BaseFacebook::__construct in facebook.php

   */

  public function __construct($config) {

    if (!session_id()) {

      session_start();

    }

    parent::__construct($config);

  }

...

 

This is how to initalise the object in "Plain Old PHP" ;-)

 

require_once("facebook.php");

 

  $config = array();

  $config['appId'] = 'YOUR_APP_ID';

  $config['secret'] = 'YOUR_APP_SECRET';

  $config['fileUpload'] = false; // optional

 

  $facebook = new Facebook($config);

 

Can I put the config values somewhere in the configuration?

 

Any help appreciated

 

Bernhard

 

 

 

 

 

 



More information about the FLOW3-general mailing list