code
stringlengths 17
247k
| docstring
stringlengths 30
30.3k
| func_name
stringlengths 1
89
| language
stringclasses 1
value | repo
stringlengths 7
63
| path
stringlengths 7
153
| url
stringlengths 51
209
| license
stringclasses 4
values |
---|---|---|---|---|---|---|---|
public function newBatchRequest($accessToken = null, $graphVersion = null)
{
$accessToken = $accessToken ?: $this->defaultAccessToken;
$graphVersion = $graphVersion ?: $this->defaultGraphVersion;
return new FacebookBatchRequest(
$this->app,
[],
$accessToken,
$graphVersion
);
} | Instantiates an empty FacebookBatchRequest entity.
@param AccessToken|string|null $accessToken The top-level access token. Requests with no access token
will fallback to this.
@param string|null $graphVersion The Graph API version to use.
@return FacebookBatchRequest | newBatchRequest | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Facebook.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Facebook.php | MIT |
public function request($method, $endpoint, array $params = [], $accessToken = null, $eTag = null, $graphVersion = null)
{
$accessToken = $accessToken ?: $this->defaultAccessToken;
$graphVersion = $graphVersion ?: $this->defaultGraphVersion;
return new FacebookRequest(
$this->app,
$accessToken,
$method,
$endpoint,
$params,
$eTag,
$graphVersion
);
} | Instantiates a new FacebookRequest entity.
@param string $method
@param string $endpoint
@param array $params
@param AccessToken|string|null $accessToken
@param string|null $eTag
@param string|null $graphVersion
@return FacebookRequest
@throws FacebookSDKException | request | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Facebook.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Facebook.php | MIT |
public function fileToUpload($pathToFile)
{
return new FacebookFile($pathToFile);
} | Factory to create FacebookFile's.
@param string $pathToFile
@return FacebookFile
@throws FacebookSDKException | fileToUpload | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Facebook.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Facebook.php | MIT |
public function videoToUpload($pathToFile)
{
return new FacebookVideo($pathToFile);
} | Factory to create FacebookVideo's.
@param string $pathToFile
@return FacebookVideo
@throws FacebookSDKException | videoToUpload | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Facebook.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Facebook.php | MIT |
private function maxTriesTransfer(FacebookResumableUploader $uploader, $endpoint, FacebookTransferChunk $chunk, $retryCountdown)
{
$newChunk = $uploader->transfer($endpoint, $chunk, $retryCountdown < 1);
if ($newChunk !== $chunk) {
return $newChunk;
}
$retryCountdown--;
// If transfer() returned the same chunk entity, the transfer failed but is resumable.
return $this->maxTriesTransfer($uploader, $endpoint, $chunk, $retryCountdown);
} | Attempts to upload a chunk of a file in $retryCountdown tries.
@param FacebookResumableUploader $uploader
@param string $endpoint
@param FacebookTransferChunk $chunk
@param int $retryCountdown
@return FacebookTransferChunk
@throws FacebookSDKException | maxTriesTransfer | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Facebook.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Facebook.php | MIT |
public function addFallbackDefaults(FacebookRequest $request)
{
if (!$request->getApp()) {
$app = $this->getApp();
if (!$app) {
throw new FacebookSDKException('Missing FacebookApp on FacebookRequest and no fallback detected on FacebookBatchRequest.');
}
$request->setApp($app);
}
if (!$request->getAccessToken()) {
$accessToken = $this->getAccessToken();
if (!$accessToken) {
throw new FacebookSDKException('Missing access token on FacebookRequest and no fallback detected on FacebookBatchRequest.');
}
$request->setAccessToken($accessToken);
}
} | Ensures that the FacebookApp and access token fall back when missing.
@param FacebookRequest $request
@throws FacebookSDKException | addFallbackDefaults | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/FacebookBatchRequest.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/FacebookBatchRequest.php | MIT |
public function getRequests()
{
return $this->requests;
} | Return the FacebookRequest entities.
@return array | getRequests | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/FacebookBatchRequest.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/FacebookBatchRequest.php | MIT |
public function prepareRequestsForBatch()
{
$this->validateBatchRequestCount();
$params = [
'batch' => $this->convertRequestsToJson(),
'include_headers' => true,
];
$this->setParams($params);
} | Prepares the requests to be sent as a batch request. | prepareRequestsForBatch | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/FacebookBatchRequest.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/FacebookBatchRequest.php | MIT |
public function getIterator()
{
return new ArrayIterator($this->requests);
} | Get an iterator for the items.
@return ArrayIterator | getIterator | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/FacebookBatchRequest.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/FacebookBatchRequest.php | MIT |
public function getPartialFile()
{
$maxLength = $this->endOffset - $this->startOffset;
return new FacebookFile($this->file->getFilePath(), $maxLength, $this->startOffset);
} | Return a FacebookFile entity with partial content.
@return FacebookFile | getPartialFile | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/FileUpload/FacebookTransferChunk.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/FileUpload/FacebookTransferChunk.php | MIT |
public function isLastChunk()
{
return $this->startOffset === $this->endOffset;
} | Check whether is the last chunk
@return bool | isLastChunk | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/FileUpload/FacebookTransferChunk.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/FileUpload/FacebookTransferChunk.php | MIT |
public function start($endpoint, FacebookFile $file)
{
$params = [
'upload_phase' => 'start',
'file_size' => $file->getSize(),
];
$response = $this->sendUploadRequest($endpoint, $params);
return new FacebookTransferChunk($file, $response['upload_session_id'], $response['video_id'], $response['start_offset'], $response['end_offset']);
} | Upload by chunks - start phase
@param string $endpoint
@param FacebookFile $file
@return FacebookTransferChunk
@throws FacebookSDKException | start | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/FileUpload/FacebookResumableUploader.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/FileUpload/FacebookResumableUploader.php | MIT |
public function transfer($endpoint, FacebookTransferChunk $chunk, $allowToThrow = false)
{
$params = [
'upload_phase' => 'transfer',
'upload_session_id' => $chunk->getUploadSessionId(),
'start_offset' => $chunk->getStartOffset(),
'video_file_chunk' => $chunk->getPartialFile(),
];
try {
$response = $this->sendUploadRequest($endpoint, $params);
} catch (FacebookResponseException $e) {
$preException = $e->getPrevious();
if ($allowToThrow || !$preException instanceof FacebookResumableUploadException) {
throw $e;
}
// Return the same chunk entity so it can be retried.
return $chunk;
}
return new FacebookTransferChunk($chunk->getFile(), $chunk->getUploadSessionId(), $chunk->getVideoId(), $response['start_offset'], $response['end_offset']);
} | Upload by chunks - transfer phase
@param string $endpoint
@param FacebookTransferChunk $chunk
@param boolean $allowToThrow
@return FacebookTransferChunk
@throws FacebookResponseException | transfer | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/FileUpload/FacebookResumableUploader.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/FileUpload/FacebookResumableUploader.php | MIT |
public function finish($endpoint, $uploadSessionId, $metadata = [])
{
$params = array_merge($metadata, [
'upload_phase' => 'finish',
'upload_session_id' => $uploadSessionId,
]);
$response = $this->sendUploadRequest($endpoint, $params);
return $response['success'];
} | Upload by chunks - finish phase
@param string $endpoint
@param string $uploadSessionId
@param array $metadata The metadata associated with the file.
@return boolean
@throws FacebookSDKException | finish | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/FileUpload/FacebookResumableUploader.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/FileUpload/FacebookResumableUploader.php | MIT |
private function sendUploadRequest($endpoint, $params = [])
{
$request = new FacebookRequest($this->app, $this->accessToken, 'POST', $endpoint, $params, null, $this->graphVersion);
return $this->client->sendRequest($request)->getDecodedBody();
} | Helper to make a FacebookRequest and send it.
@param string $endpoint The endpoint to POST to.
@param array $params The params to send with the request.
@return array | sendUploadRequest | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/FileUpload/FacebookResumableUploader.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/FileUpload/FacebookResumableUploader.php | MIT |
public static function getInstance()
{
if (!self::$instance) {
self::$instance = new self();
}
return self::$instance;
} | Get a singleton instance of the class
@return self
@codeCoverageIgnore | getInstance | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/FileUpload/Mimetypes.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/FileUpload/Mimetypes.php | MIT |
public function fromExtension($extension)
{
$extension = strtolower($extension);
return isset($this->mimetypes[$extension]) ? $this->mimetypes[$extension] : null;
} | Get a mimetype value from a file extension
@param string $extension File extension
@return string|null | fromExtension | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/FileUpload/Mimetypes.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/FileUpload/Mimetypes.php | MIT |
public function fromFilename($filename)
{
return $this->fromExtension(pathinfo($filename, PATHINFO_EXTENSION));
} | Get a mimetype from a filename
@param string $filename Filename to generate a mimetype from
@return string|null | fromFilename | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/FileUpload/Mimetypes.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/FileUpload/Mimetypes.php | MIT |
public function __construct($filePath, $maxLength = -1, $offset = -1)
{
$this->path = $filePath;
$this->maxLength = $maxLength;
$this->offset = $offset;
$this->open();
} | Creates a new FacebookFile entity.
@param string $filePath
@param int $maxLength
@param int $offset
@throws FacebookSDKException | __construct | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/FileUpload/FacebookFile.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/FileUpload/FacebookFile.php | MIT |
public function getContents()
{
return stream_get_contents($this->stream, $this->maxLength, $this->offset);
} | Return the contents of the file.
@return string | getContents | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/FileUpload/FacebookFile.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/FileUpload/FacebookFile.php | MIT |
public function getMimetype()
{
return Mimetypes::getInstance()->fromFilename($this->path) ?: 'text/plain';
} | Return the mimetype of the file.
@return string | getMimetype | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/FileUpload/FacebookFile.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/FileUpload/FacebookFile.php | MIT |
protected function isRemoteFile($pathToFile)
{
return preg_match('/^(https?|ftp):\/\/.*/', $pathToFile) === 1;
} | Returns true if the path to the file is remote.
@param string $pathToFile
@return boolean | isRemoteFile | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/FileUpload/FacebookFile.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/FileUpload/FacebookFile.php | MIT |
public function __construct(array $params)
{
$this->params = $params;
} | Creates a new GraphUrlEncodedBody entity.
@param array $params | __construct | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Http/RequestBodyUrlEncoded.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Http/RequestBodyUrlEncoded.php | MIT |
private function getFileString($name, FacebookFile $file)
{
return sprintf(
"--%s\r\nContent-Disposition: form-data; name=\"%s\"; filename=\"%s\"%s\r\n\r\n%s\r\n",
$this->boundary,
$name,
$file->getFileName(),
$this->getFileHeaders($file),
$file->getContents()
);
} | Get the string needed to transfer a file.
@param string $name
@param FacebookFile $file
@return string | getFileString | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Http/RequestBodyMultipart.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Http/RequestBodyMultipart.php | MIT |
private function getParamString($name, $value)
{
return sprintf(
"--%s\r\nContent-Disposition: form-data; name=\"%s\"\r\n\r\n%s\r\n",
$this->boundary,
$name,
$value
);
} | Get the string needed to transfer a POST field.
@param string $name
@param string $value
@return string | getParamString | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Http/RequestBodyMultipart.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Http/RequestBodyMultipart.php | MIT |
protected function getFileHeaders(FacebookFile $file)
{
return "\r\nContent-Type: {$file->getMimetype()}";
} | Get the headers needed before transferring the content of a POST file.
@param FacebookFile $file
@return string | getFileHeaders | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Http/RequestBodyMultipart.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Http/RequestBodyMultipart.php | MIT |
public function __construct($headers, $body, $httpStatusCode = null)
{
if (is_numeric($httpStatusCode)) {
$this->httpResponseCode = (int)$httpStatusCode;
}
if (is_array($headers)) {
$this->headers = $headers;
} else {
$this->setHeadersFromString($headers);
}
$this->body = $body;
} | Creates a new GraphRawResponse entity.
@param string|array $headers The headers as a raw string or array.
@param string $body The raw response body.
@param int $httpStatusCode The HTTP response code (if sending headers as parsed array). | __construct | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Http/GraphRawResponse.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Http/GraphRawResponse.php | MIT |
public function getBody()
{
return $this->body;
} | Return the body of the response.
@return string | getBody | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Http/GraphRawResponse.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Http/GraphRawResponse.php | MIT |
public function getHttpResponseCode()
{
return $this->httpResponseCode;
} | Return the HTTP response code.
@return int | getHttpResponseCode | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Http/GraphRawResponse.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Http/GraphRawResponse.php | MIT |
public function setHttpResponseCodeFromHeader($rawResponseHeader)
{
preg_match('|HTTP/\d\.\d\s+(\d+)\s+.*|', $rawResponseHeader, $match);
$this->httpResponseCode = (int)$match[1];
} | Sets the HTTP response code from a raw header.
@param string $rawResponseHeader | setHttpResponseCodeFromHeader | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Http/GraphRawResponse.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Http/GraphRawResponse.php | MIT |
protected function setHeadersFromString($rawHeaders)
{
// Normalize line breaks
$rawHeaders = str_replace("\r\n", "\n", $rawHeaders);
// There will be multiple headers if a 301 was followed
// or a proxy was followed, etc
$headerCollection = explode("\n\n", trim($rawHeaders));
// We just want the last response (at the end)
$rawHeader = array_pop($headerCollection);
$headerComponents = explode("\n", $rawHeader);
foreach ($headerComponents as $line) {
if (strpos($line, ': ') === false) {
$this->setHttpResponseCodeFromHeader($line);
} else {
list($key, $value) = explode(': ', $line, 2);
$this->headers[$key] = $value;
}
}
} | Parse the raw headers and set as an array.
@param string $rawHeaders The raw headers from the response. | setHeadersFromString | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Http/GraphRawResponse.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Http/GraphRawResponse.php | MIT |
public function __construct(FacebookApp $app, FacebookClient $client, $graphVersion = null)
{
parent::__construct($app, $client, $graphVersion);
if (!$this->signedRequest) {
return;
}
$this->pageData = $this->signedRequest->get('page');
} | Initialize the helper and process available signed request data.
@param FacebookApp $app The FacebookApp entity.
@param FacebookClient $client The client to make HTTP requests.
@param string|null $graphVersion The version of Graph to use. | __construct | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookPageTabHelper.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookPageTabHelper.php | MIT |
public function getPageData($key, $default = null)
{
if (isset($this->pageData[$key])) {
return $this->pageData[$key];
}
return $default;
} | Returns a value from the page data.
@param string $key
@param mixed|null $default
@return mixed|null | getPageData | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookPageTabHelper.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookPageTabHelper.php | MIT |
public function isAdmin()
{
return $this->getPageData('admin') === true;
} | Returns true if the user is an admin.
@return boolean | isAdmin | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookPageTabHelper.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookPageTabHelper.php | MIT |
public function getPageId()
{
return $this->getPageData('id');
} | Returns the page id if available.
@return string|null | getPageId | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookPageTabHelper.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookPageTabHelper.php | MIT |
public function getPersistentDataHandler()
{
return $this->persistentDataHandler;
} | Returns the persistent data handler.
@return PersistentDataInterface | getPersistentDataHandler | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookRedirectLoginHelper.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookRedirectLoginHelper.php | MIT |
public function getPseudoRandomStringGenerator()
{
return $this->pseudoRandomStringGenerator;
} | Returns the cryptographically secure pseudo-random string generator.
@return PseudoRandomStringGeneratorInterface | getPseudoRandomStringGenerator | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookRedirectLoginHelper.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookRedirectLoginHelper.php | MIT |
private function makeUrl($redirectUrl, array $scope, array $params = [], $separator = '&')
{
$state = $this->persistentDataHandler->get('state') ?: $this->pseudoRandomStringGenerator->getPseudoRandomString(static::CSRF_LENGTH);
$this->persistentDataHandler->set('state', $state);
return $this->oAuth2Client->getAuthorizationUrl($redirectUrl, $state, $scope, $params, $separator);
} | Stores CSRF state and returns a URL to which the user should be sent to in order to continue the login process with Facebook.
@param string $redirectUrl The URL Facebook should redirect users to after login.
@param array $scope List of permissions to request during login.
@param array $params An array of parameters to generate URL.
@param string $separator The separator to use in http_build_query().
@return string | makeUrl | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookRedirectLoginHelper.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookRedirectLoginHelper.php | MIT |
public function getLoginUrl($redirectUrl, array $scope = [], $separator = '&')
{
return $this->makeUrl($redirectUrl, $scope, [], $separator);
} | Returns the URL to send the user in order to login to Facebook.
@param string $redirectUrl The URL Facebook should redirect users to after login.
@param array $scope List of permissions to request during login.
@param string $separator The separator to use in http_build_query().
@return string | getLoginUrl | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookRedirectLoginHelper.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookRedirectLoginHelper.php | MIT |
public function getLogoutUrl($accessToken, $next, $separator = '&')
{
if (!$accessToken instanceof AccessToken) {
$accessToken = new AccessToken($accessToken);
}
if ($accessToken->isAppAccessToken()) {
throw new FacebookSDKException('Cannot generate a logout URL with an app access token.', 722);
}
$params = [
'next' => $next,
'access_token' => $accessToken->getValue(),
];
return 'https://www.facebook.com/logout.php?' . http_build_query($params, null, $separator);
} | Returns the URL to send the user in order to log out of Facebook.
@param AccessToken|string $accessToken The access token that will be logged out.
@param string $next The url Facebook should redirect the user to after a successful logout.
@param string $separator The separator to use in http_build_query().
@return string
@throws FacebookSDKException | getLogoutUrl | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookRedirectLoginHelper.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookRedirectLoginHelper.php | MIT |
public function getAccessToken($redirectUrl = null)
{
if (!$code = $this->getCode()) {
return null;
}
$this->validateCsrf();
$this->resetCsrf();
$redirectUrl = $redirectUrl ?: $this->urlDetectionHandler->getCurrentUrl();
// At minimum we need to remove the 'state' and 'code' params
$redirectUrl = FacebookUrlManipulator::removeParamsFromUrl($redirectUrl, ['code', 'state']);
return $this->oAuth2Client->getAccessTokenFromCode($code, $redirectUrl);
} | Takes a valid code from a login redirect, and returns an AccessToken entity.
@param string|null $redirectUrl The redirect URL.
@return AccessToken|null
@throws FacebookSDKException | getAccessToken | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookRedirectLoginHelper.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookRedirectLoginHelper.php | MIT |
protected function validateCsrf()
{
$state = $this->getState();
if (!$state) {
throw new FacebookSDKException('Cross-site request forgery validation failed. Required GET param "state" missing.');
}
$savedState = $this->persistentDataHandler->get('state');
if (!$savedState) {
throw new FacebookSDKException('Cross-site request forgery validation failed. Required param "state" missing from persistent data.');
}
if (\hash_equals($savedState, $state)) {
return;
}
throw new FacebookSDKException('Cross-site request forgery validation failed. The "state" param from the URL and session do not match.');
} | Validate the request against a cross-site request forgery.
@throws FacebookSDKException | validateCsrf | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookRedirectLoginHelper.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookRedirectLoginHelper.php | MIT |
private function resetCsrf()
{
$this->persistentDataHandler->set('state', null);
} | Resets the CSRF so that it doesn't get reused. | resetCsrf | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookRedirectLoginHelper.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookRedirectLoginHelper.php | MIT |
public function getErrorDescription()
{
return $this->getInput('error_description');
} | Returns the error description.
@return string|null | getErrorDescription | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookRedirectLoginHelper.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookRedirectLoginHelper.php | MIT |
private function getInput($key)
{
return isset($_GET[$key]) ? $_GET[$key] : null;
} | Returns a value from a GET param.
@param string $key
@return string|null | getInput | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookRedirectLoginHelper.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookRedirectLoginHelper.php | MIT |
public function getRawSignedRequest()
{
return $this->getRawSignedRequestFromPost() ?: null;
} | Get raw signed request from POST.
@return string|null | getRawSignedRequest | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookCanvasHelper.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookCanvasHelper.php | MIT |
public function instantiateSignedRequest($rawSignedRequest = null)
{
$rawSignedRequest = $rawSignedRequest ?: $this->getRawSignedRequest();
if (!$rawSignedRequest) {
return;
}
$this->signedRequest = new SignedRequest($this->app, $rawSignedRequest);
} | Instantiates a new SignedRequest entity.
@param string|null | instantiateSignedRequest | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookSignedRequestFromInputHelper.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookSignedRequestFromInputHelper.php | MIT |
public function getAccessToken()
{
if ($this->signedRequest && $this->signedRequest->hasOAuthData()) {
$code = $this->signedRequest->get('code');
$accessToken = $this->signedRequest->get('oauth_token');
if ($code && !$accessToken) {
return $this->oAuth2Client->getAccessTokenFromCode($code);
}
$expiresAt = $this->signedRequest->get('expires', 0);
return new AccessToken($accessToken, $expiresAt);
}
return null;
} | Returns an AccessToken entity from the signed request.
@return AccessToken|null
@throws \Facebook\Exceptions\FacebookSDKException | getAccessToken | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookSignedRequestFromInputHelper.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookSignedRequestFromInputHelper.php | MIT |
public function getSignedRequest()
{
return $this->signedRequest;
} | Returns the SignedRequest entity.
@return SignedRequest|null | getSignedRequest | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookSignedRequestFromInputHelper.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookSignedRequestFromInputHelper.php | MIT |
public function getUserId()
{
return $this->signedRequest ? $this->signedRequest->getUserId() : null;
} | Returns the user_id if available.
@return string|null | getUserId | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookSignedRequestFromInputHelper.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookSignedRequestFromInputHelper.php | MIT |
public function getRawSignedRequestFromPost()
{
if (isset($_POST['signed_request'])) {
return $_POST['signed_request'];
}
return null;
} | Get raw signed request from POST input.
@return string|null | getRawSignedRequestFromPost | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookSignedRequestFromInputHelper.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookSignedRequestFromInputHelper.php | MIT |
public function getRawSignedRequestFromCookie()
{
if (isset($_COOKIE['fbsr_' . $this->app->getId()])) {
return $_COOKIE['fbsr_' . $this->app->getId()];
}
return null;
} | Get raw signed request from cookie set from the Javascript SDK.
@return string|null | getRawSignedRequestFromCookie | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookSignedRequestFromInputHelper.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookSignedRequestFromInputHelper.php | MIT |
public function getRawSignedRequest()
{
return $this->getRawSignedRequestFromCookie();
} | Get raw signed request from the cookie.
@return string|null | getRawSignedRequest | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookJavaScriptHelper.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Helpers/FacebookJavaScriptHelper.php | MIT |
protected function getHttpScheme()
{
return $this->isBehindSsl() ? 'https' : 'http';
} | Get the currently active URL scheme.
@return string | getHttpScheme | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Url/FacebookUrlDetectionHandler.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Url/FacebookUrlDetectionHandler.php | MIT |
protected function isBehindSsl()
{
// Check for proxy first
$protocol = $this->getHeader('X_FORWARDED_PROTO');
if ($protocol) {
return $this->protocolWithActiveSsl($protocol);
}
$protocol = $this->getServerVar('HTTPS');
if ($protocol) {
return $this->protocolWithActiveSsl($protocol);
}
return (string)$this->getServerVar('SERVER_PORT') === '443';
} | Tries to detect if the server is running behind an SSL.
@return boolean | isBehindSsl | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Url/FacebookUrlDetectionHandler.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Url/FacebookUrlDetectionHandler.php | MIT |
protected function protocolWithActiveSsl($protocol)
{
$protocol = strtolower((string)$protocol);
return in_array($protocol, ['on', '1', 'https', 'ssl'], true);
} | Detects an active SSL protocol value.
@param string $protocol
@return boolean | protocolWithActiveSsl | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Url/FacebookUrlDetectionHandler.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Url/FacebookUrlDetectionHandler.php | MIT |
protected function getHostName()
{
// Check for proxy first
$header = $this->getHeader('X_FORWARDED_HOST');
if ($header && $this->isValidForwardedHost($header)) {
$elements = explode(',', $header);
$host = $elements[count($elements) - 1];
} elseif (!$host = $this->getHeader('HOST')) {
if (!$host = $this->getServerVar('SERVER_NAME')) {
$host = $this->getServerVar('SERVER_ADDR');
}
}
// trim and remove port number from host
// host is lowercase as per RFC 952/2181
$host = strtolower(preg_replace('/:\d+$/', '', trim($host)));
// Port number
$scheme = $this->getHttpScheme();
$port = $this->getCurrentPort();
$appendPort = ':' . $port;
// Don't append port number if a normal port.
if (($scheme == 'http' && $port == '80') || ($scheme == 'https' && $port == '443')) {
$appendPort = '';
}
return $host . $appendPort;
} | Tries to detect the host name of the server.
Some elements adapted from
@see https://github.com/symfony/HttpFoundation/blob/master/Request.php
@return string | getHostName | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Url/FacebookUrlDetectionHandler.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Url/FacebookUrlDetectionHandler.php | MIT |
protected function getServerVar($key)
{
return isset($_SERVER[$key]) ? $_SERVER[$key] : '';
} | Returns the a value from the $_SERVER super global.
@param string $key
@return string | getServerVar | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Url/FacebookUrlDetectionHandler.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Url/FacebookUrlDetectionHandler.php | MIT |
protected function getHeader($key)
{
return $this->getServerVar('HTTP_' . $key);
} | Gets a value from the HTTP request headers.
@param string $key
@return string | getHeader | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Url/FacebookUrlDetectionHandler.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Url/FacebookUrlDetectionHandler.php | MIT |
protected function isValidForwardedHost($header)
{
$elements = explode(',', $header);
$host = $elements[count($elements) - 1];
return preg_match("/^([a-z\d](-*[a-z\d])*)(\.([a-z\d](-*[a-z\d])*))*$/i", $host) //valid chars check
&& 0 < strlen($host) && strlen($host) < 254 //overall length check
&& preg_match("/^[^\.]{1,63}(\.[^\.]{1,63})*$/", $host); //length of each label
} | Checks if the value in X_FORWARDED_HOST is a valid hostname
Could prevent unintended redirections
@param string $header
@return boolean | isValidForwardedHost | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Url/FacebookUrlDetectionHandler.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Url/FacebookUrlDetectionHandler.php | MIT |
public static function appendParamsToUrl($url, array $newParams = [])
{
if (empty($newParams)) {
return $url;
}
if (strpos($url, '?') === false) {
return $url . '?' . http_build_query($newParams, null, '&');
}
list($path, $query) = explode('?', $url, 2);
$existingParams = [];
parse_str($query, $existingParams);
// Favor params from the original URL over $newParams
$newParams = array_merge($newParams, $existingParams);
// Sort for a predicable order
ksort($newParams);
return $path . '?' . http_build_query($newParams, null, '&');
} | Gracefully appends params to the URL.
@param string $url The URL that will receive the params.
@param array $newParams The params to append to the URL.
@return string | appendParamsToUrl | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Url/FacebookUrlManipulator.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Url/FacebookUrlManipulator.php | MIT |
public static function getParamsAsArray($url)
{
$query = parse_url($url, PHP_URL_QUERY);
if (!$query) {
return [];
}
$params = [];
parse_str($query, $params);
return $params;
} | Returns the params from a URL in the form of an array.
@param string $url The URL to parse the params from.
@return array | getParamsAsArray | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Url/FacebookUrlManipulator.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Url/FacebookUrlManipulator.php | MIT |
public static function mergeUrlParams($urlToStealFrom, $urlToAddTo)
{
$newParams = static::getParamsAsArray($urlToStealFrom);
// Nothing new to add, return as-is
if (!$newParams) {
return $urlToAddTo;
}
return static::appendParamsToUrl($urlToAddTo, $newParams);
} | Adds the params of the first URL to the second URL.
Any params that already exist in the second URL will go untouched.
@param string $urlToStealFrom The URL harvest the params from.
@param string $urlToAddTo The URL that will receive the new params.
@return string The $urlToAddTo with any new params from $urlToStealFrom. | mergeUrlParams | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Url/FacebookUrlManipulator.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Url/FacebookUrlManipulator.php | MIT |
public static function forceSlashPrefix($string)
{
if (!$string) {
return $string;
}
return strpos($string, '/') === 0 ? $string : '/' . $string;
} | Check for a "/" prefix and prepend it if not exists.
@param string|null $string
@return string|null | forceSlashPrefix | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Url/FacebookUrlManipulator.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Url/FacebookUrlManipulator.php | MIT |
public static function baseGraphUrlEndpoint($urlToTrim)
{
return '/' . preg_replace('/^https:\/\/.+\.facebook\.com(\/v.+?)?\//', '', $urlToTrim);
} | Trims off the hostname and Graph version from a URL.
@param string $urlToTrim The URL the needs the surgery.
@return string The $urlToTrim with the hostname and Graph version removed. | baseGraphUrlEndpoint | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Url/FacebookUrlManipulator.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Url/FacebookUrlManipulator.php | MIT |
public function init()
{
$this->curl = curl_init();
} | Make a new curl reference instance | init | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/HttpClients/FacebookCurl.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/HttpClients/FacebookCurl.php | MIT |
public function setoptArray(array $options)
{
curl_setopt_array($this->curl, $options);
} | Set an array of options to a curl resource
@param array $options | setoptArray | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/HttpClients/FacebookCurl.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/HttpClients/FacebookCurl.php | MIT |
public function getinfo($type)
{
return curl_getinfo($this->curl, $type);
} | Get info from a curl reference
@param $type
@return mixed | getinfo | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/HttpClients/FacebookCurl.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/HttpClients/FacebookCurl.php | MIT |
public function version()
{
return curl_version();
} | Get the currently installed curl version
@return array | version | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/HttpClients/FacebookCurl.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/HttpClients/FacebookCurl.php | MIT |
public function close()
{
curl_close($this->curl);
} | Close the resource connection to curl | close | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/HttpClients/FacebookCurl.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/HttpClients/FacebookCurl.php | MIT |
public function compileHeader(array $headers)
{
$header = [];
foreach ($headers as $k => $v) {
$header[] = $k . ': ' . $v;
}
return implode("\r\n", $header);
} | Formats the headers for use in the stream wrapper.
@param array $headers The request headers.
@return string | compileHeader | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/HttpClients/FacebookStreamHttpClient.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/HttpClients/FacebookStreamHttpClient.php | MIT |
public function closeConnection()
{
$this->facebookCurl->close();
} | Closes an existing curl connection | closeConnection | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/HttpClients/FacebookCurlHttpClient.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/HttpClients/FacebookCurlHttpClient.php | MIT |
public function sendRequest()
{
$this->rawResponse = $this->facebookCurl->exec();
} | Send the request and get the raw response from curl | sendRequest | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/HttpClients/FacebookCurlHttpClient.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/HttpClients/FacebookCurlHttpClient.php | MIT |
public function compileRequestHeaders(array $headers)
{
$return = [];
foreach ($headers as $key => $value) {
$return[] = $key . ': ' . $value;
}
return $return;
} | Compiles the request headers into a curl-friendly format.
@param array $headers The request headers.
@return array | compileRequestHeaders | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/HttpClients/FacebookCurlHttpClient.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/HttpClients/FacebookCurlHttpClient.php | MIT |
public function extractResponseHeadersAndBody()
{
$parts = explode("\r\n\r\n", $this->rawResponse);
$rawBody = array_pop($parts);
$rawHeaders = implode("\r\n\r\n", $parts);
return [trim($rawHeaders), trim($rawBody)];
} | Extracts the headers and the body into a two-part array
@return array | extractResponseHeadersAndBody | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/HttpClients/FacebookCurlHttpClient.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/HttpClients/FacebookCurlHttpClient.php | MIT |
public function streamContextCreate(array $options)
{
$this->stream = stream_context_create($options);
} | Make a new context stream reference instance
@param array $options | streamContextCreate | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/HttpClients/FacebookStream.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/HttpClients/FacebookStream.php | MIT |
public function getResponseHeaders()
{
return $this->responseHeaders;
} | The response headers from the stream wrapper
@return array | getResponseHeaders | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/HttpClients/FacebookStream.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/HttpClients/FacebookStream.php | MIT |
public function __construct(FacebookResponse $response, FacebookSDKException $previousException = null)
{
$this->response = $response;
$this->responseData = $response->getDecodedBody();
$errorMessage = $this->get('message', 'Unknown error from Graph.');
$errorCode = $this->get('code', -1);
parent::__construct($errorMessage, $errorCode, $previousException);
} | Creates a FacebookResponseException.
@param FacebookResponse $response The response that threw the exception.
@param FacebookSDKException $previousException The more detailed exception. | __construct | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Exceptions/FacebookResponseException.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Exceptions/FacebookResponseException.php | MIT |
private function get($key, $default = null)
{
if (isset($this->responseData['error'][$key])) {
return $this->responseData['error'][$key];
}
return $default;
} | Checks isset and returns that or a default value.
@param string $key
@param mixed $default
@return mixed | get | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Exceptions/FacebookResponseException.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Exceptions/FacebookResponseException.php | MIT |
public function getRawResponse()
{
return $this->response->getBody();
} | Returns the raw response used to create the exception.
@return string | getRawResponse | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Exceptions/FacebookResponseException.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Exceptions/FacebookResponseException.php | MIT |
public function getResponseData()
{
return $this->responseData;
} | Returns the decoded response used to create the exception.
@return array | getResponseData | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Exceptions/FacebookResponseException.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Exceptions/FacebookResponseException.php | MIT |
public function getResponse()
{
return $this->response;
} | Returns the response entity used to create the exception.
@return FacebookResponse | getResponse | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/Exceptions/FacebookResponseException.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/Exceptions/FacebookResponseException.php | MIT |
public function getStreet()
{
return $this->getField('street');
} | Returns the street component of the location
@return string|null | getStreet | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphLocation.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphLocation.php | MIT |
public function getCity()
{
return $this->getField('city');
} | Returns the city component of the location
@return string|null | getCity | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphLocation.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphLocation.php | MIT |
public function getState()
{
return $this->getField('state');
} | Returns the state component of the location
@return string|null | getState | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphLocation.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphLocation.php | MIT |
public function getCountry()
{
return $this->getField('country');
} | Returns the country component of the location
@return string|null | getCountry | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphLocation.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphLocation.php | MIT |
public function getZip()
{
return $this->getField('zip');
} | Returns the zipcode component of the location
@return string|null | getZip | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphLocation.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphLocation.php | MIT |
public function getLatitude()
{
return $this->getField('latitude');
} | Returns the latitude component of the location
@return float|null | getLatitude | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphLocation.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphLocation.php | MIT |
public function getLongitude()
{
return $this->getField('longitude');
} | Returns the street component of the location
@return float|null | getLongitude | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphLocation.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphLocation.php | MIT |
public function getCanUpload()
{
return $this->getField('can_upload');
} | Returns whether the viewer can upload photos to this album.
@return boolean|null | getCanUpload | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphAlbum.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphAlbum.php | MIT |
public function getCount()
{
return $this->getField('count');
} | Returns the number of photos in this album.
@return int|null | getCount | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphAlbum.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphAlbum.php | MIT |
public function getCoverPhoto()
{
return $this->getField('cover_photo');
} | Returns the ID of the album's cover photo.
@return string|null | getCoverPhoto | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphAlbum.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphAlbum.php | MIT |
public function getCreatedTime()
{
return $this->getField('created_time');
} | Returns the time the album was initially created.
@return \DateTime|null | getCreatedTime | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphAlbum.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphAlbum.php | MIT |
public function getUpdatedTime()
{
return $this->getField('updated_time');
} | Returns the time the album was updated.
@return \DateTime|null | getUpdatedTime | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphAlbum.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphAlbum.php | MIT |
public function getDescription()
{
return $this->getField('description');
} | Returns the description of the album.
@return string|null | getDescription | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphAlbum.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphAlbum.php | MIT |
public function getFrom()
{
return $this->getField('from');
} | Returns profile that created the album.
@return GraphUser|null | getFrom | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphAlbum.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphAlbum.php | MIT |
public function getPlace()
{
return $this->getField('place');
} | Returns profile that created the album.
@return GraphPage|null | getPlace | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphAlbum.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphAlbum.php | MIT |
public function getLink()
{
return $this->getField('link');
} | Returns a link to this album on Facebook.
@return string|null | getLink | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphAlbum.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphAlbum.php | MIT |
public function getLocation()
{
return $this->getField('location');
} | Returns the textual location of the album.
@return string|null | getLocation | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphAlbum.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphAlbum.php | MIT |
public function getName()
{
return $this->getField('name');
} | Returns the title of the album.
@return string|null | getName | php | boonex/dolphin.pro | plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphAlbum.php | https://github.com/boonex/dolphin.pro/blob/master/plugins/facebook-php-sdk/src/Facebook/GraphNodes/GraphAlbum.php | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.