예제 #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);
 }