/** * Constructor. * @param string $host * @param int $port */ public final function __construct(int $ttl = self::DEFAULT_TTL) { if (!extension_loaded('apcu')) { throw new CacheException("APCu extension not found!"); } parent::__construct(Cache::AGENT_APCU, $ttl); }
/** * Constructor. * @param string $host * @param int $port */ public final function __construct(string $host = self::DEFAULT_HOST, int $port = self::DEFAULT_PORT, int $ttl = self::DEFAULT_TTL) { if (!extension_loaded('memcached')) { throw new CacheException("Redis extension not found!"); } $this->host = $host; $this->port = $port; parent::__construct(Cache::AGENT_MEMCACHED, $ttl); }
/** * Constructor. * @param string $host * @param int $port */ public final function __construct(string $dir = null, int $ttl = self::DEFAULT_TTL) { $this->dir = $dir; parent::__construct(Cache::AGENT_FILE, $ttl); }