/** * Sets the Redis APIs. * * @param array $redisAPIs The Redis APIs. * @param string $name The lock name. * @param int $timeout The time in seconds a lock expires, default is 3. * * @throws \LengthException The timeout must be greater than 0. */ public function __construct(array $redisAPIs, $name, $timeout = 3) { parent::__construct($name, $timeout); $this->redisAPIs = $redisAPIs; $this->logger = new NullLogger(); $this->seedRandom(); }
/** * Sets the lock's name and the connected Memcache API. * * The Memcache API needs to be connected to a server. * I.e. Memcache::connect() was already called. * * @param string $name The lock name. * @param Memcache $memcache The connected Memcache API. * @param int $timeout The time in seconds a lock expires, default is 3. * * @throws \LengthException The timeout must be greater than 0. */ public function __construct($name, Memcache $memcache, $timeout = 3) { parent::__construct($name, $timeout); $this->memcache = $memcache; }
/** * Sets the lock's name and the connected Memcache API. * * The Memcache API needs to be connected to a server. * I.e. Memcache::connect() was already called. * * @param string $name The lock name. * @param Memcache $memcache The connected Memcache API. * @param int $timeout The time in seconds a lock expires, default is 3. * * @throws \LengthException The timeout must be greater than 0. */ public function __construct($name, Memcache $memcache, $timeout = 3) { parent::__construct($name, $timeout); trigger_error("MemcacheMutex has been deprecated in favour of MemcachedMutex.", E_USER_DEPRECATED); $this->memcache = $memcache; }