Use https://github.com/slimphp/Slim/pull/1872 in order to support popen streams in Slim

This commit is contained in:
Pierre Rudloff 2016-05-25 18:39:48 +02:00
parent fd3aa1d4aa
commit 3370695e9e
3 changed files with 49 additions and 116 deletions

View file

@ -16,7 +16,7 @@ use Alltube\VideoDownload;
use Alltube\Config;
use Symfony\Component\Process\ProcessBuilder;
use Chain\Chain;
use ProcessStream\PopenStream;
use Slim\Http\Stream;
/**
* Main controller
@ -200,7 +200,7 @@ class FrontController
$chain->add('|', $avconvProc);
}
if ($request->isGet()) {
$response = $response->withBody(new PopenStream($chain->getProcess()->getCommandLine()));
$response = $response->withBody(new Stream(popen($chain->getProcess()->getCommandLine(), 'r')));
}
return $response;
}