PHP Class Embera\Providers\Facebook

Inheritance: extends Embera\Adapters\Service
Datei anzeigen Open project: mpratt/embera

Protected Properties

Property Type Description
$apiUrl inline {@inheritdoc} This Provider is kind of special, because it uses different oembed endpoints based on the given url. The default value of the endpoint is null and is set during the process of getting the url information.
$postPatterns Patterns that match posts urls
$videoPatterns Patterns that match video urls

Public Methods

Method Description
getInfo ( ) inline {@inheritdoc}

Protected Methods

Method Description
modifyResponse ( array $response = [] ) inline {@inheritdoc}
urlMatchesPattern ( array $patternList ) : boolean Checks if $this->url matches the given list of patterns
validateUrl ( ) inline {@inheritdoc}

Method Details

getInfo() public method

Im overriding this method because I need to set the endpoint based on the given url. By default we're always assuming it is a post url unless we have a specific video match. Why? Because we already did url validation and We dont want to loop over both sets of patterns all over again right? So we just need to loop over the smaller one ;)
public getInfo ( )

modifyResponse() protected method

Need to modify the html response, to use the iframe instead. The html returned by facebook always adds the javascript code and the famous
. When embedding multiple links, the code seems to conflict and doesnt embed properly
protected modifyResponse ( array $response = [] )
$response array

urlMatchesPattern() protected method

Checks if $this->url matches the given list of patterns
protected urlMatchesPattern ( array $patternList ) : boolean
$patternList array Array with regex
return boolean

validateUrl() protected method

inline {@inheritdoc}
protected validateUrl ( )

Property Details

$apiUrl protected_oe property

inline {@inheritdoc} This Provider is kind of special, because it uses different oembed endpoints based on the given url. The default value of the endpoint is null and is set during the process of getting the url information.
protected $apiUrl

$postPatterns protected_oe property

Patterns that match posts urls
protected $postPatterns

$videoPatterns protected_oe property

Patterns that match video urls
protected $videoPatterns