function FinishResponseSubscriber::__construct

Same name in other branches
  1. 9 core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php \Drupal\Core\EventSubscriber\FinishResponseSubscriber::__construct()
  2. 8.9.x core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php \Drupal\Core\EventSubscriber\FinishResponseSubscriber::__construct()
  3. 10 core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php \Drupal\Core\EventSubscriber\FinishResponseSubscriber::__construct()

Constructs a FinishResponseSubscriber object.

Parameters

\Drupal\Core\Language\LanguageManagerInterface $languageManager: 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 $requestPolicy: A policy rule determining the cacheability of a request.

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

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

\Drupal\Component\Datetime\TimeInterface $time: The time service.

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

File

core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php, line 50

Class

FinishResponseSubscriber
Response subscriber to handle finished responses.

Namespace

Drupal\Core\EventSubscriber

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.