comparison vendor/symfony/process/Pipes/AbstractPipes.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
23 public $pipes = array(); 23 public $pipes = array();
24 24
25 private $inputBuffer = ''; 25 private $inputBuffer = '';
26 private $input; 26 private $input;
27 private $blocked = true; 27 private $blocked = true;
28 private $lastError;
28 29
29 /** 30 /**
30 * @param resource|string|int|float|bool|\Iterator|null $input 31 * @param resource|string|int|float|bool|\Iterator|null $input
31 */ 32 */
32 public function __construct($input) 33 public function __construct($input)
56 * 57 *
57 * @return bool 58 * @return bool
58 */ 59 */
59 protected function hasSystemCallBeenInterrupted() 60 protected function hasSystemCallBeenInterrupted()
60 { 61 {
61 $lastError = error_get_last(); 62 $lastError = $this->lastError;
63 $this->lastError = null;
62 64
63 // stream_select returns false when the `select` system call is interrupted by an incoming signal 65 // stream_select returns false when the `select` system call is interrupted by an incoming signal
64 return isset($lastError['message']) && false !== stripos($lastError['message'], 'interrupted system call'); 66 return null !== $lastError && false !== stripos($lastError, 'interrupted system call');
65 } 67 }
66 68
67 /** 69 /**
68 * Unblocks streams. 70 * Unblocks streams.
69 */ 71 */
163 unset($this->pipes[0]); 165 unset($this->pipes[0]);
164 } elseif (!$w) { 166 } elseif (!$w) {
165 return array($this->pipes[0]); 167 return array($this->pipes[0]);
166 } 168 }
167 } 169 }
170
171 /**
172 * @internal
173 */
174 public function handleError($type, $msg)
175 {
176 $this->lastError = $msg;
177 }
168 } 178 }