class FacebookLib extends BaseFacebook


Located at : UKNOWVA_ROOT/components/com_community/libraries/facebook/facebook.php

Extends the BaseFacebook class with the intent of using PHP sessions to store user ids and access tokens.

Constants

VERSION

Version.

Properties

static $CURL_OPTS Default options for curl. from BaseFacebook
static $DOMAIN_MAP Maps aliases to Facebook domains. from BaseFacebook

Methods

__construct(array $config)

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.

setAppId(string $appId)

Set the Application ID.

string
getAppId()

Get the Application ID.

setApiSecret(string $apiSecret)

Set the API Secret.

string
getApiSecret()

Get the API Secret.

setFileUploadSupport(boolean $fileUploadSupport)

Set the file upload support status.

boolean
useFileUploadSupport()

Get the file upload support status.

setAccessToken(string $access_token)

Sets the access token for api calls. Use this if you get your access token by other means and just want the SDK to use it.

string
getAccessToken()

Determines the access token that should be used for API calls.

string
getSignedRequest()

Retrieve the signed request, either from a request parameter or, if not present, from a cookie.

string
getUser()

Get the UID of the connected user, or 0 if the Facebook user is not connected.

string
getLoginUrl(array $params = array())

Get a Login URL for use with redirects. By default, full page redirect is assumed. If you are using the generated URL with a window.open() call in JavaScript, you can pass in display=popup as part of the $params.

string
getLogoutUrl(array $params = array())

Get a Logout URL suitable for use with redirects.

string
getLoginStatusUrl(array $params = array())

Get a login status URL to fetch the status from Facebook.

mixed
api()

Make an API call.

Details

at line 59
__construct(array $config)

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.

Parameters

array $config The application configuration

See also

BaseFacebook::__construct in facebook.php

in BaseFacebook at line 236
BaseFacebook setAppId(string $appId)

Set the Application ID.

Parameters

string $appId The Application ID

Return Value

BaseFacebook

in BaseFacebook at line 246
string getAppId()

Get the Application ID.

Return Value

string the Application ID

in BaseFacebook at line 256
BaseFacebook setApiSecret(string $apiSecret)

Set the API Secret.

Parameters

string $apiSecret The API Secret

Return Value

BaseFacebook

in BaseFacebook at line 266
string getApiSecret()

Get the API Secret.

Return Value

string the API Secret

in BaseFacebook at line 276
BaseFacebook setFileUploadSupport(boolean $fileUploadSupport)

Set the file upload support status.

Parameters

boolean $fileUploadSupport The file upload support status.

Return Value

BaseFacebook

in BaseFacebook at line 286
boolean useFileUploadSupport()

Get the file upload support status.

Return Value

boolean true if and only if the server supports file upload.

in BaseFacebook at line 298
BaseFacebook setAccessToken(string $access_token)

Sets the access token for api calls. Use this if you get your access token by other means and just want the SDK to use it.

Parameters

string $access_token an access token.

Return Value

BaseFacebook

in BaseFacebook at line 312
string getAccessToken()

Determines the access token that should be used for API calls.

The first time this is called, $this->accessToken is set equal to either a valid user access token, or it's set to the application access token if a valid user access token wasn't available. Subsequent calls return whatever the first call returned.

Return Value

string The access token

in BaseFacebook at line 397
string getSignedRequest()

Retrieve the signed request, either from a request parameter or, if not present, from a cookie.

Return Value

string the signed request, if available, or null otherwise.

in BaseFacebook at line 416
string getUser()

Get the UID of the connected user, or 0 if the Facebook user is not connected.

Return Value

string the UID if available.

in BaseFacebook at line 482
string getLoginUrl(array $params = array())

Get a Login URL for use with redirects. By default, full page redirect is assumed. If you are using the generated URL with a window.open() call in JavaScript, you can pass in display=popup as part of the $params.

The parameters: - redirect_uri: the url to go to after a successful login - scope: comma separated list of requested extended perms

Parameters

array $params Provide custom parameters

Return Value

string The URL for the login flow

in BaseFacebook at line 511
string getLogoutUrl(array $params = array())

Get a Logout URL suitable for use with redirects.

The parameters: - next: the url to go to after a successful logout

Parameters

array $params Provide custom parameters

Return Value

string The URL for the logout flow

in BaseFacebook at line 533
string getLoginStatusUrl(array $params = array())

Get a login status URL to fetch the status from Facebook.

The parameters: - oksession: the URL to go to if a session is found - nosession: the URL to go to if the user is not connected - no_user: the URL to go to if the user is not signed into facebook

Parameters

array $params Provide custom parameters

Return Value

string The URL for the logout flow

in BaseFacebook at line 552
mixed api()

Make an API call.

Return Value

mixed The decoded response