Credis_Client::getPort PHP Method

getPort() public method

Return the port of the Redis instance
public getPort ( ) : integer
return integer
    public function getPort()
    {
        return $this->port;
    }

Usage Example

Example #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'));
 }
All Usage Examples Of Credis_Client::getPort