You are here

public function CacheableResponseSubscriber::__construct in Pantheon Advanced Page Cache 8

Constructs a new DefaultExceptionHtmlSubscriber.

Parameters

\Psr\Log\LoggerInterface $logger: The logger service.

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: Configuration for this module.

File

src/EventSubscriber/CacheableResponseSubscriber.php, line 40

Class

CacheableResponseSubscriber
Adds Surrogate-Key header to cacheable master responses.

Namespace

Drupal\pantheon_advanced_page_cache\EventSubscriber

Code

public function __construct(LoggerInterface $logger, ConfigFactoryInterface $config_factory = NULL) {
  if (!$config_factory instanceof ConfigFactoryInterface) {
    @trigger_error('Not passing the config factory service as the second parameter to ' . __METHOD__ . ' is deprecated in pantheon_advanced_page_cache:8.x-1.2 and will throw a type error in pantheon_advanced_page_cache:8.x-2.0. Pass an instance of \\Drupal\\Core\\Config\\ConfigFactoryInterface. See https://www.drupal.org/node/2944229', E_USER_DEPRECATED);
    $config_factory = \Drupal::service('config.factory');
  }
  $this->logger = $logger;
  $this->configFactory = $config_factory;
}