You are here

public function FinishResponseSubscriber::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php \Drupal\Core\EventSubscriber\FinishResponseSubscriber::__construct()

Constructs a FinishResponseSubscriber object.

Parameters

\Drupal\Core\Language\LanguageManagerInterface $language_manager: The language manager object for retrieving the correct language code.

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: A config factory for retrieving required config objects.

\Drupal\Core\PageCache\RequestPolicyInterface $request_policy: A policy rule determining the cacheability of a request.

\Drupal\Core\PageCache\ResponsePolicyInterface $response_policy: A policy rule determining the cacheability of a response.

\Drupal\Core\Cache\Context\CacheContextsManager $cache_contexts_manager: The cache contexts manager service.

bool $http_response_debug_cacheability_headers: (optional) Whether to send cacheability headers for debugging purposes.

File

core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php, line 87
Contains \Drupal\Core\EventSubscriber\FinishResponseSubscriber.

Class

FinishResponseSubscriber
Response subscriber to handle finished responses.

Namespace

Drupal\Core\EventSubscriber

Code

public function __construct(LanguageManagerInterface $language_manager, ConfigFactoryInterface $config_factory, RequestPolicyInterface $request_policy, ResponsePolicyInterface $response_policy, CacheContextsManager $cache_contexts_manager, $http_response_debug_cacheability_headers = FALSE) {
  $this->languageManager = $language_manager;
  $this->config = $config_factory
    ->get('system.performance');
  $this->requestPolicy = $request_policy;
  $this->responsePolicy = $response_policy;
  $this->cacheContextsManager = $cache_contexts_manager;
  $this->debugCacheabilityHeaders = $http_response_debug_cacheability_headers;
}