PHP Class Embera\Providers

Datei anzeigen Open project: mpratt/embera

Protected Properties

Property Type Description
$config Configuration Settings
$customParams Custom parameters for each host/provider
$oembed instance of \Embera\Oembed
$services Massive array with the mapping of host -> provider class relation.
$wildCardHosts Hosts with wildcards, calculated at runtime

Public Methods

Method Description
__construct ( array $config = [], Embera\Oembed $oembed ) : void Construct
addProvider ( string $host, string | object $class, array $params = [] ) : void Adds a new Provider into the service map
getAll ( array | string $urls ) : array Returns an array with all valid services found.

Protected Methods

Method Description
extractCustomParams ( array $params = [] ) : array Extracts custom parameters for a Provider
findServices ( array $urls = [] ) : array Finds services for the given $urls.
getHost ( string $url ) : string Gets a normalized host for the given $url

Method Details

__construct() public method

Construct
public __construct ( array $config = [], Embera\Oembed $oembed ) : void
$config array Associative array with configuration options
$oembed Embera\Oembed Instance of \Embera\Oembed
return void

addProvider() public method

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
return void

extractCustomParams() protected method

Extracts custom parameters for a Provider
protected extractCustomParams ( array $params = [] ) : array
$params array
return array

findServices() protected method

Finds services for the given $urls.
protected findServices ( array $urls = [] ) : array
$urls array An array with all the available urls
return array An Array with loaded services

getAll() public method

Returns an array with all valid services found.
public getAll ( array | string $urls ) : array
$urls array | string An array with urls or a url string
return array

getHost() protected method

Gets a normalized host for the given $url
protected getHost ( string $url ) : string
$url string
return string

Property Details

$config protected_oe property

Configuration Settings
protected $config

$customParams protected_oe property

Custom parameters for each host/provider
protected $customParams

$oembed protected_oe property

instance of \Embera\Oembed
protected $oembed

$services protected_oe property

Massive array with the mapping of host -> provider class relation.
protected $services

$wildCardHosts protected_oe property

Hosts with wildcards, calculated at runtime
protected $wildCardHosts