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

@ -7,15 +7,14 @@
"require": {
"smarty/smarty": "~3.1.29",
"rg3/youtube-dl": "2016.04.13",
"slim/slim": "~3.4.2",
"slim/slim": "1838.x-dev as 3.3.0",
"mathmarques/smarty-view": "~1.1.0",
"symfony/yaml": "~3.0.0",
"symfony/process": "~3.0.0",
"ptachoire/process-builder-chain": "~1.2.0",
"ffmpeg/ffmpeg": "dev-release",
"rudloff/smarty-plugin-noscheme": "~0.1.0",
"rudloff/rtmpdump-bin": "~2.3",
"rudloff/psr7-process-stream": "~0.1.0"
"rudloff/rtmpdump-bin": "~2.3"
},
"require-dev": {
"symfony/var-dumper": "~3.0.0"
@ -51,6 +50,9 @@
"ffmpeg"
]
}
}, {
"type": "vcs",
"url": "https://github.com/llvdl/Slim.git"
}],
"authors": [{
"name": "Pierre Rudloff",

153
composer.lock generated
View File

@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "a030be591c13e040baf3e3ec52716722",
"content-hash": "9ca31c631675ba466325c5a04bff17c1",
"hash": "6e64354dc4d656c303e0cd83b4ccfda6",
"content-hash": "4418cbfe45cf745f1f170c49746bfdfd",
"packages": [
{
"name": "container-interop/container-interop",
@ -48,64 +48,6 @@
],
"type": "library"
},
{
"name": "guzzlehttp/psr7",
"version": "1.3.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
"reference": "31382fef2889136415751badebbd1cb022a4ed72"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/31382fef2889136415751badebbd1cb022a4ed72",
"reference": "31382fef2889136415751badebbd1cb022a4ed72",
"shasum": ""
},
"require": {
"php": ">=5.4.0",
"psr/http-message": "~1.0"
},
"provide": {
"psr/http-message-implementation": "1.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": {
"psr-4": {
"GuzzleHttp\\Psr7\\": "src/"
},
"files": [
"src/functions_include.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
}
],
"description": "PSR-7 message implementation",
"keywords": [
"http",
"message",
"stream",
"uri"
],
"time": "2016-04-13 19:56:01"
},
{
"name": "jeremykendall/php-domain-parser",
"version": "3.0.0",
@ -466,39 +408,6 @@
},
"type": "library"
},
{
"name": "rudloff/psr7-process-stream",
"version": "0.1.0",
"source": {
"type": "git",
"url": "https://github.com/Rudloff/psr7-process-stream.git",
"reference": "055ecbdadee9b43904aed75d5a548c277cac10a8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Rudloff/psr7-process-stream/zipball/055ecbdadee9b43904aed75d5a548c277cac10a8",
"reference": "055ecbdadee9b43904aed75d5a548c277cac10a8",
"shasum": ""
},
"require": {
"guzzlehttp/psr7": "~1.3.0"
},
"require-dev": {
"symfony/var-dumper": "~3.0.0"
},
"type": "library",
"autoload": {
"psr-4": {
"ProcessStream\\": "classes/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-3.0"
],
"description": "PSR-7 stream implementation that can be used to manage processes",
"time": "2016-04-14 10:36:10"
},
{
"name": "rudloff/rtmpdump-bin",
"version": "2.3",
@ -570,16 +479,16 @@
},
{
"name": "slim/slim",
"version": "3.4.2",
"version": "1838.x-dev",
"source": {
"type": "git",
"url": "https://github.com/slimphp/Slim.git",
"reference": "a132385f736063d00632b52b3f8a389fe66fe4fa"
"url": "https://github.com/llvdl/Slim.git",
"reference": "388272244ab335f2309448e881fb838abed425f1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/slimphp/Slim/zipball/a132385f736063d00632b52b3f8a389fe66fe4fa",
"reference": "a132385f736063d00632b52b3f8a389fe66fe4fa",
"url": "https://api.github.com/repos/llvdl/Slim/zipball/388272244ab335f2309448e881fb838abed425f1",
"reference": "388272244ab335f2309448e881fb838abed425f1",
"shasum": ""
},
"require": {
@ -602,30 +511,41 @@
"Slim\\": "Slim"
}
},
"notification-url": "https://packagist.org/downloads/",
"scripts": {
"test": [
"@phpunit",
"@phpcs"
],
"phpunit": [
"php vendor/bin/phpunit"
],
"phpcs": [
"php vendor/bin/phpcs"
]
},
"license": [
"MIT"
],
"authors": [
{
"name": "Rob Allen",
"email": "rob@akrabat.com",
"homepage": "http://akrabat.com"
},
{
"name": "Josh Lockhart",
"email": "hello@joshlockhart.com",
"homepage": "https://joshlockhart.com"
},
{
"name": "Gabriel Manricks",
"email": "gmanricks@me.com",
"homepage": "http://gabrielmanricks.com"
},
{
"name": "Andrew Smith",
"email": "a.smith@silentworks.co.uk",
"homepage": "http://silentworks.co.uk"
},
{
"name": "Rob Allen",
"email": "rob@akrabat.com",
"homepage": "http://akrabat.com"
},
{
"name": "Gabriel Manricks",
"email": "gmanricks@me.com",
"homepage": "http://gabrielmanricks.com"
}
],
"description": "Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs",
@ -636,7 +556,10 @@
"micro",
"router"
],
"time": "2016-05-25 11:23:38"
"support": {
"source": "https://github.com/llvdl/Slim/tree/1838"
},
"time": "2016-05-19 08:36:13"
},
{
"name": "smarty/smarty",
@ -916,9 +839,17 @@
"time": "2016-04-25 11:17:47"
}
],
"aliases": [],
"aliases": [
{
"alias": "3.3.0",
"alias_normalized": "3.3.0.0",
"version": "1838.9999999.9999999.9999999-dev",
"package": "slim/slim"
}
],
"minimum-stability": "stable",
"stability-flags": {
"slim/slim": 20,
"ffmpeg/ffmpeg": 20
},
"prefer-stable": false,

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;
}