Exception
9 months ago
Logging
9 months ago
Persister
9 months ago
Region
9 months ago
AssociationCacheEntry.php
9 months ago
CacheConfiguration.php
9 months ago
CacheEntry.php
9 months ago
CacheException.php
9 months ago
CacheFactory.php
9 months ago
CacheKey.php
9 months ago
CollectionCacheEntry.php
9 months ago
CollectionCacheKey.php
9 months ago
CollectionHydrator.php
9 months ago
ConcurrentRegion.php
9 months ago
DefaultCache.php
9 months ago
DefaultCacheFactory.php
9 months ago
DefaultCollectionHydrator.php
9 months ago
DefaultEntityHydrator.php
9 months ago
DefaultQueryCache.php
9 months ago
EntityCacheEntry.php
9 months ago
EntityCacheKey.php
9 months ago
EntityHydrator.php
9 months ago
Lock.php
9 months ago
LockException.php
9 months ago
MultiGetRegion.php
9 months ago
QueryCache.php
9 months ago
QueryCacheEntry.php
9 months ago
QueryCacheKey.php
9 months ago
QueryCacheValidator.php
9 months ago
Region.php
9 months ago
RegionsConfiguration.php
9 months ago
TimestampCacheEntry.php
9 months ago
TimestampCacheKey.php
9 months ago
TimestampQueryCacheValidator.php
9 months ago
TimestampRegion.php
9 months ago
index.php
9 months ago
RegionsConfiguration.php
49 lines
| 1 | <?php |
| 2 | declare (strict_types=1); |
| 3 | namespace MailPoetVendor\Doctrine\ORM\Cache; |
| 4 | if (!defined('ABSPATH')) exit; |
| 5 | class RegionsConfiguration |
| 6 | { |
| 7 | private $lifetimes = []; |
| 8 | private $lockLifetimes = []; |
| 9 | private $defaultLifetime; |
| 10 | private $defaultLockLifetime; |
| 11 | public function __construct($defaultLifetime = 3600, $defaultLockLifetime = 60) |
| 12 | { |
| 13 | $this->defaultLifetime = (int) $defaultLifetime; |
| 14 | $this->defaultLockLifetime = (int) $defaultLockLifetime; |
| 15 | } |
| 16 | public function getDefaultLifetime() |
| 17 | { |
| 18 | return $this->defaultLifetime; |
| 19 | } |
| 20 | public function setDefaultLifetime($defaultLifetime) |
| 21 | { |
| 22 | $this->defaultLifetime = (int) $defaultLifetime; |
| 23 | } |
| 24 | public function getDefaultLockLifetime() |
| 25 | { |
| 26 | return $this->defaultLockLifetime; |
| 27 | } |
| 28 | public function setDefaultLockLifetime($defaultLockLifetime) |
| 29 | { |
| 30 | $this->defaultLockLifetime = (int) $defaultLockLifetime; |
| 31 | } |
| 32 | public function getLifetime($regionName) |
| 33 | { |
| 34 | return $this->lifetimes[$regionName] ?? $this->defaultLifetime; |
| 35 | } |
| 36 | public function setLifetime($name, $lifetime) |
| 37 | { |
| 38 | $this->lifetimes[$name] = (int) $lifetime; |
| 39 | } |
| 40 | public function getLockLifetime($regionName) |
| 41 | { |
| 42 | return $this->lockLifetimes[$regionName] ?? $this->defaultLockLifetime; |
| 43 | } |
| 44 | public function setLockLifetime($name, $lifetime) |
| 45 | { |
| 46 | $this->lockLifetimes[$name] = (int) $lifetime; |
| 47 | } |
| 48 | } |
| 49 |