From 88ad1cf88c5b3f429f955ab5837cef692a03c97a Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Mon, 16 Oct 2023 14:26:38 +0200 Subject: [PATCH] Mention PCNTL extension installation --- components/console/events.rst | 5 ++++- components/lock.rst | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/components/console/events.rst b/components/console/events.rst index 45f228e7399..92659aac82a 100644 --- a/components/console/events.rst +++ b/components/console/events.rst @@ -152,6 +152,8 @@ Listeners receive a It is then dispatched just after the ``ConsoleEvents::ERROR`` event. The exit code received in this case is the exception code. +.. _console_signal-event: + The ``ConsoleEvents::SIGNAL`` Event ----------------------------------- @@ -184,7 +186,8 @@ Listeners receive a .. tip:: All the available signals (``SIGINT``, ``SIGQUIT``, etc.) are defined as - `constants of the PCNTL PHP extension`_. + `constants of the PCNTL PHP extension`_. The extension has to be installed + for these constants to be available. If you use the Console component inside a Symfony application, commands can handle signals themselves. To do so, implement the diff --git a/components/lock.rst b/components/lock.rst index f38b8d27e63..14c787e16cd 100644 --- a/components/lock.rst +++ b/components/lock.rst @@ -269,6 +269,11 @@ Lock will be released automatically as soon as one process finishes:: } // ... +.. note:: + + In order for the above example to work, the `PCNTL`_ extension must be + installed. + To disable this behavior, set the ``autoRelease`` argument of ``LockFactory::createLock()`` to ``false``. That will make the lock acquired for 3600 seconds or until ``Lock::release()`` is called:: @@ -1074,3 +1079,4 @@ are still running. .. _`ZooKeeper`: https://zookeeper.apache.org/ .. _`readers-writer lock`: https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock .. _`priority policy`: https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock#Priority_policies +.. _`PCNTL`: https://www.php.net/manual/book.pcntl.php