示例#1
0
文件: Apcu.php 项目: froq/froq-cache
 /**
  * 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);
 }
示例#2
0
 /**
  * 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);
 }
示例#3
0
文件: File.php 项目: froq/froq-cache
 /**
  * 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);
 }