Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / symfony / process / Pipes / WindowsPipes.php
index 87a781ea9204accb369313b4594e15ec2f1807e0..d5fa2fdeef67c9ac99536547c1156c411c8a388a 100644 (file)
@@ -26,23 +26,19 @@ use Symfony\Component\Process\Exception\RuntimeException;
  */
 class WindowsPipes extends AbstractPipes
 {
-    /** @var array */
     private $files = array();
-    /** @var array */
     private $fileHandles = array();
-    /** @var array */
     private $readBytes = array(
         Process::STDOUT => 0,
         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 +93,7 @@ class WindowsPipes extends AbstractPipes
      */
     public function getDescriptors()
     {
-        if ($this->disableOutput) {
+        if (!$this->haveReadSupport) {
             $nullstream = fopen('NUL', 'c');
 
             return array(
@@ -157,6 +153,14 @@ class WindowsPipes extends AbstractPipes
         return $read;
     }
 
+    /**
+     * {@inheritdoc}
+     */
+    public function haveReadSupport()
+    {
+        return $this->haveReadSupport;
+    }
+
     /**
      * {@inheritdoc}
      */
@@ -177,19 +181,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.
      */