PHP Class Embera\Embera

Afficher le fichier Open project: mpratt/embera Class Usage Examples

Protected Properties

Свойство Type Description
$config Configuration Settings
$errors Fetched errors
$oembed Instance of \Embera\Oembed
$providers Instance of \Embera\Providers
$urlEmbedRegex The pattern used to extract urls from a text when the embed:// prefix option is enabled
$urlRegex The pattern used to extract urls from a text

Méthodes publiques

Méthode Description
__construct ( array $config = [] ) : void Constructs the object and also instantiates the \Embera\Oembed Object and stores it into the $oembed properoty
addProvider ( string $host, string | object $class, array $params = [] ) : void Adds a new Provider into the service map
autoEmbed ( string $body = null ) : string Embeds known/available services into the given text.
getErrors ( ) : array Returns an array with all the errors
getLastError ( ) : string Gets the last error found
getUrlInfo ( string | array $body = null ) : array Finds all the information about a url (or a collection of urls)
hasErrors ( ) : boolean Checks if there were errors

Méthodes protégées

Méthode Description
clean ( array $services = [] ) : array Strips invalid providers from the list
getProviders ( null | string | array $body = '' ) : array Finds all the valid urls inside the given text, compares which are allowed and returns an array with the detected providers

Method Details

__construct() public méthode

Constructs the object and also instantiates the \Embera\Oembed Object and stores it into the $oembed properoty
public __construct ( array $config = [] ) : void
$config array
Résultat void

addProvider() public méthode

Adds a new Provider into the service map
public addProvider ( string $host, string | object $class, array $params = [] ) : void
$host string The host for the map
$class string | object The class or object that should manage the provider
$params array Custom parameters that should be sent in the url for this Provider
Résultat void

autoEmbed() public méthode

Embeds known/available services into the given text.
public autoEmbed ( string $body = null ) : string
$body string
Résultat string

clean() protected méthode

Strips invalid providers from the list
protected clean ( array $services = [] ) : array
$services array
Résultat array

getErrors() public méthode

Returns an array with all the errors
public getErrors ( ) : array
Résultat array

getLastError() public méthode

Gets the last error found
public getLastError ( ) : string
Résultat string

getProviders() protected méthode

Finds all the valid urls inside the given text, compares which are allowed and returns an array with the detected providers
protected getProviders ( null | string | array $body = '' ) : array
$body null | string | array An array or string with Urls
Résultat array

getUrlInfo() public méthode

Finds all the information about a url (or a collection of urls)
public getUrlInfo ( string | array $body = null ) : array
$body string | array An array or string with urls
Résultat array

hasErrors() public méthode

Checks if there were errors
public hasErrors ( ) : boolean
Résultat boolean

Property Details

$config protected_oe property

Configuration Settings
protected $config

$errors protected_oe property

Fetched errors
protected $errors

$oembed protected_oe property

Instance of \Embera\Oembed
protected $oembed

$providers protected_oe property

Instance of \Embera\Providers
protected $providers

$urlEmbedRegex protected_oe property

The pattern used to extract urls from a text when the embed:// prefix option is enabled
protected $urlEmbedRegex

$urlRegex protected_oe property

The pattern used to extract urls from a text
protected $urlRegex