Credis_Client::forceStandalone PHP Method

forceStandalone() public method

public forceStandalone ( ) : Credis_Client
return 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;
    }

Usage Example

Example #1
0
 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();
     }
 }
All Usage Examples Of Credis_Client::forceStandalone