示例#1
0
 public function setUp()
 {
     parent::setup();
     if (!extension_loaded('mysqlnd')) {
         $this->markTestSkipped('The MySQLnd extension is not available.');
     }
     $this->cache = new Cache(new MySQL($this->config['mysql']['host'], $this->config['mysql']['user'], $this->config['mysql']['password'], $this->config['mysql']['database'], $this->config['mysql']['port']));
 }
示例#2
0
 public function setUp()
 {
     parent::setup();
     if (!class_exists('Mongo')) {
         $this->markTestSkipped('The Mongo extension is not available.');
     }
     $this->cache = new Cache(new Mongo($this->config['mongo']['dns']));
 }
示例#3
0
 public function setUp()
 {
     parent::setup();
     if (!extension_loaded('apc') || !ini_get('apc.enable_cli')) {
         $this->markTestSkipped('The APC extension is not available.');
     }
     $this->cache = new Cache(new Apc());
 }
示例#4
0
 public function setUp()
 {
     parent::setup();
     if (!extension_loaded('memcached') || !class_exists('\\Memcache')) {
         $this->markTestSkipped('The Memcache extension is not available.');
     }
     $adapter = new MemCache();
     $adapter->addServer('localhost', 11211);
     $this->cache = new Cache($adapter);
 }
示例#5
0
 public function setUp()
 {
     parent::setup();
     if (!extension_loaded('memcached') || !class_exists('\\Memcached')) {
         $this->markTestSkipped('The Memcached extension is not available.');
     }
     $data = [['host' => 'localhost', 'port' => 11211, 'weight' => 0]];
     $adapter = new Memcached($data);
     $this->cache = new Cache($adapter);
 }
示例#6
0
 public function setUp()
 {
     parent::setup();
     $this->cache = new Cache(new File($this->config['file']['dir']));
 }
示例#7
0
 public function setUp()
 {
     parent::setup();
     $this->cache = new Cache(new Redis());
 }