public function FinishResponseSubscriber::__construct

public FinishResponseSubscriber::__construct(LanguageManagerInterface $language_manager, ConfigFactoryInterface $config_factory, RequestPolicyInterface $request_policy, ResponsePolicyInterface $response_policy, CacheContextsManager $cache_contexts_manager, $http_response_debug_cacheability_headers = FALSE)

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 82

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;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!EventSubscriber!FinishResponseSubscriber.php/function/FinishResponseSubscriber::__construct/8.1.x