You are here

public function ClientIpRestore::__construct in CloudFlare 8

Constructs a ClientIpRestore.

Parameters

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The factory for configuration objects.

\Drupal\Core\Cache\CacheBackendInterface $cache: Cache backend.

\GuzzleHttp\ClientInterface $http_client: A Guzzle client object.

\Psr\Log\LoggerInterface $logger: A logger instance.

File

src/EventSubscriber/ClientIpRestore.php, line 79

Class

ClientIpRestore
Restores the true client Ip address.

Namespace

Drupal\cloudflare\EventSubscriber

Code

public function __construct(ConfigFactoryInterface $config_factory, CacheBackendInterface $cache, ClientInterface $http_client, LoggerInterface $logger) {
  $this->httpClient = $http_client;
  $this->cache = $cache;
  $this->config = $config_factory
    ->get('cloudflare.settings');
  $this->logger = $logger;
  $this->isClientIpRestoreEnabled = $this->config
    ->get(SELF::CLOUDFLARE_CLIENT_IP_RESTORE_ENABLED);
  $this->bypassHost = $this->config
    ->get(SELF::CLOUDFLARE_BYPASS_HOST);
}