getPort() public method

Return the port of the Redis instance
public getPort ( ) : integer
return integer
コード例 #1
0
ファイル: CredisTest.php プロジェクト: colinmollenhour/credis
 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'));
 }
コード例 #2
0
ファイル: Sentinel.php プロジェクト: cboelter/credis
 /**
  * @return int
  */
 public function getPort()
 {
     return $this->_client->getPort();
 }