feature/cierres (#25)
Varios cambios Co-authored-by: Juan Pablo Vial <jpvialb@incoviba.cl> Reviewed-on: #25
This commit is contained in:
30
cli/setup/setups/services.php
Normal file
30
cli/setup/setups/services.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
use Psr\Container\ContainerInterface;
|
||||
|
||||
return [
|
||||
Predis\ClientInterface::class => function(ContainerInterface $container) {
|
||||
$options = [
|
||||
'scheme' => 'tcp',
|
||||
'host' => $container->has('REDIS_HOST') ? $container->get('REDIS_HOST') : 'redis',
|
||||
'port' => $container->has('REDIS_PORT') ? $container->get('REDIS_PORT') : 6379
|
||||
];
|
||||
if ($container->has('REDIS_USER')) {
|
||||
$options['username'] = $container->get('REDIS_USER');
|
||||
}
|
||||
if ($container->has('REDIS_PASSWORD')) {
|
||||
$options['password'] = $container->get('REDIS_PASSWORD');
|
||||
}
|
||||
return new Predis\Client($options);
|
||||
},
|
||||
Pheanstalk\Pheanstalk::class => function(ContainerInterface $container) {
|
||||
return Pheanstalk\Pheanstalk::create(
|
||||
$container->get('BEANSTALKD_HOST'),
|
||||
$container->has('BEANSTALKD_PORT') ? $container->get('BEANSTALKD_PORT') : 11300
|
||||
);
|
||||
},
|
||||
Incoviba\Service\MQTT\MQTTInterface::class => function(ContainerInterface $container) {
|
||||
$service = new Incoviba\Service\MQTT($container->get(Psr\Log\LoggerInterface::class));
|
||||
$service->register('default', $container->get(Incoviba\Service\MQTT\Pheanstalk::class));
|
||||
return $service;
|
||||
}
|
||||
];
|
Reference in New Issue
Block a user