Mercurial > hg > isophonics-drupal-site
annotate core/lib/Drupal/Core/PageCache/DefaultRequestPolicy.php @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | 4c8ae668cc8c |
children |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 namespace Drupal\Core\PageCache; |
Chris@0 | 4 |
Chris@0 | 5 use Drupal\Core\PageCache\RequestPolicy\CommandLineOrUnsafeMethod; |
Chris@0 | 6 use Drupal\Core\PageCache\RequestPolicy\NoSessionOpen; |
Chris@0 | 7 use Drupal\Core\Session\SessionConfigurationInterface; |
Chris@0 | 8 |
Chris@0 | 9 /** |
Chris@0 | 10 * The default page cache request policy. |
Chris@0 | 11 * |
Chris@0 | 12 * Delivery of cached pages is denied if either the application is running from |
Chris@0 | 13 * the command line or the request was not initiated with a safe method (GET or |
Chris@0 | 14 * HEAD). Also caching is only allowed for requests without a session cookie. |
Chris@0 | 15 */ |
Chris@0 | 16 class DefaultRequestPolicy extends ChainRequestPolicy { |
Chris@0 | 17 |
Chris@0 | 18 /** |
Chris@0 | 19 * Constructs the default page cache request policy. |
Chris@0 | 20 * |
Chris@0 | 21 * @param \Drupal\Core\Session\SessionConfigurationInterface $session_configuration |
Chris@0 | 22 * The session configuration. |
Chris@0 | 23 */ |
Chris@0 | 24 public function __construct(SessionConfigurationInterface $session_configuration) { |
Chris@0 | 25 $this->addPolicy(new CommandLineOrUnsafeMethod()); |
Chris@0 | 26 $this->addPolicy(new NoSessionOpen($session_configuration)); |
Chris@0 | 27 } |
Chris@0 | 28 |
Chris@0 | 29 } |