|
58 | 58 | * - fingers_crossed: |
59 | 59 | * - handler: the wrapped handler's name |
60 | 60 | * - [action_level|activation_strategy]: minimum level or service id to activate the handler, defaults to WARNING |
| 61 | + * - [excluded_404s]: if set, the strategy will be changed to one that excludes 404s coming from URLs matching any of those patterns |
61 | 62 | * - [buffer_size]: defaults to 0 (unlimited) |
62 | 63 | * - [stop_buffering]: bool to disable buffering once the handler has been activated, defaults to true |
63 | 64 | * - [bubble]: bool, defaults to true |
@@ -205,6 +206,10 @@ public function getConfigTreeBuilder() |
205 | 206 | ->scalarNode('action_level')->defaultValue('WARNING')->end() // fingers_crossed |
206 | 207 | ->scalarNode('activation_strategy')->defaultNull()->end() // fingers_crossed |
207 | 208 | ->booleanNode('stop_buffering')->defaultTrue()->end()// fingers_crossed |
| 209 | + ->arrayNode('excluded_404s') // fingers_crossed |
| 210 | + ->canBeUnset() |
| 211 | + ->prototype('scalar')->end() |
| 212 | + ->end() |
208 | 213 | ->scalarNode('buffer_size')->defaultValue(0)->end() // fingers_crossed and buffer |
209 | 214 | ->scalarNode('handler')->end() // fingers_crossed and buffer |
210 | 215 | ->scalarNode('url')->end() // cube |
@@ -391,6 +396,10 @@ public function getConfigTreeBuilder() |
391 | 396 | ->ifTrue(function($v) { return ('fingers_crossed' === $v['type'] || 'buffer' === $v['type']) && 1 !== count($v['handler']); }) |
392 | 397 | ->thenInvalid('The handler has to be specified to use a FingersCrossedHandler or BufferHandler') |
393 | 398 | ->end() |
| 399 | + ->validate() |
| 400 | + ->ifTrue(function($v) { return 'fingers_crossed' === $v['type'] && !empty($v['excluded_404s']) && !empty($v['activation_strategy']); }) |
| 401 | + ->thenInvalid('You can not use excluded_404s together with a custom activation_strategy in a FingersCrossedHandler') |
| 402 | + ->end() |
394 | 403 | ->validate() |
395 | 404 | ->ifTrue(function($v) { return 'swift_mailer' === $v['type'] && empty($v['email_prototype']) && (empty($v['from_email']) || empty($v['to_email']) || empty($v['subject'])); }) |
396 | 405 | ->thenInvalid('The sender, recipient and subject or an email prototype have to be specified to use a SwiftMailerHandler') |
|
0 commit comments