Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3a6b28a

Browse filesBrowse files
[FrameworkBundle] Allow to pass signals to StopWorkerOnSignalsListener in XML config and as plain strings
1 parent 4813d66 commit 3a6b28a
Copy full SHA for 3a6b28a

File tree

2 files changed

+21
-1
lines changed
Filter options

2 files changed

+21
-1
lines changed

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
+20-1Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1630,9 +1630,28 @@ function ($a) {
16301630
->end()
16311631
->end()
16321632
->arrayNode('stop_worker_on_signals')
1633+
->fixXmlConfig('stop_worker_on_signal')
16331634
->defaultValue([])
16341635
->info('A list of signals that should stop the worker; defaults to SIGTERM and SIGINT.')
1635-
->integerPrototype()->end()
1636+
->beforeNormalization()
1637+
->always()
1638+
->then(function ($v) {
1639+
return array_map(static function ($element): int {
1640+
$element = \is_array($element) ? $element['signal'] : $element;
1641+
1642+
if (\is_string($element)) {
1643+
if (str_starts_with($element, 'SIG') && \array_key_exists($element, get_defined_constants(true)['pcntl'])) {
1644+
$element = \constant($element);
1645+
}
1646+
1647+
return $element;
1648+
}
1649+
1650+
return $element;
1651+
}, $v);
1652+
})
1653+
->end()
1654+
->scalarPrototype()->end()
16361655
->end()
16371656
->scalarNode('default_bus')->defaultNull()->end()
16381657
->arrayNode('buses')

‎src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,7 @@
581581
<xsd:element name="routing" type="messenger_routing" minOccurs="0" maxOccurs="unbounded" />
582582
<xsd:element name="transport" type="messenger_transport" minOccurs="0" maxOccurs="unbounded" />
583583
<xsd:element name="bus" type="messenger_bus" minOccurs="0" maxOccurs="unbounded" />
584+
<xsd:element name="stop-worker-on-signal" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
584585
</xsd:sequence>
585586
<xsd:attribute name="default-bus" type="xsd:string" />
586587
<xsd:attribute name="enabled" type="xsd:boolean" />

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.