discoverResourceUrl example

public function getProviderByUrl($url) {
    // Check the URL against every scheme of every endpoint of every provider     // until we find a match.     foreach ($this->providers->getAll() as $provider_info) {
      foreach ($provider_info->getEndpoints() as $endpoint) {
        if ($endpoint->matchUrl($url)) {
          return $provider_info;
        }
      }
    }

    $resource_url = $this->discoverResourceUrl($url);
    if ($resource_url) {
      return $this->resourceFetcher->fetchResource($resource_url)->getProvider();
    }

    throw new ResourceException('No matching provider found.', $url);
  }

  /** * {@inheritdoc} */
  public function getResourceUrl($url$max_width = NULL, $max_height = NULL) {
    
Home | Imprint | This part of the site doesn't use cookies.