/** * Set a value identified by $key and with an optional $ttl. * * @param string $key * @param mixed $value * @param int $ttl * * @return $this */ public function set($key, $value, $ttl = 0) { $ttl = $this->fromDefaultTtl($ttl); if ($ttl >= 0) { $this->memcached->set($key, $value); if ($ttl > 0) { $this->memcached->touch($key, \time() + $ttl); } $this->setChain($key, $value, $ttl); } return $this; }