class HtmlResponseBigPipeSessionlessSubscriber in Sessionless BigPipe 8
Same name and namespace in other branches
- 2.x src/EventSubscriber/HtmlResponseBigPipeSessionlessSubscriber.php \Drupal\big_pipe_sessionless\EventSubscriber\HtmlResponseBigPipeSessionlessSubscriber
Response subscriber to replace the HtmlResponse with a BigPipeResponse.
Intended to replace the html_response.big_pipe_subscriber service, to use either the BigPipe service or the BigPipeSessionless service.
Hierarchy
- class \Drupal\big_pipe\EventSubscriber\HtmlResponseBigPipeSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
- class \Drupal\big_pipe_sessionless\EventSubscriber\HtmlResponseBigPipeSessionlessSubscriber
Expanded class hierarchy of HtmlResponseBigPipeSessionlessSubscriber
See also
\Drupal\big_pipe\EventSubscriber\HtmlResponseBigPipeSubscriber
\Drupal\big_pipe_sessionless\BigPipeSessionlessServiceProvider::alter
1 file declares its use of HtmlResponseBigPipeSessionlessSubscriber
File
- src/
EventSubscriber/ HtmlResponseBigPipeSessionlessSubscriber.php, line 20
Namespace
Drupal\big_pipe_sessionless\EventSubscriberView source
class HtmlResponseBigPipeSessionlessSubscriber extends HtmlResponseBigPipeSubscriber {
/**
* The BigPipeSessionless service.
*
* @var \Drupal\big_pipe_sessionless\Render\BigPipeSessionless
*/
protected $bigPipeSessionless;
/**
* The session configuration.
*
* @var \Drupal\Core\Session\SessionConfigurationInterface
*/
protected $sessionConfiguration;
/**
* Constructs a HtmlResponseBigPipeSessionlessSubscriber object.
*
* @param \Drupal\big_pipe\Render\BigPipe $big_pipe
* The BigPipe service.
* @param \Drupal\big_pipe_sessionless\Render\BigPipeSessionless $big_pipe_sessionless
* The BigPipeSessionless service.
* @param \Drupal\Core\Session\SessionConfigurationInterface $session_configuration
* The session configuration.
*/
public function __construct(BigPipe $big_pipe, BigPipeSessionless $big_pipe_sessionless, SessionConfigurationInterface $session_configuration) {
parent::__construct($big_pipe);
$this->bigPipeSessionless = $big_pipe_sessionless;
$this->sessionConfiguration = $session_configuration;
}
/**
* {@inheritdoc}
*/
protected function getBigPipeService(FilterResponseEvent $event) {
// Returns the BigPipeSessionless service for sessionless requests.
return $this->sessionConfiguration
->hasSession($event
->getRequest()) ? $this->bigPipe : $this->bigPipeSessionless;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
HtmlResponseBigPipeSessionlessSubscriber:: |
protected | property | The BigPipeSessionless service. | |
HtmlResponseBigPipeSessionlessSubscriber:: |
protected | property | The session configuration. | |
HtmlResponseBigPipeSessionlessSubscriber:: |
protected | function |
Returns the BigPipe service to use to send the current response. Overrides HtmlResponseBigPipeSubscriber:: |
|
HtmlResponseBigPipeSessionlessSubscriber:: |
public | function |
Constructs a HtmlResponseBigPipeSessionlessSubscriber object. Overrides HtmlResponseBigPipeSubscriber:: |
|
HtmlResponseBigPipeSubscriber:: |
protected | property | The BigPipe service. | |
HtmlResponseBigPipeSubscriber:: |
public static | function | Returns an array of event names this subscriber wants to listen to. | |
HtmlResponseBigPipeSubscriber:: |
public | function | Transforms a HtmlResponse to a BigPipeResponse. | |
HtmlResponseBigPipeSubscriber:: |
public | function | Adds markers to the response necessary for the BigPipe render strategy. |