comparison vendor/symfony/process/Pipes/UnixPipes.php @ 16:c2387f117808

Routine composer update
author Chris Cannam
date Tue, 10 Jul 2018 15:07:59 +0100
parents 1fec387a4317
children 129ea1e6d783
comparison
equal deleted inserted replaced
15:e200cb7efeb3 16:c2387f117808
97 $read = $e = array(); 97 $read = $e = array();
98 $r = $this->pipes; 98 $r = $this->pipes;
99 unset($r[0]); 99 unset($r[0]);
100 100
101 // let's have a look if something changed in streams 101 // let's have a look if something changed in streams
102 if (($r || $w) && false === @stream_select($r, $w, $e, 0, $blocking ? Process::TIMEOUT_PRECISION * 1E6 : 0)) { 102 set_error_handler(array($this, 'handleError'));
103 if (($r || $w) && false === stream_select($r, $w, $e, 0, $blocking ? Process::TIMEOUT_PRECISION * 1E6 : 0)) {
104 restore_error_handler();
103 // if a system call has been interrupted, forget about it, let's try again 105 // if a system call has been interrupted, forget about it, let's try again
104 // otherwise, an error occurred, let's reset pipes 106 // otherwise, an error occurred, let's reset pipes
105 if (!$this->hasSystemCallBeenInterrupted()) { 107 if (!$this->hasSystemCallBeenInterrupted()) {
106 $this->pipes = array(); 108 $this->pipes = array();
107 } 109 }
108 110
109 return $read; 111 return $read;
110 } 112 }
113 restore_error_handler();
111 114
112 foreach ($r as $pipe) { 115 foreach ($r as $pipe) {
113 // prior PHP 5.4 the array passed to stream_select is modified and 116 // prior PHP 5.4 the array passed to stream_select is modified and
114 // lose key association, we have to find back the key 117 // lose key association, we have to find back the key
115 $read[$type = array_search($pipe, $this->pipes, true)] = ''; 118 $read[$type = array_search($pipe, $this->pipes, true)] = '';