From: Andrew Green Date: Mon, 17 Oct 2016 15:21:08 +0000 (-0500) Subject: objectcache: Use constant for $ttl param default in WANObjectCache::set() X-Git-Tag: 1.34.0-rc.0~2586^2 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_add%27%29%20%7D%7D?a=commitdiff_plain;h=b9568e64d9c2cd9050839d4d4cbb3bba0490fdc3;p=lhc%2Fweb%2Fwiklou.git objectcache: Use constant for $ttl param default in WANObjectCache::set() Change-Id: I3f936088cd63af4d535d7f46fe5619e8bb866999 --- diff --git a/includes/libs/objectcache/WANObjectCache.php b/includes/libs/objectcache/WANObjectCache.php index bed7965149..c9982d7db3 100644 --- a/includes/libs/objectcache/WANObjectCache.php +++ b/includes/libs/objectcache/WANObjectCache.php @@ -525,7 +525,7 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface { * @param string $key Cache key * @param mixed $value * @param int $ttl Seconds to live. Special values are: - * - WANObjectCache::TTL_INDEFINITE: Cache forever + * - WANObjectCache::TTL_INDEFINITE: Cache forever (default) * @param array $opts Options map: * - lag : Seconds of replica DB lag. Typically, this is either the replica DB lag * before the data was read or, if applicable, the replica DB lag before @@ -554,7 +554,7 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface { * @note Options added in 1.28: staleTTL * @return bool Success */ - final public function set( $key, $value, $ttl = 0, array $opts = [] ) { + final public function set( $key, $value, $ttl = self::TTL_INDEFINITE, array $opts = [] ) { $now = $this->getCurrentTime(); $lockTSE = $opts['lockTSE'] ?? self::TSE_NONE; $staleTTL = $opts['staleTTL'] ?? self::STALE_TTL_NONE;