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;
}
doc_Drupal
2016-10-29 09:14:58
Comments
Leave a Comment

Please login to continue.