function facebook_client in Facebook Connect 8.2
Same name and namespace in other branches
- 5 fbconnect.module \facebook_client()
- 6 fbconnect.module \facebook_client()
Get the Facebook client object for easy access.
Return value
Facebook Facebook Api object
15 calls to facebook_client()
- facebook_get_access_token in ./
fbconnect.module - Get the Facebook access token object for easy access.
- FbconnectTestCase::setUp in tests/
fbconnect.test - Implements setUp().
- fbconnect_fbapp_settings in ./
fbconnect.admin.inc - fbconnect_fbapp_settings_submit in ./
fbconnect.admin.inc - fbconnect_get_connected_friends in fbconnect_invite/
fbconnect_invite.module - Get facebook friend who has_added_app.
File
- ./
fbconnect.module, line 77 - @todo.
Code
function facebook_client() {
static $fb = NULL;
drupal_session_initialize();
if (is_null($fb)) {
$conf = fbconnect_get_config();
if ($conf && _facebook_client_load_include()) {
$initParams = array(
'app_id' => $conf['app_id'],
'app_secret' => $conf['secret_api_key'],
'default_graph_version' => 'v2.3',
);
$fb = new Facebook($initParams);
}
}
return $fb;
}