You are here

protected function VarnishPurgerBase::getOptions in Varnish purger 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/Purge/Purger/VarnishPurgerBase.php \Drupal\varnish_purger\Plugin\Purge\Purger\VarnishPurgerBase::getOptions()

Retrieve the Guzzle connection options to set.

Parameters

array $token_data: An array of keyed objects, to pass on to the token service.

Return value

mixed[] Associative array with option/value pairs.

2 calls to VarnishPurgerBase::getOptions()
VarnishBundledPurger::invalidate in src/Plugin/Purge/Purger/VarnishBundledPurger.php
Invalidate content from external caches.
VarnishPurger::invalidate in src/Plugin/Purge/Purger/VarnishPurger.php
Invalidate content from external caches.

File

src/Plugin/Purge/Purger/VarnishPurgerBase.php, line 136

Class

VarnishPurgerBase
Abstract base class for HTTP based configurable purgers.

Namespace

Drupal\varnish_purger\Plugin\Purge\Purger

Code

protected function getOptions($token_data) {
  $opt = [
    'http_errors' => $this->settings->http_errors,
    'connect_timeout' => $this->settings->connect_timeout,
    'timeout' => $this->settings->timeout,
    'headers' => $this
      ->getHeaders($token_data),
  ];
  if ($this->settings->scheme === 'https') {
    $opt['verify'] = (bool) $this->settings->verify;
  }
  return $opt;
}