ProviderRepository
class ProviderRepository implements ProviderRepositoryInterface (View source)
Retrieves and caches information about oEmbed providers.
Traits
Provides methods to use a cache backend while respecting a 'use caches' flag.
Properties
| protected CacheBackendInterface | $cacheBackend | Cache backend instance. |
from UseCacheBackendTrait |
| protected bool | $useCaches | Flag whether caches should be used or skipped. |
from UseCacheBackendTrait |
| protected int | $maxAge | How long the provider data should be cached, in seconds. |
|
| protected Client | $httpClient | The HTTP client. |
|
| protected string | $providersUrl | URL of a JSON document which contains a database of oEmbed providers. |
|
| protected TimeInterface | $time | The time service. |
Methods
Fetches from the cache backend, respecting the use caches flag.
Stores data in the persistent cache, respecting the use caches flag.
Constructs a ProviderRepository instance.
Details
protected object|false
cacheGet(string $cid)
Fetches from the cache backend, respecting the use caches flag.
protected
cacheSet(string $cid, mixed $data, int $expire = Cache::PERMANENT, array $tags = [])
Stores data in the persistent cache, respecting the use caches flag.
__construct(ClientInterface $http_client, ConfigFactoryInterface $config_factory, TimeInterface $time, CacheBackendInterface $cache_backend = NULL, int $max_age = 604800)
Constructs a ProviderRepository instance.
Provider[]
getAll()
Returns information on all available oEmbed providers.
Provider
get(string $provider_name)
Returns information for a specific oEmbed provider.