class PageCacheRequestPolicy in Domain Access 8
A page cache request policy.
This service is not meant to DO anything, it's just meant to represent a service that might be present in the Drupal community. For example, persistent_login module has this same structure.
Hierarchy
- class \Drupal\domain_config_hook_test\PageCache\RequestPolicy\PageCacheRequestPolicy implements RequestPolicyInterface
Expanded class hierarchy of PageCacheRequestPolicy
1 string reference to 'PageCacheRequestPolicy'
- domain_config_hook_test.services.yml in domain_config/
tests/ modules/ domain_config_hook_test/ domain_config_hook_test.services.yml - domain_config/tests/modules/domain_config_hook_test/domain_config_hook_test.services.yml
1 service uses PageCacheRequestPolicy
- domain_config_service.page_cache_request_policy in domain_config/
tests/ modules/ domain_config_hook_test/ domain_config_hook_test.services.yml - Drupal\domain_config_hook_test\PageCache\RequestPolicy\PageCacheRequestPolicy
File
- domain_config/
tests/ modules/ domain_config_hook_test/ src/ PageCache/ RequestPolicy/ PageCacheRequestPolicy.php, line 17
Namespace
Drupal\domain_config_hook_test\PageCache\RequestPolicyView source
class PageCacheRequestPolicy implements RequestPolicyInterface {
/**
* Drupal config factory.
*
* @var \Drupal\Core\Config\ConfigFactory
*/
protected $configFactory;
/**
* Constructor.
*
* @param \Drupal\Core\Config\ConfigFactory $config_factory
* Drupal config factory.
*/
public function __construct(ConfigFactory $config_factory) {
$this->configFactory = $config_factory;
}
/**
* {@inheritdoc}
*/
public function check(Request $request) {
// This line is important. You have to use this service for it to fail.
$this->configFactory
->get('system.site');
return NULL;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PageCacheRequestPolicy:: |
protected | property | Drupal config factory. | |
PageCacheRequestPolicy:: |
public | function |
Determines whether delivery of a cached page should be attempted. Overrides RequestPolicyInterface:: |
|
PageCacheRequestPolicy:: |
public | function | Constructor. | |
RequestPolicyInterface:: |
constant | Allow delivery of cached pages. | ||
RequestPolicyInterface:: |
constant | Deny delivery of cached pages. |