From 859c1f9dccc53c0dbfe3dbc652af5b9cc9aa1a09 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 7 Mar 2018 13:33:38 +0100 Subject: [PATCH 1/2] Documented the new isTtySupported() method --- components/process.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/components/process.rst b/components/process.rst index fb789297527..62f14c4da96 100644 --- a/components/process.rst +++ b/components/process.rst @@ -422,6 +422,20 @@ absolute path of the executable PHP binary available on your server:: $phpBinaryPath = $phpBinaryFinder->find(); // $phpBinaryPath = '/usr/local/bin/php' (the result will be different on your computer) +Checking for TTY Support +------------------------ + +Another utility provided by this component is a method called +:method:`Symfony\\Component\\Process\\Process::isTtySupported` which returns +whether `TTY`_ is supported on the current operating system:: + + use Symfony\Component\Process\Process; + + $process = (new Process)->setTty(Process::isTtySupported()); + +.. versionadded:: 4.1 + The ``isTtySupported()`` method was introduced in Symfony 4.1. + .. _`Symfony Issue#5759`: https://github.com/symfony/symfony/issues/5759 .. _`PHP Bug#39992`: https://bugs.php.net/bug.php?id=39992 .. _`exec`: https://en.wikipedia.org/wiki/Exec_(operating_system) @@ -429,3 +443,4 @@ absolute path of the executable PHP binary available on your server:: .. _`PHP Documentation`: https://php.net/manual/en/pcntl.constants.php .. _Packagist: https://packagist.org/packages/symfony/process .. _`PHP streams`: http://www.php.net/manual/en/book.stream.php +.. _`TTY`: https://en.wikipedia.org/wiki/Tty_(unix) From 75df816402c30948884c6aeecbc55d02b98ddabf Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 8 Mar 2018 08:46:46 +0100 Subject: [PATCH 2/2] Minor code change --- components/process.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/process.rst b/components/process.rst index 62f14c4da96..bef990ffda9 100644 --- a/components/process.rst +++ b/components/process.rst @@ -431,7 +431,7 @@ whether `TTY`_ is supported on the current operating system:: use Symfony\Component\Process\Process; - $process = (new Process)->setTty(Process::isTtySupported()); + $process = (new Process())->setTty(Process::isTtySupported()); .. versionadded:: 4.1 The ``isTtySupported()`` method was introduced in Symfony 4.1.