Upgraded drupal core with security updates
[yaffs-website] / web / core / lib / Drupal / Core / Cache / Context / UrlCacheContext.php
1 <?php
2
3 namespace Drupal\Core\Cache\Context;
4
5 use Drupal\Core\Cache\CacheableMetadata;
6
7 /**
8  * Defines the UrlCacheContext service, for "per page" caching.
9  *
10  * Cache context ID: 'url'.
11  */
12 class UrlCacheContext extends RequestStackCacheContextBase implements CacheContextInterface {
13
14   /**
15    * {@inheritdoc}
16    */
17   public static function getLabel() {
18     return t('URL');
19   }
20
21   /**
22    * {@inheritdoc}
23    */
24   public function getContext() {
25     return $this->requestStack->getCurrentRequest()->getUri();
26   }
27
28   /**
29    * {@inheritdoc}
30    */
31   public function getCacheableMetadata() {
32     return new CacheableMetadata();
33   }
34
35 }