@@ -32,20 +32,23 @@ class ProcessPipes
32
32
private $ ttyMode ;
33
33
/** @var bool */
34
34
private $ ptyMode ;
35
+ /** @var bool */
36
+ private $ disableOutput ;
35
37
36
38
const CHUNK_SIZE = 16384 ;
37
39
38
- public function __construct ($ useFiles , $ ttyMode , $ ptyMode = false )
40
+ public function __construct ($ useFiles , $ ttyMode , $ ptyMode = false , $ disableOutput = false )
39
41
{
40
42
$ this ->useFiles = (bool ) $ useFiles ;
41
43
$ this ->ttyMode = (bool ) $ ttyMode ;
42
44
$ this ->ptyMode = (bool ) $ ptyMode ;
45
+ $ this ->disableOutput = (bool ) $ disableOutput ;
43
46
44
47
// Fix for PHP bug #51800: reading from STDOUT pipe hangs forever on Windows if the output is too big.
45
48
// Workaround for this problem is to use temporary files instead of pipes on Windows platform.
46
49
//
47
50
// @see https://bugs.php.net/bug.php?id=51800
48
- if ($ this ->useFiles ) {
51
+ if ($ this ->useFiles && ! $ this -> disableOutput ) {
49
52
$ this ->files = array (
50
53
Process::STDOUT => tempnam (sys_get_temp_dir (), 'sf_proc_stdout ' ),
51
54
Process::STDERR => tempnam (sys_get_temp_dir (), 'sf_proc_stderr ' ),
@@ -107,13 +110,11 @@ public function closeUnixPipes()
107
110
/**
108
111
* Returns an array of descriptors for the use of proc_open.
109
112
*
110
- * @param bool $disableOutput Whether to redirect STDOUT and STDERR to /dev/null or not.
111
- *
112
113
* @return array
113
114
*/
114
- public function getDescriptors ($ disableOutput )
115
+ public function getDescriptors ()
115
116
{
116
- if ($ disableOutput ) {
117
+ if ($ this -> disableOutput ) {
117
118
$ nullstream = fopen (defined ('PHP_WINDOWS_VERSION_BUILD ' ) ? 'NUL ' : '/dev/null ' , 'c ' );
118
119
119
120
return array (
0 commit comments