updated packages
This commit is contained in:
34
vendor/symfony/process/Pipes/WindowsPipes.php
vendored
34
vendor/symfony/process/Pipes/WindowsPipes.php
vendored
@@ -26,13 +26,13 @@ use Symfony\Component\Process\Process;
|
||||
*/
|
||||
class WindowsPipes extends AbstractPipes
|
||||
{
|
||||
private $files = array();
|
||||
private $fileHandles = array();
|
||||
private $lockHandles = array();
|
||||
private $readBytes = array(
|
||||
private $files = [];
|
||||
private $fileHandles = [];
|
||||
private $lockHandles = [];
|
||||
private $readBytes = [
|
||||
Process::STDOUT => 0,
|
||||
Process::STDERR => 0,
|
||||
);
|
||||
];
|
||||
private $haveReadSupport;
|
||||
|
||||
public function __construct($input, bool $haveReadSupport)
|
||||
@@ -44,10 +44,10 @@ class WindowsPipes extends AbstractPipes
|
||||
// Workaround for this problem is to use temporary files instead of pipes on Windows platform.
|
||||
//
|
||||
// @see https://bugs.php.net/bug.php?id=51800
|
||||
$pipes = array(
|
||||
$pipes = [
|
||||
Process::STDOUT => Process::OUT,
|
||||
Process::STDERR => Process::ERR,
|
||||
);
|
||||
];
|
||||
$tmpDir = sys_get_temp_dir();
|
||||
$lastError = 'unknown reason';
|
||||
set_error_handler(function ($type, $msg) use (&$lastError) { $lastError = $msg; });
|
||||
@@ -98,21 +98,21 @@ class WindowsPipes extends AbstractPipes
|
||||
if (!$this->haveReadSupport) {
|
||||
$nullstream = fopen('NUL', 'c');
|
||||
|
||||
return array(
|
||||
array('pipe', 'r'),
|
||||
return [
|
||||
['pipe', 'r'],
|
||||
$nullstream,
|
||||
$nullstream,
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
// We're not using pipe on Windows platform as it hangs (https://bugs.php.net/bug.php?id=51800)
|
||||
// We're not using file handles as it can produce corrupted output https://bugs.php.net/bug.php?id=65650
|
||||
// So we redirect output within the commandline and pass the nul device to the process
|
||||
return array(
|
||||
array('pipe', 'r'),
|
||||
array('file', 'NUL', 'w'),
|
||||
array('file', 'NUL', 'w'),
|
||||
);
|
||||
return [
|
||||
['pipe', 'r'],
|
||||
['file', 'NUL', 'w'],
|
||||
['file', 'NUL', 'w'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -130,7 +130,7 @@ class WindowsPipes extends AbstractPipes
|
||||
{
|
||||
$this->unblock();
|
||||
$w = $this->write();
|
||||
$read = $r = $e = array();
|
||||
$read = $r = $e = [];
|
||||
|
||||
if ($blocking) {
|
||||
if ($w) {
|
||||
@@ -186,6 +186,6 @@ class WindowsPipes extends AbstractPipes
|
||||
flock($this->lockHandles[$type], LOCK_UN);
|
||||
fclose($this->lockHandles[$type]);
|
||||
}
|
||||
$this->fileHandles = $this->lockHandles = array();
|
||||
$this->fileHandles = $this->lockHandles = [];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user