public function ConfigEntityProvider::request in oEmbed 8
Parameters
$url:
array $params:
Return value
File
- src/
Provider/ ConfigEntityProvider.php, line 35
Class
Namespace
Drupal\oembed\ProviderCode
public function request($url, array $params = array()) {
if (empty($this->providers)) {
$this
->loadProviders();
}
$schemes = self::getSchemes($this->providers);
$regexes = array_map(array(
'Drupal\\oembed\\Provider\\ConfigEntityProvider',
'schemeToRegex',
), $schemes);
$match = array_filter($regexes, function ($regex) use ($url) {
return (bool) preg_match($regex, $url);
});
$providerName = key($match);
/** @var \Drupal\oembed\Entity\Provider $providerEntity */
$providerEntity = $this->providers[$providerName];
$provider = new StandardProvider($providerEntity
->getEndpoint(), $providerEntity
->getScheme(), array(), array(
'format' => 'json',
));
return $provider
->request($url, $params);
}