1 | <?php |
||
0 ignored issues
–
show
Coding Style
introduced
by
![]() |
|||
2 | |||
3 | namespace Gewaer\Providers; |
||
4 | |||
5 | use Phalcon\Di\ServiceProviderInterface; |
||
6 | use Phalcon\DiInterface; |
||
7 | use Phalcon\Queue\Beanstalk\Extended as Beanstalk; |
||
8 | use function Gewaer\Core\envValue; |
||
9 | |||
10 | class QueueProvider implements ServiceProviderInterface |
||
11 | { |
||
12 | /** |
||
13 | * @param DiInterface $container |
||
14 | */ |
||
15 | 4 | public function register(DiInterface $container) |
|
16 | { |
||
17 | 4 | $container->setShared( |
|
18 | 4 | 'queue', |
|
19 | function () { |
||
20 | //Connect to the queue |
||
21 | 1 | $queue = new Beanstalk([ |
|
22 | 1 | 'host' => envValue('DATA_API_BEANSTALK_HOST', '127.0.0.1'), |
|
23 | 1 | 'prefix' => envValue('DATA_API_BEANSTALK_PORT', 11300), |
|
24 | ]); |
||
25 | |||
26 | 1 | return $queue; |
|
27 | 4 | } |
|
28 | ); |
||
29 | 4 | } |
|
30 | } |
||
31 |