PHP Class Embera\Providers\Facebook

Inheritance: extends Embera\Adapters\Service
Afficher le fichier Open project: mpratt/embera

Protected Properties

Свойство 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

Méthodes publiques

Méthode Description
getInfo ( ) inline {@inheritdoc}

Méthodes protégées

Méthode 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 méthode

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 méthode

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 méthode

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

validateUrl() protected méthode

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