public forceStandalone ( ) : Credis_Client | ||
Результат | Credis_Client |
public function forceStandalone()
{
if ($this->standalone) {
return $this;
}
if ($this->connected) {
throw new CredisException('Cannot force Credis_Client to use standalone PHP driver after a connection has already been established.');
}
$this->standalone = TRUE;
return $this;
}
protected function setUp() { if ($this->config === NULL) { $configFile = dirname(__FILE__) . '/test_config.json'; if (!file_exists($configFile) || !($config = file_get_contents($configFile))) { $this->markTestSkipped('Could not load ' . $configFile); } $this->config = json_decode($config); } $this->credis = new Credis_Client($this->config->host, $this->config->port, $this->config->timeout); if ($this->useStandalone) { $this->credis->forceStandalone(); } }