You are here

protected function AcquiaCloudPurger::getGlobalOptions in Acquia Purge 8

Retrieve request options used for all of Acquia Purge's balancer requests.

Parameters

array[] $extra: Associative array of options to merge onto the standard ones.

Return value

mixed[] Guzzle option array.

2 calls to AcquiaCloudPurger::getGlobalOptions()
AcquiaCloudPurger::getResultsConcurrently in src/Plugin/Purge/Purger/AcquiaCloudPurger.php
Concurrently execute the given requests.
AcquiaCloudPurger::invalidateEverything in src/Plugin/Purge/Purger/AcquiaCloudPurger.php
Invalidate the entire website.

File

src/Plugin/Purge/Purger/AcquiaCloudPurger.php, line 110

Class

AcquiaCloudPurger
Acquia Cloud.

Namespace

Drupal\acquia_purge\Plugin\Purge\Purger

Code

protected function getGlobalOptions(array $extra = []) {
  $opt = [
    // Disable exceptions for 4XX HTTP responses, those aren't failures to us.
    'http_errors' => FALSE,
    // Prevent inactive balancers from sucking all runtime up.
    'connect_timeout' => self::CONNECT_TIMEOUT,
    // Prevent unresponsive balancers from making Drupal slow.
    'timeout' => self::TIMEOUT,
    // Deliberately disable SSL verification to prevent unsigned certificates
    // from breaking down a website when purging a https:// URL!
    'verify' => FALSE,
    // Trigger \Drupal\acquia_purge\Http\AcquiaCloudBalancerMiddleware which
    // inspects Acquia Cloud responses and throws exceptions for failures.
    'acquia_purge_balancer_middleware' => TRUE,
  ];

  // Trigger the debugging middleware when Purge's debug mode is enabled.
  if ($this
    ->debugger()
    ->enabled()) {
    $opt['acquia_purge_debugger'] = $this
      ->debugger();
  }
  return array_merge($opt, $extra);
}