You are here

public function ConfigEntityProvider::supports in oEmbed 8

Returns whether this class supports the given url.

Parameters

string $url A url:

array $params The resource type or null if unknown:

Return value

bool True if this class supports the given url, false otherwise

File

src/Provider/ConfigEntityProvider.php, line 64

Class

ConfigEntityProvider

Namespace

Drupal\oembed\Provider

Code

public function supports($url, array $params = array()) {
  if (empty($this->providers)) {
    $this
      ->loadProviders();
  }
  $schemes = array_merge(...array_values(self::getSchemes($this->providers)));
  $regex = self::schemeToRegex($schemes);
  return (bool) preg_match($regex, $url);
}