You are here

function facebook_client in Simple FB Connect 7

Same name and namespace in other branches
  1. 8 simple_fb_connect.module \facebook_client()

Get the facebook client object for easy access.

Return value

Facebook Facebook Api object

1 call to facebook_client()
simple_fb_connect_login in ./simple_fb_connect.module
Page callback for the FB Connect URL.

File

./simple_fb_connect.module, line 241
Simple Facebook Login Module for Drupal Sites.

Code

function facebook_client() {
  static $fb = NULL;
  if (is_null($fb)) {
    if (simple_fb_connect_facebook_client_load_include()) {
      $init_params = array(
        'appId' => variable_get('simple_fb_connect_appid', ''),
        'secret' => variable_get('simple_fb_connect_skey', ''),
      );
      $fb = new Facebook($init_params);
    }
  }
  return $fb;
}