X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flibs%2Fobjectcache%2FMemcachedBagOStuff.php;h=ff9dedf3a1d8a3bb73ec5370849316d5365264f7;hb=dca577c1f2d8b6efa6d549e3204face22f562e86;hp=cfbf2b3e805f1c855f4fc16f247368ef037f811f;hpb=37e011b5554dd9b2966ccfdbef9a9bc8309a233f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/objectcache/MemcachedBagOStuff.php b/includes/libs/objectcache/MemcachedBagOStuff.php index cfbf2b3e80..ff9dedf3a1 100644 --- a/includes/libs/objectcache/MemcachedBagOStuff.php +++ b/includes/libs/objectcache/MemcachedBagOStuff.php @@ -26,7 +26,7 @@ * * @ingroup Cache */ -abstract class MemcachedBagOStuff extends BagOStuff { +abstract class MemcachedBagOStuff extends MediumSpecificBagOStuff { function __construct( array $params ) { parent::__construct( $params ); @@ -34,20 +34,6 @@ abstract class MemcachedBagOStuff extends BagOStuff { $this->segmentationSize = $params['maxPreferedKeySize'] ?? 917504; // < 1MiB } - /** - * Fill in some defaults for missing keys in $params. - * - * @param array $params - * @return array - */ - protected function applyDefaultParams( $params ) { - return $params + [ - 'compress_threshold' => 1500, - 'connect_timeout' => 0.5, - 'debug' => false - ]; - } - /** * Construct a cache key. * @@ -115,13 +101,12 @@ abstract class MemcachedBagOStuff extends BagOStuff { * discarded immediately because the expiry is in the past. * Clamp expires >30d at 30d, unless they're >=1e9 in which * case they are likely to really be absolute (1e9 = 2011-09-09) - * @param int $expiry + * @param int $exptime * @return int */ - function fixExpiry( $expiry ) { - if ( $expiry > 2592000 && $expiry < 1000000000 ) { - $expiry = 2592000; - } - return (int)$expiry; + protected function fixExpiry( $exptime ) { + return ( $exptime > self::TTL_MONTH && !$this->isRelativeExpiration( $exptime ) ) + ? self::TTL_MONTH + : (int)$exptime; } }