From c6680009ce6f03feafd833be1320e004be00e536 Mon Sep 17 00:00:00 2001 From: Paul Arthur Date: Tue, 5 Nov 2013 21:04:08 -0500 Subject: Don't open stderr on Windows According to GH #80 Windows can't handle this. --- lib/class/stream.class.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'lib/class') diff --git a/lib/class/stream.class.php b/lib/class/stream.class.php index 66ecc42c..f2420cbe 100644 --- a/lib/class/stream.class.php +++ b/lib/class/stream.class.php @@ -135,14 +135,13 @@ class Stream { debug_event('downsample', "Downsample command: $command", 3); - $process = proc_open( - $command, - array( - 1 => array('pipe', 'w'), - 2 => array('pipe', 'w') - ), - $pipes - ); + $descriptors = array(1 => array('pipe', 'w')); + if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') { + // Windows doesn't like to provide stderr as a pipe + $descriptors[2] = array('pipe', 'w'); + } + + $process = proc_open($command, $descriptors, $pipes); return array( 'process' => $process, 'handle' => $pipes[1], -- cgit