@@ -150,7 +150,7 @@ protected function loadProducers()
150
150
$ definition ->addMethodCall ('disableAutoSetupFabric ' );
151
151
}
152
152
153
- if ($ producer ['audit ' ]) {
153
+ if ($ producer ['enable_logger ' ]) {
154
154
$ this ->injectLogger ($ definition );
155
155
}
156
156
@@ -183,7 +183,7 @@ protected function loadConsumers()
183
183
));
184
184
}
185
185
186
- if (isset ($ consumer ['idle_timeout ' ])) {
186
+ if (isset ($ consumer ['idle_timeout ' ])) {
187
187
$ definition ->addMethodCall ('setIdleTimeout ' , array ($ consumer ['idle_timeout ' ]));
188
188
}
189
189
if (!$ consumer ['auto_setup_fabric ' ]) {
@@ -195,7 +195,7 @@ protected function loadConsumers()
195
195
$ this ->injectLoggedChannel ($ definition , $ key , $ consumer ['connection ' ]);
196
196
}
197
197
198
- if ($ consumer ['audit ' ]) {
198
+ if ($ consumer ['enable_logger ' ]) {
199
199
$ this ->injectLogger ($ definition );
200
200
}
201
201
@@ -219,7 +219,7 @@ protected function loadMultipleConsumers()
219
219
}
220
220
221
221
foreach ($ consumer ['queues ' ] as $ queueName => $ queueOptions ) {
222
- $ queues [$ queueOptions ['name ' ]] = $ queueOptions ;
222
+ $ queues [$ queueOptions ['name ' ]] = $ queueOptions ;
223
223
$ queues [$ queueOptions ['name ' ]]['callback ' ] = array (new Reference ($ queueOptions ['callback ' ]), 'execute ' );
224
224
$ callbacks [] = new Reference ($ queueOptions ['callback ' ]);
225
225
}
@@ -246,7 +246,7 @@ protected function loadMultipleConsumers()
246
246
));
247
247
}
248
248
249
- if (isset ($ consumer ['idle_timeout ' ])) {
249
+ if (isset ($ consumer ['idle_timeout ' ])) {
250
250
$ definition ->addMethodCall ('setIdleTimeout ' , array ($ consumer ['idle_timeout ' ]));
251
251
}
252
252
if (!$ consumer ['auto_setup_fabric ' ]) {
@@ -258,7 +258,7 @@ protected function loadMultipleConsumers()
258
258
$ this ->injectLoggedChannel ($ definition , $ key , $ consumer ['connection ' ]);
259
259
}
260
260
261
- if ($ consumer ['audit ' ]) {
261
+ if ($ consumer ['enable_logger ' ]) {
262
262
$ this ->injectLogger ($ definition );
263
263
}
264
264
@@ -272,18 +272,18 @@ protected function loadMultipleConsumers()
272
272
}
273
273
}
274
274
}
275
-
275
+
276
276
protected function loadDynamicConsumers ()
277
- {
277
+ {
278
278
foreach ($ this ->config ['dynamic_consumers ' ] as $ key => $ consumer ) {
279
-
279
+
280
280
if (empty ($ consumer ['queue_options_provider ' ])) {
281
281
throw new InvalidConfigurationException (
282
282
"Error on loading $ key dynamic consumer. " .
283
283
"'queue_provider' parameter should be defined. "
284
284
);
285
285
}
286
-
286
+
287
287
$ definition = new Definition ('%old_sound_rabbit_mq.dynamic_consumer.class% ' );
288
288
$ definition
289
289
->addTag ('old_sound_rabbit_mq.base_amqp ' )
@@ -299,13 +299,13 @@ protected function loadDynamicConsumers()
299
299
$ consumer ['qos_options ' ]['global ' ]
300
300
));
301
301
}
302
-
302
+
303
303
$ definition ->addMethodCall (
304
- 'setQueueOptionsProvider ' ,
305
- array (new Reference ($ consumer ['queue_options_provider ' ]))
306
- );
307
-
308
- if (isset ($ consumer ['idle_timeout ' ])) {
304
+ 'setQueueOptionsProvider ' ,
305
+ array (new Reference ($ consumer ['queue_options_provider ' ]))
306
+ );
307
+
308
+ if (isset ($ consumer ['idle_timeout ' ])) {
309
309
$ definition ->addMethodCall ('setIdleTimeout ' , array ($ consumer ['idle_timeout ' ]));
310
310
}
311
311
if (!$ consumer ['auto_setup_fabric ' ]) {
@@ -317,7 +317,7 @@ protected function loadDynamicConsumers()
317
317
$ this ->injectLoggedChannel ($ definition , $ key , $ consumer ['connection ' ]);
318
318
}
319
319
320
- if ($ consumer ['audit ' ]) {
320
+ if ($ consumer ['enable_logger ' ]) {
321
321
$ this ->injectLogger ($ definition );
322
322
}
323
323
@@ -456,7 +456,7 @@ protected function loadRpcServers()
456
456
457
457
protected function injectLoggedChannel (Definition $ definition , $ name , $ connectionName )
458
458
{
459
- $ id = sprintf ('old_sound_rabbit_mq.channel.%s ' , $ name );
459
+ $ id = sprintf ('old_sound_rabbit_mq.channel.%s ' , $ name );
460
460
$ channel = new Definition ('%old_sound_rabbit_mq.logged.channel.class% ' );
461
461
$ channel
462
462
->setPublic (false )
@@ -487,12 +487,12 @@ public function getAlias()
487
487
*/
488
488
protected function addDequeuerAwareCall ($ callback , $ name )
489
489
{
490
- if (! $ this ->container ->has ($ callback )) {
490
+ if (!$ this ->container ->has ($ callback )) {
491
491
return ;
492
492
}
493
493
494
494
$ callbackDefinition = $ this ->container ->findDefinition ($ callback );
495
- $ refClass = new \ReflectionClass ($ callbackDefinition ->getClass ());
495
+ $ refClass = new \ReflectionClass ($ callbackDefinition ->getClass ());
496
496
if ($ refClass ->implementsInterface ('OldSound\RabbitMqBundle\RabbitMq\DequeuerAwareInterface ' )) {
497
497
$ callbackDefinition ->addMethodCall ('setDequeuer ' , array (new Reference ($ name )));
498
498
}
@@ -503,5 +503,8 @@ private function injectLogger(Definition $definition)
503
503
$ definition ->addTag ('monolog.logger ' , array (
504
504
'channel ' => 'phpamqplib '
505
505
));
506
+ if ($ this ->container ->has ('logger ' )) {
507
+ $ definition ->addMethodCall ('setLogger ' , array (new Reference ('logger ' )));
508
+ }
506
509
}
507
510
}
0 commit comments