| Conditions | 5 |
| Paths | 9 |
| Total Lines | 21 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function __construct(array $configs) |
||
| 16 | { |
||
| 17 | foreach ($configs as $name => $config) { |
||
| 18 | if (isset($config['dsn'])) { |
||
| 19 | $config = array_merge($config, parse_url($config['dsn'])); |
||
| 20 | } |
||
| 21 | |||
| 22 | if (isset($config['pass'])) { |
||
| 23 | $config['password'] = $config['pass']; |
||
| 24 | } |
||
| 25 | |||
| 26 | if (isset($config['path'])) { |
||
| 27 | $config['vhost'] = urldecode(substr($config['path'], 1)); |
||
| 28 | } |
||
| 29 | |||
| 30 | $check = new RabbitMQ($config['host'], $config['port'], $config['user'], $config['password'], $config['vhost']); |
||
| 31 | $check->setLabel(sprintf('Rabbit MQ "%s"', $name)); |
||
| 32 | |||
| 33 | $this->checks[sprintf('rabbit_mq_%s', $name)] = $check; |
||
| 34 | } |
||
| 35 | } |
||
| 36 | |||
| 45 |