getPort() public method

Return the port of the Redis instance
public getPort ( ) : integer
return integer
Beispiel #1
0
 public function testConnectionStrings()
 {
     $this->credis->close();
     $this->credis = new Credis_Client('tcp://' . $this->config[0]->host . ':' . $this->config[0]->port);
     $this->assertEquals($this->credis->getHost(), $this->config[0]->host);
     $this->assertEquals($this->credis->getPort(), $this->config[0]->port);
     $this->credis = new Credis_Client('tcp://' . $this->config[0]->host);
     $this->assertEquals($this->credis->getPort(), $this->config[0]->port);
     $this->credis = new Credis_Client('tcp://' . $this->config[0]->host . ':' . $this->config[0]->port . '/abc123');
     $this->assertEquals('abc123', $this->credis->getPersistence());
     $this->credis = new Credis_Client(realpath(__DIR__) . '/redis.sock', 0, null, 'persistent');
     $this->credis->connect();
     $this->credis->set('key', 'value');
     $this->assertEquals('value', $this->credis->get('key'));
 }
Beispiel #2
0
 /**
  * @return int
  */
 public function getPort()
 {
     return $this->_client->getPort();
 }