You are here

protected function FastlyBackend::fastlyRequestUri in Acquia Purge 8

Get a fully qualified Fastly API uri in which 'service_id' is replaced.

This helper can be used similar to sprintf() by passing in placeholders like '%s' and '%d' to get substituted URLs, for example: $this->fastlyRequestUri('service/service_id/purge/%s', $key)

Parameters

string $path: The API path on the Fastly API.

Return value

string Fastly API uri with 'service_id' replaced.

2 calls to FastlyBackend::fastlyRequestUri()
FastlyBackend::invalidateEverything in src/AcquiaPlatformCdn/FastlyBackend.php
Invalidate all 'everything' invalidations.
FastlyBackend::invalidateTags in src/AcquiaPlatformCdn/FastlyBackend.php
Invalidate all 'tag' invalidations.

File

src/AcquiaPlatformCdn/FastlyBackend.php, line 265

Class

FastlyBackend
Provides a Fastly backend for the Platform CDN purger.

Namespace

Drupal\acquia_purge\AcquiaPlatformCdn

Code

protected function fastlyRequestUri($path) {
  $args = func_get_args();
  $args[0] = str_replace('service_id', $this->serviceId, $args[0]);
  $args[0] = ltrim($args[0], '/');
  return self::API_ENDPOINT . call_user_func_array('sprintf', $args);
}