Process::STDERR => 0,
);
/** @var bool */
- private $disableOutput;
+ private $haveReadSupport;
- public function __construct($disableOutput, $input)
+ public function __construct($input, $haveReadSupport)
{
- $this->disableOutput = (bool) $disableOutput;
+ $this->haveReadSupport = (bool) $haveReadSupport;
- if (!$this->disableOutput) {
+ 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.
//
*/
public function getDescriptors()
{
- if ($this->disableOutput) {
+ if (!$this->haveReadSupport) {
$nullstream = fopen('NUL', 'c');
return array(
return $read;
}
+ /**
+ * {@inheritdoc}
+ */
+ public function haveReadSupport()
+ {
+ return $this->haveReadSupport;
+ }
+
/**
* {@inheritdoc}
*/
$this->fileHandles = array();
}
- /**
- * Creates a new WindowsPipes instance.
- *
- * @param Process $process The process
- * @param $input
- *
- * @return static
- */
- public static function create(Process $process, $input)
- {
- return new static($process->isOutputDisabled(), $input);
- }
-
/**
* Removes temporary files.
*/