Credis_Client::getHost PHP Method

getHost() public method

Return the host of the Redis instance
public getHost ( ) : string
return string
    public function getHost()
    {
        return $this->host;
    }

Usage Example

Esempio n. 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::getHost