Security update for Core, with self-updated composer
[yaffs-website] / vendor / symfony / process / Pipes / WindowsPipes.php
index 87a781ea9204accb369313b4594e15ec2f1807e0..a1e3115519f35fe1ffc4f136e207f15e2304987f 100644 (file)
@@ -36,13 +36,13 @@ class WindowsPipes extends AbstractPipes
         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.
             //
@@ -97,7 +97,7 @@ class WindowsPipes extends AbstractPipes
      */
     public function getDescriptors()
     {
-        if ($this->disableOutput) {
+        if (!$this->haveReadSupport) {
             $nullstream = fopen('NUL', 'c');
 
             return array(
@@ -157,6 +157,14 @@ class WindowsPipes extends AbstractPipes
         return $read;
     }
 
+    /**
+     * {@inheritdoc}
+     */
+    public function haveReadSupport()
+    {
+        return $this->haveReadSupport;
+    }
+
     /**
      * {@inheritdoc}
      */
@@ -177,19 +185,6 @@ class WindowsPipes extends AbstractPipes
         $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.
      */