public function __construct(array $config) { $this->_sphinx = new \SphinxClient(); if (isset($config['host'])) { if (!isset($config['host'])) { $config['port'] = 9312; } $this->_sphinx->SetServer($config['host'], $config['port']); } if (isset($config['retries'])) { if (!isset($config['delay'])) { $config['delay'] = 0; } $this->_sphinx->SetRetries($config['retries'], $config['delay']); } if (isset($config['timeout'])) { $this->_sphinx->SetConnectTimeout($config['timeout']); } }
<?php require "sphinxapi.php"; $cl = new SphinxClient(); $cl->SetRetries(10); $cl->Query('query');
<?php require "spec/fixtures/sphinxapi.php"; $cl = new SphinxClient(); $cl->SetRetries(10, 20); $cl->AddQuery('test1'); $cl->SetGroupBy('attr', SPH_GROUPBY_DAY); $cl->AddQuery('test2'); $cl->RunQueries();