File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,19 @@ public function __construct(
6464 protected $ inputStreamResource = STDIN ,
6565 protected $ outputStreamResource = STDOUT
6666 ) {
67+ if (str_contains (PHP_OS , 'WIN ' ) && ($ this ->inputStreamResource === STDIN && $ this ->outputStreamResource === STDOUT )) {
68+ $ message = 'STDIN and STDOUT are not supported as input and output stream resources ' .
69+ 'on Windows due to PHP \'s limitations with non blocking pipes. ' .
70+ 'Please use WSL or HttpServerTransport, or if you are advanced, provide your own stream resources. ' ;
71+
72+ throw new TransportException ($ message );
73+ }
74+
75+ // if (str_contains(PHP_OS, 'WIN')) {
76+ // $this->inputStreamResource = pclose(popen('winpty -c "'.$this->inputStreamResource.'"', 'r'));
77+ // $this->outputStreamResource = pclose(popen('winpty -c "'.$this->outputStreamResource.'"', 'w'));
78+ // }
79+
6780 if (! is_resource ($ this ->inputStreamResource ) || get_resource_type ($ this ->inputStreamResource ) !== 'stream ' ) {
6881 throw new TransportException ('Invalid input stream resource provided. ' );
6982 }
You can’t perform that action at this time.
0 commit comments