update patch 1
This commit is contained in:
+1
-1
@@ -101,7 +101,7 @@ abstract class AbstractPipes implements PipesInterface
|
||||
} elseif (!isset($this->inputBuffer[0])) {
|
||||
if (!\is_string($input)) {
|
||||
if (!\is_scalar($input)) {
|
||||
throw new InvalidArgumentException(sprintf('"%s" yielded a value of type "%s", but only scalars and stream resources are supported.', get_debug_type($this->input), get_debug_type($input)));
|
||||
throw new InvalidArgumentException(\sprintf('"%s" yielded a value of type "%s", but only scalars and stream resources are supported.', get_debug_type($this->input), get_debug_type($input)));
|
||||
}
|
||||
$input = (string) $input;
|
||||
}
|
||||
|
||||
+6
-10
@@ -22,16 +22,12 @@ use Symfony\Component\Process\Process;
|
||||
*/
|
||||
class UnixPipes extends AbstractPipes
|
||||
{
|
||||
private ?bool $ttyMode;
|
||||
private bool $ptyMode;
|
||||
private bool $haveReadSupport;
|
||||
|
||||
public function __construct(?bool $ttyMode, bool $ptyMode, mixed $input, bool $haveReadSupport)
|
||||
{
|
||||
$this->ttyMode = $ttyMode;
|
||||
$this->ptyMode = $ptyMode;
|
||||
$this->haveReadSupport = $haveReadSupport;
|
||||
|
||||
public function __construct(
|
||||
private ?bool $ttyMode,
|
||||
private bool $ptyMode,
|
||||
mixed $input,
|
||||
private bool $haveReadSupport,
|
||||
) {
|
||||
parent::__construct($input);
|
||||
}
|
||||
|
||||
|
||||
+5
-6
@@ -33,12 +33,11 @@ class WindowsPipes extends AbstractPipes
|
||||
Process::STDOUT => 0,
|
||||
Process::STDERR => 0,
|
||||
];
|
||||
private bool $haveReadSupport;
|
||||
|
||||
public function __construct(mixed $input, bool $haveReadSupport)
|
||||
{
|
||||
$this->haveReadSupport = $haveReadSupport;
|
||||
|
||||
public function __construct(
|
||||
mixed $input,
|
||||
private bool $haveReadSupport,
|
||||
) {
|
||||
if ($this->haveReadSupport) {
|
||||
// Fix for PHP bug #51800: reading from STDOUT pipe hangs forever on Windows if the output is too big.
|
||||
// Workaround for this problem is to use temporary files instead of pipes on Windows platform.
|
||||
@@ -53,7 +52,7 @@ class WindowsPipes extends AbstractPipes
|
||||
set_error_handler(function ($type, $msg) use (&$lastError) { $lastError = $msg; });
|
||||
for ($i = 0;; ++$i) {
|
||||
foreach ($pipes as $pipe => $name) {
|
||||
$file = sprintf('%s\\sf_proc_%02X.%s', $tmpDir, $i, $name);
|
||||
$file = \sprintf('%s\\sf_proc_%02X.%s', $tmpDir, $i, $name);
|
||||
|
||||
if (!$h = fopen($file.'.lock', 'w')) {
|
||||
if (file_exists($file.'.lock')) {
|
||||
|
||||
Reference in New Issue
Block a user