Conditions | 3 |
Paths | 6 |
Total Lines | 20 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | public function call() |
||
18 | { |
||
19 | $builder = $this->getBuilder(); |
||
20 | |||
21 | $options = $this->getParam('options', null); |
||
22 | |||
23 | try { |
||
24 | $client = new Client($options); |
||
25 | } catch (\Exception $e) { |
||
26 | $builder->down()->withData("error", "Solr Client Error - " . $e->getMessage()); |
||
27 | } |
||
28 | |||
29 | try { |
||
30 | $ping = $client->createPing(); |
||
31 | $client->ping($ping); |
||
32 | } catch (ExceptionInterface $e) { |
||
33 | $builder->down()->withData("error", "Could not open connection to server - " . $e->getMessage()); |
||
34 | } |
||
35 | |||
36 | return $builder->build(); |
||
37 | } |
||
39 |