Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/process/Pipes/AbstractPipes.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | 4c8ae668cc8c |
children | c2387f117808 |
comparison
equal
deleted
inserted
replaced
13:5fb285c0d0e3 | 14:1fec387a4317 |
---|---|
18 * | 18 * |
19 * @internal | 19 * @internal |
20 */ | 20 */ |
21 abstract class AbstractPipes implements PipesInterface | 21 abstract class AbstractPipes implements PipesInterface |
22 { | 22 { |
23 /** @var array */ | |
24 public $pipes = array(); | 23 public $pipes = array(); |
25 | 24 |
26 /** @var string */ | |
27 private $inputBuffer = ''; | 25 private $inputBuffer = ''; |
28 /** @var resource|scalar|\Iterator|null */ | |
29 private $input; | 26 private $input; |
30 /** @var bool */ | |
31 private $blocked = true; | 27 private $blocked = true; |
32 | 28 |
29 /** | |
30 * @param resource|string|int|float|bool|\Iterator|null $input | |
31 */ | |
33 public function __construct($input) | 32 public function __construct($input) |
34 { | 33 { |
35 if (is_resource($input) || $input instanceof \Iterator) { | 34 if (is_resource($input) || $input instanceof \Iterator) { |
36 $this->input = $input; | 35 $this->input = $input; |
37 } elseif (is_string($input)) { | 36 } elseif (is_string($input)) { |
118 | 117 |
119 $r = $e = array(); | 118 $r = $e = array(); |
120 $w = array($this->pipes[0]); | 119 $w = array($this->pipes[0]); |
121 | 120 |
122 // let's have a look if something changed in streams | 121 // let's have a look if something changed in streams |
123 if (false === $n = @stream_select($r, $w, $e, 0, 0)) { | 122 if (false === @stream_select($r, $w, $e, 0, 0)) { |
124 return; | 123 return; |
125 } | 124 } |
126 | 125 |
127 foreach ($w as $stdin) { | 126 foreach ($w as $stdin) { |
128 if (isset($this->inputBuffer[0])) { | 127 if (isset($this->inputBuffer[0])) { |