SphinxClient::SetServer PHP Method

SetServer() public method

set searchd host name (string) and port (integer)
public SetServer ( $host, $port )
    function SetServer($host, $port = 0)
    {
        assert(is_string($host));
        if ($host[0] == '/') {
            $this->_path = 'unix://' . $host;
            return;
        }
        if (substr($host, 0, 7) == "unix://") {
            $this->_path = $host;
            return;
        }
        $port = intval($port);
        assert(is_int($port));
        $this->_host = $host;
        $this->_port = $port;
        $this->_path = '';
    }

Usage Example

Esempio n. 1
0
 public function __construct(array $config)
 {
     parent::__construct($config);
     Kohana::load(Kohana::find_file('vendors', 'sphinxapi'));
     $this->_client = new SphinxClient();
     $this->_client->SetServer($this->config('host'), $this->config('port'));
 }
All Usage Examples Of SphinxClient::SetServer