Total Complexity | 2 |
Total Lines | 23 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types = 1); |
||
14 | class Client |
||
15 | { |
||
16 | /** |
||
17 | * Get a connection to sphinx using the values configured in YML files for port and host |
||
18 | * |
||
19 | * @return \Manticoresearch\Client Client object for accessing Manticore |
||
20 | */ |
||
21 | public function getConnection(): \Manticoresearch\Client |
||
22 | { |
||
23 | $host = Config::inst()->get('Suilven\ManticoreSearch\Service\Client', 'host'); |
||
24 | $port = Config::inst()->get('Suilven\ManticoreSearch\Service\Client', 'port'); |
||
25 | |||
26 | $config = ['host'=>$host, 'port'=>$port]; |
||
27 | |||
28 | return new \Manticoresearch\Client($config); |
||
29 | } |
||
30 | |||
31 | |||
32 | /** |
||
33 | * Execute reindex command. @todo Can this be done using SphinxQL? |
||
34 | */ |
||
35 | public function reindex(): void |
||
37 | // @todo |
||
38 | } |
||
40 |