Laravel version update
Laravel version update
This commit is contained in:
39
vendor/symfony/process/Pipes/UnixPipes.php
vendored
39
vendor/symfony/process/Pipes/UnixPipes.php
vendored
@@ -22,18 +22,15 @@ use Symfony\Component\Process\Process;
|
||||
*/
|
||||
class UnixPipes extends AbstractPipes
|
||||
{
|
||||
/** @var bool */
|
||||
private $ttyMode;
|
||||
/** @var bool */
|
||||
private $ptyMode;
|
||||
/** @var bool */
|
||||
private $disableOutput;
|
||||
private $haveReadSupport;
|
||||
|
||||
public function __construct($ttyMode, $ptyMode, $input, $disableOutput)
|
||||
public function __construct($ttyMode, $ptyMode, $input, $haveReadSupport)
|
||||
{
|
||||
$this->ttyMode = (bool) $ttyMode;
|
||||
$this->ptyMode = (bool) $ptyMode;
|
||||
$this->disableOutput = (bool) $disableOutput;
|
||||
$this->haveReadSupport = (bool) $haveReadSupport;
|
||||
|
||||
parent::__construct($input);
|
||||
}
|
||||
@@ -48,7 +45,7 @@ class UnixPipes extends AbstractPipes
|
||||
*/
|
||||
public function getDescriptors()
|
||||
{
|
||||
if ($this->disableOutput) {
|
||||
if (!$this->haveReadSupport) {
|
||||
$nullstream = fopen('/dev/null', 'c');
|
||||
|
||||
return array(
|
||||
@@ -102,7 +99,9 @@ class UnixPipes extends AbstractPipes
|
||||
unset($r[0]);
|
||||
|
||||
// let's have a look if something changed in streams
|
||||
if (($r || $w) && false === $n = @stream_select($r, $w, $e, 0, $blocking ? Process::TIMEOUT_PRECISION * 1E6 : 0)) {
|
||||
set_error_handler(array($this, 'handleError'));
|
||||
if (($r || $w) && false === stream_select($r, $w, $e, 0, $blocking ? Process::TIMEOUT_PRECISION * 1E6 : 0)) {
|
||||
restore_error_handler();
|
||||
// if a system call has been interrupted, forget about it, let's try again
|
||||
// otherwise, an error occurred, let's reset pipes
|
||||
if (!$this->hasSystemCallBeenInterrupted()) {
|
||||
@@ -111,6 +110,7 @@ class UnixPipes extends AbstractPipes
|
||||
|
||||
return $read;
|
||||
}
|
||||
restore_error_handler();
|
||||
|
||||
foreach ($r as $pipe) {
|
||||
// prior PHP 5.4 the array passed to stream_select is modified and
|
||||
@@ -120,7 +120,7 @@ class UnixPipes extends AbstractPipes
|
||||
do {
|
||||
$data = fread($pipe, self::CHUNK_SIZE);
|
||||
$read[$type] .= $data;
|
||||
} while (isset($data[0]));
|
||||
} while (isset($data[0]) && ($close || isset($data[self::CHUNK_SIZE - 1])));
|
||||
|
||||
if (!isset($read[$type][0])) {
|
||||
unset($read[$type]);
|
||||
@@ -135,6 +135,14 @@ class UnixPipes extends AbstractPipes
|
||||
return $read;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function haveReadSupport()
|
||||
{
|
||||
return $this->haveReadSupport;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
@@ -142,17 +150,4 @@ class UnixPipes extends AbstractPipes
|
||||
{
|
||||
return (bool) $this->pipes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new UnixPipes instance.
|
||||
*
|
||||
* @param Process $process
|
||||
* @param string|resource $input
|
||||
*
|
||||
* @return UnixPipes
|
||||
*/
|
||||
public static function create(Process $process, $input)
|
||||
{
|
||||
return new static($process->isTty(), $process->isPty(), $input, $process->isOutputDisabled());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user