objectcache: Use constant for $ttl param default in WANObjectCache::set()
authorAndrew Green <andrew.green.df@gmail.com>
Mon, 17 Oct 2016 15:21:08 +0000 (10:21 -0500)
committerTimo Tijhof <krinklemail@gmail.com>
Fri, 8 Mar 2019 23:48:22 +0000 (23:48 +0000)
Change-Id: I3f936088cd63af4d535d7f46fe5619e8bb866999

includes/libs/objectcache/WANObjectCache.php

index bed7965..c9982d7 100644 (file)
@@ -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;