From b4b5764c2341623c8bbd586b811868f974fb47bb Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Thu, 26 Oct 2017 10:45:08 +0200 Subject: [PATCH 01/77] Update rinvex/country to 3.1 --- composer.json | 2 +- composer.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index a674423..910e206 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "barracudanetworks/archivestream-php": "~1.0.5", "smarty-gettext/smarty-gettext": "~1.5.1", "zonuexe/http-accept-language": "~0.4.1", - "rinvex/country": "~2.0.0" + "rinvex/country": "~3.1.0" }, "require-dev": { "symfony/var-dumper": "~3.3.9", diff --git a/composer.lock b/composer.lock index 18d838d..da48070 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "be0203be4eb5ef4d1b03fed10aa1b9f1", + "content-hash": "62aeeecf774076fd0fe85b5b991b399e", "packages": [ { "name": "aura/session", @@ -600,28 +600,28 @@ }, { "name": "rinvex/country", - "version": "v2.0.0", + "version": "v3.1.0", "source": { "type": "git", "url": "https://github.com/rinvex/country.git", - "reference": "9405da035644bc76671bfba0c282fef8fd3408e1" + "reference": "e32228ef43f26d3b02296be9454f842c52d492f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rinvex/country/zipball/9405da035644bc76671bfba0c282fef8fd3408e1", - "reference": "9405da035644bc76671bfba0c282fef8fd3408e1", + "url": "https://api.github.com/repos/rinvex/country/zipball/e32228ef43f26d3b02296be9454f842c52d492f3", + "reference": "e32228ef43f26d3b02296be9454f842c52d492f3", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^7.0.0" }, "require-dev": { - "phpunit/phpunit": "^5.2.0" + "phpunit/phpunit": "^5.4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -670,7 +670,7 @@ "rinvex", "svg" ], - "time": "2016-11-27T05:53:11+00:00" + "time": "2017-03-07T18:40:20+00:00" }, { "name": "slim/slim", From d14b1458a1ae90401668560feb4c3b0f8d3c42a3 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Thu, 26 Oct 2017 10:46:22 +0200 Subject: [PATCH 02/77] Update phpunit to 6.4 --- composer.json | 2 +- composer.lock | 423 ++++++++++++++++++++-------- tests/ConfigTest.php | 3 +- tests/FrontControllerTest.php | 3 +- tests/LocaleManagerTest.php | 3 +- tests/LocaleMiddlewareTest.php | 3 +- tests/LocaleTest.php | 3 +- tests/PlaylistArchiveStreamTest.php | 3 +- tests/UglyRouterTest.php | 3 +- tests/VideoDownloadTest.php | 3 +- tests/ViewFactoryTest.php | 3 +- 11 files changed, 326 insertions(+), 126 deletions(-) diff --git a/composer.json b/composer.json index 910e206..ef193a7 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "require-dev": { "symfony/var-dumper": "~3.3.9", "squizlabs/php_codesniffer": "~3.1.0", - "phpunit/phpunit": "~5.7.2", + "phpunit/phpunit": "~6.4.3", "ffmpeg/ffmpeg": "dev-release", "rg3/youtube-dl": "~2017.10.20", "rudloff/rtmpdump-bin": "~2.3.0", diff --git a/composer.lock b/composer.lock index da48070..6ec672f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "62aeeecf774076fd0fe85b5b991b399e", + "content-hash": "a187493715c03ec2fc880fdf1e4dae70", "packages": [ { "name": "aura/session", @@ -1154,6 +1154,108 @@ ], "time": "2017-10-19T19:58:43+00:00" }, + { + "name": "phar-io/manifest", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^1.0.1", + "php": "^5.6 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "time": "2017-03-05T18:14:27+00:00" + }, + { + "name": "phar-io/version", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "time": "2017-03-05T17:38:23+00:00" + }, { "name": "phpdocumentor/reflection-common", "version": "1.0.1", @@ -1365,40 +1467,41 @@ }, { "name": "phpunit/php-code-coverage", - "version": "4.0.8", + "version": "5.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + "reference": "8ed1902a57849e117b5651fc1a5c48110946c06b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/8ed1902a57849e117b5651fc1a5c48110946c06b", + "reference": "8ed1902a57849e117b5651fc1a5c48110946c06b", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^5.6 || ^7.0", - "phpunit/php-file-iterator": "^1.3", - "phpunit/php-text-template": "^1.2", - "phpunit/php-token-stream": "^1.4.2 || ^2.0", - "sebastian/code-unit-reverse-lookup": "^1.0", - "sebastian/environment": "^1.3.2 || ^2.0", - "sebastian/version": "^1.0 || ^2.0" + "php": "^7.0", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^1.4.11 || ^2.0", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.0", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1" }, "require-dev": { - "ext-xdebug": "^2.1.4", - "phpunit/phpunit": "^5.7" + "ext-xdebug": "^2.5", + "phpunit/phpunit": "^6.0" }, "suggest": { - "ext-xdebug": "^2.5.1" + "ext-xdebug": "^2.5.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0.x-dev" + "dev-master": "5.2.x-dev" } }, "autoload": { @@ -1424,7 +1527,7 @@ "testing", "xunit" ], - "time": "2017-04-02T07:44:40+00:00" + "time": "2017-08-03T12:40:43+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1614,16 +1717,16 @@ }, { "name": "phpunit/phpunit", - "version": "5.7.23", + "version": "6.4.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "78532d5269d984660080d8e0f4c99c5c2ea65ffe" + "reference": "06b28548fd2b4a20c3cd6e247dc86331a7d4db13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/78532d5269d984660080d8e0f4c99c5c2ea65ffe", - "reference": "78532d5269d984660080d8e0f4c99c5c2ea65ffe", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/06b28548fd2b4a20c3cd6e247dc86331a7d4db13", + "reference": "06b28548fd2b4a20c3cd6e247dc86331a7d4db13", "shasum": "" }, "require": { @@ -1632,33 +1735,35 @@ "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "~1.3", - "php": "^5.6 || ^7.0", - "phpspec/prophecy": "^1.6.2", - "phpunit/php-code-coverage": "^4.0.4", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "^3.2", - "sebastian/comparator": "^1.2.4", - "sebastian/diff": "^1.4.3", - "sebastian/environment": "^1.3.4 || ^2.0", - "sebastian/exporter": "~2.0", - "sebastian/global-state": "^1.1", - "sebastian/object-enumerator": "~2.0", - "sebastian/resource-operations": "~1.0", - "sebastian/version": "~1.0.3|~2.0", - "symfony/yaml": "~2.1|~3.0" + "myclabs/deep-copy": "^1.6.1", + "phar-io/manifest": "^1.0.1", + "phar-io/version": "^1.0", + "php": "^7.0", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^5.2.2", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^1.0.9", + "phpunit/phpunit-mock-objects": "^4.0.3", + "sebastian/comparator": "^2.0.2", + "sebastian/diff": "^2.0", + "sebastian/environment": "^3.1", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^1.0", + "sebastian/version": "^2.0.1" }, "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2" + "phpdocumentor/reflection-docblock": "3.0.2", + "phpunit/dbunit": "<3.0" }, "require-dev": { "ext-pdo": "*" }, "suggest": { "ext-xdebug": "*", - "phpunit/php-invoker": "~1.1" + "phpunit/php-invoker": "^1.1" }, "bin": [ "phpunit" @@ -1666,7 +1771,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.7.x-dev" + "dev-master": "6.4.x-dev" } }, "autoload": { @@ -1692,33 +1797,33 @@ "testing", "xunit" ], - "time": "2017-10-15T06:13:55+00:00" + "time": "2017-10-16T13:18:59+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "3.4.4", + "version": "4.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" + "reference": "2f789b59ab89669015ad984afa350c4ec577ade0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/2f789b59ab89669015ad984afa350c4ec577ade0", + "reference": "2f789b59ab89669015ad984afa350c4ec577ade0", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.6 || ^7.0", - "phpunit/php-text-template": "^1.2", - "sebastian/exporter": "^1.2 || ^2.0" + "doctrine/instantiator": "^1.0.5", + "php": "^7.0", + "phpunit/php-text-template": "^1.2.1", + "sebastian/exporter": "^3.0" }, "conflict": { - "phpunit/phpunit": "<5.4.0" + "phpunit/phpunit": "<6.0" }, "require-dev": { - "phpunit/phpunit": "^5.4" + "phpunit/phpunit": "^6.0" }, "suggest": { "ext-soap": "*" @@ -1726,7 +1831,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2.x-dev" + "dev-master": "4.0.x-dev" } }, "autoload": { @@ -1751,7 +1856,7 @@ "mock", "xunit" ], - "time": "2017-06-30T09:13:00+00:00" + "time": "2017-08-03T14:08:16+00:00" }, { "name": "rg3/youtube-dl", @@ -1839,30 +1944,30 @@ }, { "name": "sebastian/comparator", - "version": "1.2.4", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + "reference": "ae068fede81d06e7bb9bb46a367210a3d3e1fe6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/ae068fede81d06e7bb9bb46a367210a3d3e1fe6a", + "reference": "ae068fede81d06e7bb9bb46a367210a3d3e1fe6a", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" + "php": "^7.0", + "sebastian/diff": "^2.0", + "sebastian/exporter": "^3.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1899,32 +2004,32 @@ "compare", "equality" ], - "time": "2017-01-29T09:50:25+00:00" + "time": "2017-08-03T07:14:59+00:00" }, { "name": "sebastian/diff", - "version": "1.4.3", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^6.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1951,32 +2056,32 @@ "keywords": [ "diff" ], - "time": "2017-05-22T07:24:03+00:00" + "time": "2017-08-03T08:09:46+00:00" }, { "name": "sebastian/environment", - "version": "2.0.0", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^5.0" + "phpunit/phpunit": "^6.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { @@ -2001,34 +2106,34 @@ "environment", "hhvm" ], - "time": "2016-11-26T07:53:53+00:00" + "time": "2017-07-01T08:51:00+00:00" }, { "name": "sebastian/exporter", - "version": "2.0.0", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~2.0" + "php": "^7.0", + "sebastian/recursion-context": "^3.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { @@ -2068,27 +2173,27 @@ "export", "exporter" ], - "time": "2016-11-19T08:54:04+00:00" + "time": "2017-04-03T13:19:02+00:00" }, { "name": "sebastian/global-state", - "version": "1.1.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^6.0" }, "suggest": { "ext-uopz": "*" @@ -2096,7 +2201,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -2119,33 +2224,34 @@ "keywords": [ "global state" ], - "time": "2015-10-12T03:26:01+00:00" + "time": "2017-04-27T15:39:26+00:00" }, { "name": "sebastian/object-enumerator", - "version": "2.0.1", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", "shasum": "" }, "require": { - "php": ">=5.6", - "sebastian/recursion-context": "~2.0" + "php": "^7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" }, "require-dev": { - "phpunit/phpunit": "~5" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -2165,32 +2271,77 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-02-18T15:18:39+00:00" + "time": "2017-08-03T12:35:26+00:00" }, { - "name": "sebastian/recursion-context", - "version": "2.0.0", + "name": "sebastian/object-reflector", + "version": "1.1.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "time": "2017-03-29T09:07:27+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -2218,7 +2369,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-11-19T07:33:16+00:00" + "time": "2017-03-03T06:23:57+00:00" }, { "name": "sebastian/resource-operations", @@ -2483,6 +2634,46 @@ ], "time": "2017-10-02T06:42:24+00:00" }, + { + "name": "theseer/tokenizer", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "time": "2017-04-07T12:08:54+00:00" + }, { "name": "webmozart/assert", "version": "1.2.0", diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index f37935c..37e7419 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -6,11 +6,12 @@ namespace Alltube\Test; use Alltube\Config; +use PHPUnit\Framework\TestCase; /** * Unit tests for the Config class. */ -class ConfigTest extends \PHPUnit_Framework_TestCase +class ConfigTest extends TestCase { /** * Config class instance. diff --git a/tests/FrontControllerTest.php b/tests/FrontControllerTest.php index d3bac34..c72ff60 100644 --- a/tests/FrontControllerTest.php +++ b/tests/FrontControllerTest.php @@ -9,6 +9,7 @@ use Alltube\Config; use Alltube\Controller\FrontController; use Alltube\LocaleManager; use Alltube\ViewFactory; +use PHPUnit\Framework\TestCase; use Slim\Container; use Slim\Http\Environment; use Slim\Http\Request; @@ -17,7 +18,7 @@ use Slim\Http\Response; /** * Unit tests for the FrontController class. */ -class FrontControllerTest extends \PHPUnit_Framework_TestCase +class FrontControllerTest extends TestCase { /** * Slim dependency container. diff --git a/tests/LocaleManagerTest.php b/tests/LocaleManagerTest.php index 693346f..82916ff 100644 --- a/tests/LocaleManagerTest.php +++ b/tests/LocaleManagerTest.php @@ -7,11 +7,12 @@ namespace Alltube\Test; use Alltube\Locale; use Alltube\LocaleManager; +use PHPUnit\Framework\TestCase; /** * Unit tests for the Config class. */ -class LocaleManagerTest extends \PHPUnit_Framework_TestCase +class LocaleManagerTest extends TestCase { /** * LocaleManager class instance. diff --git a/tests/LocaleMiddlewareTest.php b/tests/LocaleMiddlewareTest.php index 86fdc9c..0f4e2ae 100644 --- a/tests/LocaleMiddlewareTest.php +++ b/tests/LocaleMiddlewareTest.php @@ -7,6 +7,7 @@ namespace Alltube\Test; use Alltube\LocaleManager; use Alltube\LocaleMiddleware; +use PHPUnit\Framework\TestCase; use Slim\Container; use Slim\Http\Environment; use Slim\Http\Request; @@ -15,7 +16,7 @@ use Slim\Http\Response; /** * Unit tests for the FrontController class. */ -class LocaleMiddlewareTest extends \PHPUnit_Framework_TestCase +class LocaleMiddlewareTest extends TestCase { /** * LocaleMiddleware instance. diff --git a/tests/LocaleTest.php b/tests/LocaleTest.php index 9581248..96c19aa 100644 --- a/tests/LocaleTest.php +++ b/tests/LocaleTest.php @@ -6,11 +6,12 @@ namespace Alltube\Test; use Alltube\Locale; +use PHPUnit\Framework\TestCase; /** * Unit tests for the Config class. */ -class LocaleTest extends \PHPUnit_Framework_TestCase +class LocaleTest extends TestCase { /** * Locale class instance. diff --git a/tests/PlaylistArchiveStreamTest.php b/tests/PlaylistArchiveStreamTest.php index 530b71e..c986416 100644 --- a/tests/PlaylistArchiveStreamTest.php +++ b/tests/PlaylistArchiveStreamTest.php @@ -6,11 +6,12 @@ namespace Alltube\Test; use Alltube\PlaylistArchiveStream; +use PHPUnit\Framework\TestCase; /** * Unit tests for the ViewFactory class. */ -class PlaylistArchiveStreamTest extends \PHPUnit_Framework_TestCase +class PlaylistArchiveStreamTest extends TestCase { /** * PlaylistArchiveStream instance. diff --git a/tests/UglyRouterTest.php b/tests/UglyRouterTest.php index 4d21b3e..541b78d 100644 --- a/tests/UglyRouterTest.php +++ b/tests/UglyRouterTest.php @@ -6,13 +6,14 @@ namespace Alltube\Test; use Alltube\UglyRouter; +use PHPUnit\Framework\TestCase; use Slim\Http\Environment; use Slim\Http\Request; /** * Unit tests for the UglyRouter class. */ -class UglyRouterTest extends \PHPUnit_Framework_TestCase +class UglyRouterTest extends TestCase { /** * UglyRouter instance. diff --git a/tests/VideoDownloadTest.php b/tests/VideoDownloadTest.php index ab3fa7d..68f6e51 100644 --- a/tests/VideoDownloadTest.php +++ b/tests/VideoDownloadTest.php @@ -7,11 +7,12 @@ namespace Alltube\Test; use Alltube\Config; use Alltube\VideoDownload; +use PHPUnit\Framework\TestCase; /** * Unit tests for the VideoDownload class. */ -class VideoDownloadTest extends \PHPUnit_Framework_TestCase +class VideoDownloadTest extends TestCase { /** * VideoDownload instance. diff --git a/tests/ViewFactoryTest.php b/tests/ViewFactoryTest.php index 552ed9f..285340f 100644 --- a/tests/ViewFactoryTest.php +++ b/tests/ViewFactoryTest.php @@ -6,6 +6,7 @@ namespace Alltube\Test; use Alltube\ViewFactory; +use PHPUnit\Framework\TestCase; use Slim\Container; use Slim\Http\Environment; use Slim\Http\Request; @@ -14,7 +15,7 @@ use Slim\Views\Smarty; /** * Unit tests for the ViewFactory class. */ -class ViewFactoryTest extends \PHPUnit_Framework_TestCase +class ViewFactoryTest extends TestCase { /** * Test the create() function. From 6e8efd1b8206baeedbd6fb1437d516b159961340 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Thu, 26 Oct 2017 10:55:29 +0200 Subject: [PATCH 03/77] Fix LocaleManager test --- tests/LocaleManagerTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/LocaleManagerTest.php b/tests/LocaleManagerTest.php index 82916ff..7eb5cdb 100644 --- a/tests/LocaleManagerTest.php +++ b/tests/LocaleManagerTest.php @@ -60,7 +60,7 @@ class LocaleManagerTest extends TestCase */ public function testGetLocale() { - $this->assertNull($this->localeManager->getLocale()); + $this->assertEquals(new Locale('foo_BAR'), $this->localeManager->getLocale()); } /** From 2e80129c63a8460fac10516d9bfd0538cad32de2 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Thu, 26 Oct 2017 11:02:14 +0200 Subject: [PATCH 04/77] Don't override parent property --- tests/LocaleTest.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/LocaleTest.php b/tests/LocaleTest.php index 96c19aa..3651b22 100644 --- a/tests/LocaleTest.php +++ b/tests/LocaleTest.php @@ -18,14 +18,14 @@ class LocaleTest extends TestCase * * @var Locale */ - private $locale; + private $localeObject; /** * Prepare tests. */ protected function setUp() { - $this->locale = new Locale('fr_FR'); + $this->localeObject = new Locale('fr_FR'); } /** @@ -35,7 +35,7 @@ class LocaleTest extends TestCase */ public function testGetToString() { - $this->assertEquals('fr_FR', $this->locale->__toString()); + $this->assertEquals('fr_FR', $this->localeObject->__toString()); } /** @@ -45,7 +45,7 @@ class LocaleTest extends TestCase */ public function testGetFullName() { - $this->assertEquals('français (France)', $this->locale->getFullName()); + $this->assertEquals('français (France)', $this->localeObject->getFullName()); } /** @@ -55,7 +55,7 @@ class LocaleTest extends TestCase */ public function testGetIso15897() { - $this->assertEquals('fr_FR', $this->locale->getIso15897()); + $this->assertEquals('fr_FR', $this->localeObject->getIso15897()); } /** @@ -65,7 +65,7 @@ class LocaleTest extends TestCase */ public function testGetBcp47() { - $this->assertEquals('fr-FR', $this->locale->getBcp47()); + $this->assertEquals('fr-FR', $this->localeObject->getBcp47()); } /** @@ -75,6 +75,6 @@ class LocaleTest extends TestCase */ public function testGetIso3166() { - $this->assertEquals('fr', $this->locale->getIso3166()); + $this->assertEquals('fr', $this->localeObject->getIso3166()); } } From 09a1aa14223256526197ab10416ee1ee87b39ed4 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Thu, 26 Oct 2017 11:03:30 +0200 Subject: [PATCH 05/77] It seems country() can return an array too --- classes/Locale.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/Locale.php b/classes/Locale.php index 0914ab1..5392316 100644 --- a/classes/Locale.php +++ b/classes/Locale.php @@ -91,7 +91,7 @@ class Locale /** * Get country information from locale. * - * @return \Rinvex\Country\Country + * @return \Rinvex\Country\Country|array */ public function getCountry() { From 3b3f8063c4857e007f1659ed3a3f0b6e11104c64 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Thu, 26 Oct 2017 11:05:43 +0200 Subject: [PATCH 06/77] Allow npm too --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 41adff1..a44573f 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,8 @@ "grunt-phpunit": "~0.3.6" }, "engines": { - "yarn": ">= 1.0.0" + "npm": "~3", + "yarn": "~1" }, "homepage": "https://www.alltubedownload.net/", "keywords": [ From f30582a7c32a181c66933359bb5ceadaf12f36fd Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 29 Oct 2017 22:42:15 +0100 Subject: [PATCH 07/77] Dependencies update --- composer.lock | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/composer.lock b/composer.lock index 6ec672f..124c6c3 100644 --- a/composer.lock +++ b/composer.lock @@ -999,32 +999,32 @@ "packages-dev": [ { "name": "doctrine/instantiator", - "version": "1.0.5", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": "^7.1" }, "require-dev": { "athletic/athletic": "~0.1.8", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "phpunit/phpunit": "^6.2.3", + "squizlabs/php_codesniffer": "^3.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -1049,7 +1049,7 @@ "constructor", "instantiate" ], - "time": "2015-06-14T21:17:01+00:00" + "time": "2017-07-22T11:58:36+00:00" }, { "name": "ffmpeg/ffmpeg", @@ -1067,16 +1067,16 @@ }, { "name": "heroku/heroku-buildpack-php", - "version": "v125", + "version": "v126", "source": { "type": "git", "url": "https://github.com/heroku/heroku-buildpack-php.git", - "reference": "880d625f715680aca2969562b8a5a69f4a289b7f" + "reference": "8288ddb4b717019f5e39db384e3a9a5b41d73e93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/heroku/heroku-buildpack-php/zipball/880d625f715680aca2969562b8a5a69f4a289b7f", - "reference": "880d625f715680aca2969562b8a5a69f4a289b7f", + "url": "https://api.github.com/repos/heroku/heroku-buildpack-php/zipball/8288ddb4b717019f5e39db384e3a9a5b41d73e93", + "reference": "8288ddb4b717019f5e39db384e3a9a5b41d73e93", "shasum": "" }, "bin": [ @@ -1107,7 +1107,7 @@ "nginx", "php" ], - "time": "2017-10-04T22:42:04+00:00" + "time": "2017-10-28T00:17:41+00:00" }, { "name": "myclabs/deep-copy", From 0a2971399b9df50268f0bb99e6666b79da5eeeea Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 29 Oct 2017 23:21:13 +0100 Subject: [PATCH 08/77] Lint --- classes/PlaylistArchiveStream.php | 10 ++--- classes/VideoDownload.php | 10 ++--- controllers/FrontController.php | 4 +- tests/FrontControllerTest.php | 66 ++++++++++++++--------------- tests/LocaleMiddlewareTest.php | 8 ++-- tests/PlaylistArchiveStreamTest.php | 2 +- tests/VideoDownloadTest.php | 6 +-- 7 files changed, 53 insertions(+), 53 deletions(-) diff --git a/classes/PlaylistArchiveStream.php b/classes/PlaylistArchiveStream.php index b12867d..c97f6b8 100644 --- a/classes/PlaylistArchiveStream.php +++ b/classes/PlaylistArchiveStream.php @@ -94,10 +94,10 @@ class PlaylistArchiveStream extends TarArchive $this->buffer = fopen('php://temp', 'r+'); foreach (explode(';', parse_url($path, PHP_URL_HOST)) as $url) { $this->files[] = [ - 'url' => urldecode($url), - 'headersSent'=> false, - 'complete' => false, - 'stream' => null, + 'url' => urldecode($url), + 'headersSent' => false, + 'complete' => false, + 'stream' => null, ]; } @@ -124,7 +124,7 @@ class PlaylistArchiveStream extends TarArchive { //We need this so Slim won't try to get the size of the stream return [ - 'mode'=> 0010000, + 'mode' => 0010000, ]; } diff --git a/classes/VideoDownload.php b/classes/VideoDownload.php index a1c45a2..dfbbdb0 100644 --- a/classes/VideoDownload.php +++ b/classes/VideoDownload.php @@ -195,12 +195,12 @@ class VideoDownload private function addOptionsToRtmpProcess(ProcessBuilder $builder, $video) { foreach ([ - 'url' => 'rtmp', - 'webpage_url' => 'pageUrl', - 'player_url' => 'swfVfy', + 'url' => 'rtmp', + 'webpage_url' => 'pageUrl', + 'player_url' => 'swfVfy', 'flash_version' => 'flashVer', - 'play_path' => 'playpath', - 'app' => 'app', + 'play_path' => 'playpath', + 'app' => 'app', ] as $property => $option) { if (isset($video->{$property})) { $builder->add('--'.$option); diff --git a/controllers/FrontController.php b/controllers/FrontController.php index 12a3fd2..87d8b02 100644 --- a/controllers/FrontController.php +++ b/controllers/FrontController.php @@ -158,8 +158,8 @@ class FrontController 'title' => 'Supported websites', 'description' => 'List of all supported websites from which Alltube Download '. 'can extract video or audio files', - 'canonical' => $this->getCanonicalUrl($request), - 'locale' => $this->localeManager->getLocale(), + 'canonical' => $this->getCanonicalUrl($request), + 'locale' => $this->localeManager->getLocale(), ] ); diff --git a/tests/FrontControllerTest.php b/tests/FrontControllerTest.php index c72ff60..f8bd064 100644 --- a/tests/FrontControllerTest.php +++ b/tests/FrontControllerTest.php @@ -162,7 +162,7 @@ class FrontControllerTest extends TestCase */ public function testConstructorWithStream() { - $controller = new FrontController($this->container, new Config(['stream'=>true])); + $controller = new FrontController($this->container, new Config(['stream' => true])); $this->assertInstanceOf(FrontController::class, $controller); } @@ -185,7 +185,7 @@ class FrontControllerTest extends TestCase { $result = $this->controller->index( Request::createFromEnvironment( - Environment::mock(['REQUEST_URI'=>'/foo', 'QUERY_STRING'=>'foo=bar']) + Environment::mock(['REQUEST_URI' => '/foo', 'QUERY_STRING' => 'foo=bar']) ), $this->response ); @@ -229,7 +229,7 @@ class FrontControllerTest extends TestCase */ public function testVideo() { - $this->assertRequestIsOk('video', ['url'=>'https://www.youtube.com/watch?v=M7IpKCZ47pU']); + $this->assertRequestIsOk('video', ['url' => 'https://www.youtube.com/watch?v=M7IpKCZ47pU']); } /** @@ -240,7 +240,7 @@ class FrontControllerTest extends TestCase public function testVideoWithoutTitle() { $this->markTestSkipped('This URL triggers a curl SSL error on Travis'); - $this->assertRequestIsOk('video', ['url'=>'http://html5demos.com/video']); + $this->assertRequestIsOk('video', ['url' => 'http://html5demos.com/video']); } /** @@ -250,7 +250,7 @@ class FrontControllerTest extends TestCase */ public function testVideoWithAudio() { - $this->assertRequestIsOk('video', ['url'=>'https://www.youtube.com/watch?v=M7IpKCZ47pU', 'audio'=>true]); + $this->assertRequestIsOk('video', ['url' => 'https://www.youtube.com/watch?v=M7IpKCZ47pU', 'audio' => true]); } /** @@ -262,7 +262,7 @@ class FrontControllerTest extends TestCase { $this->assertRequestIsRedirect( 'video', - ['url'=> 'https://2080.bandcamp.com/track/cygnus-x-the-orange-theme-2080-faulty-chip-cover', 'audio'=>true] + ['url' => 'https://2080.bandcamp.com/track/cygnus-x-the-orange-theme-2080-faulty-chip-cover', 'audio' => true] ); } @@ -274,8 +274,8 @@ class FrontControllerTest extends TestCase public function testVideoWithPassword() { $result = $this->controller->video( - $this->request->withQueryParams(['url'=>'http://vimeo.com/68375962']) - ->withParsedBody(['password'=>'youtube-dl']), + $this->request->withQueryParams(['url' => 'http://vimeo.com/68375962']) + ->withParsedBody(['password' => 'youtube-dl']), $this->response ); $this->assertTrue($result->isOk()); @@ -288,8 +288,8 @@ class FrontControllerTest extends TestCase */ public function testVideoWithMissingPassword() { - $this->assertRequestIsOk('video', ['url'=>'http://vimeo.com/68375962']); - $this->assertRequestIsOk('video', ['url'=>'http://vimeo.com/68375962', 'audio'=>true]); + $this->assertRequestIsOk('video', ['url' => 'http://vimeo.com/68375962']); + $this->assertRequestIsOk('video', ['url' => 'http://vimeo.com/68375962', 'audio' => true]); } /** @@ -299,11 +299,11 @@ class FrontControllerTest extends TestCase */ public function testVideoWithStream() { - $config = new Config(['stream'=>true]); - $this->assertRequestIsOk('video', ['url'=>'https://www.youtube.com/watch?v=M7IpKCZ47pU'], $config); + $config = new Config(['stream' => true]); + $this->assertRequestIsOk('video', ['url' => 'https://www.youtube.com/watch?v=M7IpKCZ47pU'], $config); $this->assertRequestIsOk( 'video', - ['url'=> 'https://www.youtube.com/watch?v=M7IpKCZ47pU', 'audio'=>true], + ['url' => 'https://www.youtube.com/watch?v=M7IpKCZ47pU', 'audio' => true], $config ); } @@ -317,7 +317,7 @@ class FrontControllerTest extends TestCase { $this->assertRequestIsOk( 'video', - ['url'=> 'https://www.youtube.com/playlist?list=PLgdySZU6KUXL_8Jq5aUkyNV7wCa-4wZsC'] + ['url' => 'https://www.youtube.com/playlist?list=PLgdySZU6KUXL_8Jq5aUkyNV7wCa-4wZsC'] ); } @@ -349,7 +349,7 @@ class FrontControllerTest extends TestCase */ public function testRedirect() { - $this->assertRequestIsRedirect('redirect', ['url'=>'https://www.youtube.com/watch?v=M7IpKCZ47pU']); + $this->assertRequestIsRedirect('redirect', ['url' => 'https://www.youtube.com/watch?v=M7IpKCZ47pU']); } /** @@ -361,7 +361,7 @@ class FrontControllerTest extends TestCase { $this->assertRequestIsRedirect( 'redirect', - ['url'=> 'https://www.youtube.com/watch?v=M7IpKCZ47pU', 'format'=>'worst'] + ['url' => 'https://www.youtube.com/watch?v=M7IpKCZ47pU', 'format' => 'worst'] ); } @@ -374,8 +374,8 @@ class FrontControllerTest extends TestCase { $this->assertRequestIsOk( 'redirect', - ['url'=> 'https://www.youtube.com/watch?v=M7IpKCZ47pU'], - new Config(['stream'=>true]) + ['url' => 'https://www.youtube.com/watch?v=M7IpKCZ47pU'], + new Config(['stream' => true]) ); } @@ -388,8 +388,8 @@ class FrontControllerTest extends TestCase { $this->assertRequestIsOk( 'redirect', - ['url'=> 'https://twitter.com/verge/status/813055465324056576/video/1'], - new Config(['stream'=>true]) + ['url' => 'https://twitter.com/verge/status/813055465324056576/video/1'], + new Config(['stream' => true]) ); } @@ -402,8 +402,8 @@ class FrontControllerTest extends TestCase { $this->assertRequestIsOk( 'redirect', - ['url'=> 'http://www.canalc2.tv/video/12163', 'format'=>'rtmp'], - new Config(['stream'=>true]) + ['url' => 'http://www.canalc2.tv/video/12163', 'format' => 'rtmp'], + new Config(['stream' => true]) ); } @@ -417,10 +417,10 @@ class FrontControllerTest extends TestCase $this->assertRequestIsOk( 'redirect', [ - 'url' => 'https://www.youtube.com/watch?v=M7IpKCZ47pU', - 'format'=> 'bestvideo+bestaudio', + 'url' => 'https://www.youtube.com/watch?v=M7IpKCZ47pU', + 'format' => 'bestvideo+bestaudio', ], - new Config(['remux'=>true]) + new Config(['remux' => true]) ); } @@ -434,8 +434,8 @@ class FrontControllerTest extends TestCase $this->assertRequestIsServerError( 'redirect', [ - 'url' => 'https://www.youtube.com/watch?v=M7IpKCZ47pU', - 'format'=> 'bestvideo+bestaudio', + 'url' => 'https://www.youtube.com/watch?v=M7IpKCZ47pU', + 'format' => 'bestvideo+bestaudio', ] ); } @@ -447,7 +447,7 @@ class FrontControllerTest extends TestCase */ public function testRedirectWithMissingPassword() { - $this->assertRequestIsRedirect('redirect', ['url'=>'http://vimeo.com/68375962']); + $this->assertRequestIsRedirect('redirect', ['url' => 'http://vimeo.com/68375962']); } /** @@ -457,7 +457,7 @@ class FrontControllerTest extends TestCase */ public function testRedirectWithError() { - $this->assertRequestIsServerError('redirect', ['url'=>'http://example.com/foo']); + $this->assertRequestIsServerError('redirect', ['url' => 'http://example.com/foo']); } /** @@ -470,7 +470,7 @@ class FrontControllerTest extends TestCase { $this->assertRequestIsServerError( 'redirect', - ['url'=> 'https://www.youtube.com/playlist?list=PLgdySZU6KUXL_8Jq5aUkyNV7wCa-4wZsC'] + ['url' => 'https://www.youtube.com/playlist?list=PLgdySZU6KUXL_8Jq5aUkyNV7wCa-4wZsC'] ); } @@ -483,8 +483,8 @@ class FrontControllerTest extends TestCase { $this->assertRequestIsOk( 'redirect', - ['url'=> 'https://www.youtube.com/playlist?list=PLgdySZU6KUXL_8Jq5aUkyNV7wCa-4wZsC'], - new Config(['stream'=>true]) + ['url' => 'https://www.youtube.com/playlist?list=PLgdySZU6KUXL_8Jq5aUkyNV7wCa-4wZsC'], + new Config(['stream' => true]) ); } @@ -499,7 +499,7 @@ class FrontControllerTest extends TestCase $this->controller->locale( $this->request, $this->response, - ['locale'=> 'fr_FR'] + ['locale' => 'fr_FR'] )->isRedirect() ); } diff --git a/tests/LocaleMiddlewareTest.php b/tests/LocaleMiddlewareTest.php index 0f4e2ae..1845327 100644 --- a/tests/LocaleMiddlewareTest.php +++ b/tests/LocaleMiddlewareTest.php @@ -44,8 +44,8 @@ class LocaleMiddlewareTest extends TestCase { $this->markTestSkipped('For some reason, this test fails on Travis even if the fr_FR locale is installed.'); $locale = [ - 'language'=> 'fr', - 'region' => 'FR', + 'language' => 'fr', + 'region' => 'FR', ]; $this->assertEquals('fr_FR', $this->middleware->testLocale($locale)); } @@ -58,8 +58,8 @@ class LocaleMiddlewareTest extends TestCase public function testLocaleWithWrongLocale() { $locale = [ - 'language'=> 'foo', - 'region' => 'BAR', + 'language' => 'foo', + 'region' => 'BAR', ]; $this->assertNull($this->middleware->testLocale($locale)); $this->assertNull($this->middleware->testLocale([])); diff --git a/tests/PlaylistArchiveStreamTest.php b/tests/PlaylistArchiveStreamTest.php index c986416..2e3e4a7 100644 --- a/tests/PlaylistArchiveStreamTest.php +++ b/tests/PlaylistArchiveStreamTest.php @@ -55,7 +55,7 @@ class PlaylistArchiveStreamTest extends TestCase */ public function testStreamStat() { - $this->assertEquals(['mode'=>4096], $this->stream->stream_stat()); + $this->assertEquals(['mode' => 4096], $this->stream->stream_stat()); } /** diff --git a/tests/VideoDownloadTest.php b/tests/VideoDownloadTest.php index 68f6e51..ed5d75c 100644 --- a/tests/VideoDownloadTest.php +++ b/tests/VideoDownloadTest.php @@ -364,7 +364,7 @@ class VideoDownloadTest extends TestCase */ public function testGetAudioStreamAvconvError($url, $format) { - $download = new VideoDownload(new Config(['avconv'=>'foobar'])); + $download = new VideoDownload(new Config(['avconv' => 'foobar'])); $download->getAudioStream($url, $format); } @@ -380,7 +380,7 @@ class VideoDownloadTest extends TestCase */ public function testGetAudioStreamRtmpError($url, $format) { - $download = new VideoDownload(new Config(['rtmpdump'=>'foobar'])); + $download = new VideoDownload(new Config(['rtmpdump' => 'foobar'])); $download->getAudioStream($url, $format); } @@ -477,7 +477,7 @@ class VideoDownloadTest extends TestCase */ public function testGetM3uStreamAvconvError($url, $format) { - $download = new VideoDownload(new Config(['avconv'=>'foobar'])); + $download = new VideoDownload(new Config(['avconv' => 'foobar'])); $video = $download->getJSON($url, $format); $download->getM3uStream($video); } From 2fead564b475ca3756b762222631034225e1bdec Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 29 Oct 2017 23:22:14 +0100 Subject: [PATCH 09/77] Use PHP 7.1 on Travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b005f82..01aa3d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ --- language: php -php: 7 +php: 7.1 addons: apt: packages: From 76f3ecfec8868e55b8e3ec6544079bd8600102ec Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 29 Oct 2017 23:51:45 +0100 Subject: [PATCH 10/77] Force doctrine/instantiator so we can still use PHP 7.0 --- composer.json | 1 + composer.lock | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index ef193a7..bfb1690 100644 --- a/composer.json +++ b/composer.json @@ -22,6 +22,7 @@ "symfony/var-dumper": "~3.3.9", "squizlabs/php_codesniffer": "~3.1.0", "phpunit/phpunit": "~6.4.3", + "doctrine/instantiator": "~1.0.0", "ffmpeg/ffmpeg": "dev-release", "rg3/youtube-dl": "~2017.10.20", "rudloff/rtmpdump-bin": "~2.3.0", diff --git a/composer.lock b/composer.lock index 124c6c3..c41240e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "a187493715c03ec2fc880fdf1e4dae70", + "content-hash": "bb5bb53875e26136ad30f50a0ec063a6", "packages": [ { "name": "aura/session", @@ -999,32 +999,32 @@ "packages-dev": [ { "name": "doctrine/instantiator", - "version": "1.1.0", + "version": "1.0.5", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", "shasum": "" }, "require": { - "php": "^7.1" + "php": ">=5.3,<8.0-DEV" }, "require-dev": { "athletic/athletic": "~0.1.8", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "^6.2.3", - "squizlabs/php_codesniffer": "^3.0.2" + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { @@ -1049,7 +1049,7 @@ "constructor", "instantiate" ], - "time": "2017-07-22T11:58:36+00:00" + "time": "2015-06-14T21:17:01+00:00" }, { "name": "ffmpeg/ffmpeg", From 934154d7b269b74341af49e7398e1a1c3ecebd40 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Wed, 1 Nov 2017 10:45:25 +0100 Subject: [PATCH 11/77] Update youtube-dl to 2017.10.29 --- composer.json | 6 +++--- composer.lock | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index bfb1690..342fa55 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "phpunit/phpunit": "~6.4.3", "doctrine/instantiator": "~1.0.0", "ffmpeg/ffmpeg": "dev-release", - "rg3/youtube-dl": "~2017.10.20", + "rg3/youtube-dl": "2017.10.29", "rudloff/rtmpdump-bin": "~2.3.0", "heroku/heroku-buildpack-php": "*" }, @@ -40,10 +40,10 @@ "type": "package", "package": { "name": "rg3/youtube-dl", - "version": "2017.10.20", + "version": "2017.10.29", "dist": { "type": "zip", - "url": "https://github.com/rg3/youtube-dl/archive/2017.10.20.zip" + "url": "https://github.com/rg3/youtube-dl/archive/2017.10.29.zip" } } }, diff --git a/composer.lock b/composer.lock index c41240e..4e20a50 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "bb5bb53875e26136ad30f50a0ec063a6", + "content-hash": "efc0633ab84338ccf8a3f7203549a75e", "packages": [ { "name": "aura/session", @@ -1860,10 +1860,10 @@ }, { "name": "rg3/youtube-dl", - "version": "2017.10.20", + "version": "2017.10.29", "dist": { "type": "zip", - "url": "https://github.com/rg3/youtube-dl/archive/2017.10.20.zip", + "url": "https://github.com/rg3/youtube-dl/archive/2017.10.29.zip", "reference": null, "shasum": null }, From d3988503d5543b09df58f325b490b3f7e9b2e7b4 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Wed, 1 Nov 2017 23:02:19 +0100 Subject: [PATCH 12/77] Fix PhantomJS crash with the openload extractor (see #132) --- classes/VideoDownload.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/classes/VideoDownload.php b/classes/VideoDownload.php index dfbbdb0..3140d08 100644 --- a/classes/VideoDownload.php +++ b/classes/VideoDownload.php @@ -86,6 +86,10 @@ class VideoDownload $this->procBuilder->add('--video-password'); $this->procBuilder->add($password); } + + //This is needed by the openload extractor because it runs PhantomJS + $this->procBuilder->setEnv('QT_QPA_PLATFORM', 'offscreen'); + $process = $this->procBuilder->getProcess(); $process->run(); if (!$process->isSuccessful()) { From 095c1a92f07e3952184713865ac0924403ad053b Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Thu, 2 Nov 2017 16:26:10 +0100 Subject: [PATCH 13/77] Some HLS streams have "m3u8_native" as protocol value (see #133) --- controllers/FrontController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/FrontController.php b/controllers/FrontController.php index 87d8b02..39c68a8 100644 --- a/controllers/FrontController.php +++ b/controllers/FrontController.php @@ -360,7 +360,7 @@ class FrontController $stream = $this->download->getRtmpStream($video); $response = $response->withHeader('Content-Type', 'video/'.$video->ext); $body = new Stream($stream); - } elseif ($video->protocol == 'm3u8') { + } elseif ($video->protocol == 'm3u8' || $video->protocol == 'm3u8_native') { $stream = $this->download->getM3uStream($video); $response = $response->withHeader('Content-Type', 'video/'.$video->ext); $body = new Stream($stream); From 46e962563dc5aaa132dea689fdcfb7e67f6aefbf Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Fri, 3 Nov 2017 10:17:34 +0100 Subject: [PATCH 14/77] Use a local Composer because the one in Debian stable is too old for some tasks --- composer.json | 3 +- composer.lock | 755 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 747 insertions(+), 11 deletions(-) diff --git a/composer.json b/composer.json index 342fa55..509f291 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,8 @@ "ffmpeg/ffmpeg": "dev-release", "rg3/youtube-dl": "2017.10.29", "rudloff/rtmpdump-bin": "~2.3.0", - "heroku/heroku-buildpack-php": "*" + "heroku/heroku-buildpack-php": "*", + "composer/composer": "~1.5.0" }, "extra": { "paas": { diff --git a/composer.lock b/composer.lock index 4e20a50..a63558d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "efc0633ab84338ccf8a3f7203549a75e", + "content-hash": "94c8aba82bc6ac2e9e23a84b1530178e", "packages": [ { "name": "aura/session", @@ -997,6 +997,265 @@ } ], "packages-dev": [ + { + "name": "composer/ca-bundle", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/composer/ca-bundle.git", + "reference": "9dd73a03951357922d8aee6cc084500de93e2343" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/9dd73a03951357922d8aee6cc084500de93e2343", + "reference": "9dd73a03951357922d8aee6cc084500de93e2343", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5", + "psr/log": "^1.0", + "symfony/process": "^2.5 || ^3.0" + }, + "suggest": { + "symfony/process": "This is necessary to reliably check whether openssl_x509_parse is vulnerable on older php versions, but can be ignored on PHP 5.5.6+" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "time": "2017-09-11T07:24:36+00:00" + }, + { + "name": "composer/composer", + "version": "1.5.2", + "source": { + "type": "git", + "url": "https://github.com/composer/composer.git", + "reference": "c639623fa2178b404ed4bab80f0d1263853fa4ae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/composer/zipball/c639623fa2178b404ed4bab80f0d1263853fa4ae", + "reference": "c639623fa2178b404ed4bab80f0d1263853fa4ae", + "shasum": "" + }, + "require": { + "composer/ca-bundle": "^1.0", + "composer/semver": "^1.0", + "composer/spdx-licenses": "^1.0", + "justinrainbow/json-schema": "^3.0 || ^4.0 || ^5.0", + "php": "^5.3.2 || ^7.0", + "psr/log": "^1.0", + "seld/cli-prompt": "^1.0", + "seld/jsonlint": "^1.4", + "seld/phar-utils": "^1.0", + "symfony/console": "^2.7 || ^3.0", + "symfony/filesystem": "^2.7 || ^3.0", + "symfony/finder": "^2.7 || ^3.0", + "symfony/process": "^2.7 || ^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5 || ^5.0.5", + "phpunit/phpunit-mock-objects": "^2.3 || ^3.0" + }, + "suggest": { + "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", + "ext-zip": "Enabling the zip extension allows you to unzip archives", + "ext-zlib": "Allow gzip compression of HTTP requests" + }, + "bin": [ + "bin/composer" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\": "src/Composer" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Composer helps you declare, manage and install dependencies of PHP projects, ensuring you have the right stack everywhere.", + "homepage": "https://getcomposer.org/", + "keywords": [ + "autoload", + "dependency", + "package" + ], + "time": "2017-09-11T14:59:26+00:00" + }, + { + "name": "composer/semver", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/c7cb9a2095a074d131b65a8a0cd294479d785573", + "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5 || ^5.0.5", + "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "time": "2016-08-30T16:08:34+00:00" + }, + { + "name": "composer/spdx-licenses", + "version": "1.1.6", + "source": { + "type": "git", + "url": "https://github.com/composer/spdx-licenses.git", + "reference": "2603a0d7ddc00a015deb576fa5297ca43dee6b1c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/2603a0d7ddc00a015deb576fa5297ca43dee6b1c", + "reference": "2603a0d7ddc00a015deb576fa5297ca43dee6b1c", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5 || ^5.0.5", + "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Spdx\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "SPDX licenses list and validation library.", + "keywords": [ + "license", + "spdx", + "validator" + ], + "time": "2017-04-03T19:08:52+00:00" + }, { "name": "doctrine/instantiator", "version": "1.0.5", @@ -1109,6 +1368,72 @@ ], "time": "2017-10-28T00:17:41+00:00" }, + { + "name": "justinrainbow/json-schema", + "version": "5.2.6", + "source": { + "type": "git", + "url": "https://github.com/justinrainbow/json-schema.git", + "reference": "d283e11b6e14c6f4664cf080415c4341293e5bbd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/d283e11b6e14c6f4664cf080415c4341293e5bbd", + "reference": "d283e11b6e14c6f4664cf080415c4341293e5bbd", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.1", + "json-schema/json-schema-test-suite": "1.2.0", + "phpunit/phpunit": "^4.8.22" + }, + "bin": [ + "bin/validate-json" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "JsonSchema\\": "src/JsonSchema/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bruno Prieto Reis", + "email": "bruno.p.reis@gmail.com" + }, + { + "name": "Justin Rainbow", + "email": "justin.rainbow@gmail.com" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + }, + { + "name": "Robert Schönthal", + "email": "seroscho@googlemail.com" + } + ], + "description": "A library to validate a json schema.", + "homepage": "https://github.com/justinrainbow/json-schema", + "keywords": [ + "json", + "schema" + ], + "time": "2017-10-21T13:15:38+00:00" + }, { "name": "myclabs/deep-copy", "version": "1.7.0", @@ -1858,6 +2183,53 @@ ], "time": "2017-08-03T14:08:16+00:00" }, + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10T12:19:37+00:00" + }, { "name": "rg3/youtube-dl", "version": "2017.10.29", @@ -1944,30 +2316,30 @@ }, { "name": "sebastian/comparator", - "version": "2.0.2", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "ae068fede81d06e7bb9bb46a367210a3d3e1fe6a" + "reference": "1174d9018191e93cb9d719edec01257fc05f8158" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/ae068fede81d06e7bb9bb46a367210a3d3e1fe6a", - "reference": "ae068fede81d06e7bb9bb46a367210a3d3e1fe6a", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1174d9018191e93cb9d719edec01257fc05f8158", + "reference": "1174d9018191e93cb9d719edec01257fc05f8158", "shasum": "" }, "require": { "php": "^7.0", "sebastian/diff": "^2.0", - "sebastian/exporter": "^3.0" + "sebastian/exporter": "^3.1" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^6.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "2.1.x-dev" } }, "autoload": { @@ -1998,13 +2370,13 @@ } ], "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", + "homepage": "https://github.com/sebastianbergmann/comparator", "keywords": [ "comparator", "compare", "equality" ], - "time": "2017-08-03T07:14:59+00:00" + "time": "2017-11-03T07:16:52+00:00" }, { "name": "sebastian/diff", @@ -2456,6 +2828,147 @@ "homepage": "https://github.com/sebastianbergmann/version", "time": "2016-10-03T07:35:21+00:00" }, + { + "name": "seld/cli-prompt", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/cli-prompt.git", + "reference": "a19a7376a4689d4d94cab66ab4f3c816019ba8dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/cli-prompt/zipball/a19a7376a4689d4d94cab66ab4f3c816019ba8dd", + "reference": "a19a7376a4689d4d94cab66ab4f3c816019ba8dd", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Seld\\CliPrompt\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "Allows you to prompt for user input on the command line, and optionally hide the characters they type", + "keywords": [ + "cli", + "console", + "hidden", + "input", + "prompt" + ], + "time": "2017-03-18T11:32:45+00:00" + }, + { + "name": "seld/jsonlint", + "version": "1.6.1", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/jsonlint.git", + "reference": "50d63f2858d87c4738d5b76a7dcbb99fa8cf7c77" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/50d63f2858d87c4738d5b76a7dcbb99fa8cf7c77", + "reference": "50d63f2858d87c4738d5b76a7dcbb99fa8cf7c77", + "shasum": "" + }, + "require": { + "php": "^5.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5" + }, + "bin": [ + "bin/jsonlint" + ], + "type": "library", + "autoload": { + "psr-4": { + "Seld\\JsonLint\\": "src/Seld/JsonLint/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "JSON Linter", + "keywords": [ + "json", + "linter", + "parser", + "validator" + ], + "time": "2017-06-18T15:11:04+00:00" + }, + { + "name": "seld/phar-utils", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/phar-utils.git", + "reference": "7009b5139491975ef6486545a39f3e6dad5ac30a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/7009b5139491975ef6486545a39f3e6dad5ac30a", + "reference": "7009b5139491975ef6486545a39f3e6dad5ac30a", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Seld\\PharUtils\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "PHAR file format utilities, for when PHP phars you up", + "keywords": [ + "phra" + ], + "time": "2015-10-13T18:44:15+00:00" + }, { "name": "squizlabs/php_codesniffer", "version": "3.1.1", @@ -2507,6 +3020,228 @@ ], "time": "2017-10-16T22:40:25+00:00" }, + { + "name": "symfony/console", + "version": "v3.3.10", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "116bc56e45a8e5572e51eb43ab58c769a352366c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/116bc56e45a8e5572e51eb43ab58c769a352366c", + "reference": "116bc56e45a8e5572e51eb43ab58c769a352366c", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/dependency-injection": "<3.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.3", + "symfony/dependency-injection": "~3.3", + "symfony/event-dispatcher": "~2.8|~3.0", + "symfony/filesystem": "~2.8|~3.0", + "symfony/process": "~2.8|~3.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/filesystem": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2017-10-02T06:42:24+00:00" + }, + { + "name": "symfony/debug", + "version": "v3.3.10", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "eb95d9ce8f18dcc1b3dfff00cb624c402be78ffd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/eb95d9ce8f18dcc1b3dfff00cb624c402be78ffd", + "reference": "eb95d9ce8f18dcc1b3dfff00cb624c402be78ffd", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/http-kernel": "~2.8|~3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2017-10-02T06:42:24+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v3.3.10", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "90bc45abf02ae6b7deb43895c1052cb0038506f1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/90bc45abf02ae6b7deb43895c1052cb0038506f1", + "reference": "90bc45abf02ae6b7deb43895c1052cb0038506f1", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2017-10-03T13:33:10+00:00" + }, + { + "name": "symfony/finder", + "version": "v3.3.10", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "773e19a491d97926f236942484cb541560ce862d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/773e19a491d97926f236942484cb541560ce862d", + "reference": "773e19a491d97926f236942484cb541560ce862d", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2017-10-02T06:42:24+00:00" + }, { "name": "symfony/polyfill-mbstring", "version": "v1.6.0", From 70f5ef2b6d64e40ca166b3c83bd9775da9565498 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 5 Nov 2017 16:22:17 +0100 Subject: [PATCH 15/77] phpunit/php-code-coverage update --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index a63558d..6833407 100644 --- a/composer.lock +++ b/composer.lock @@ -1792,16 +1792,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "5.2.2", + "version": "5.2.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "8ed1902a57849e117b5651fc1a5c48110946c06b" + "reference": "8e1d2397d8adf59a3f12b2878a3aaa66d1ab189d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/8ed1902a57849e117b5651fc1a5c48110946c06b", - "reference": "8ed1902a57849e117b5651fc1a5c48110946c06b", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/8e1d2397d8adf59a3f12b2878a3aaa66d1ab189d", + "reference": "8e1d2397d8adf59a3f12b2878a3aaa66d1ab189d", "shasum": "" }, "require": { @@ -1810,7 +1810,7 @@ "php": "^7.0", "phpunit/php-file-iterator": "^1.4.2", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^1.4.11 || ^2.0", + "phpunit/php-token-stream": "^2.0", "sebastian/code-unit-reverse-lookup": "^1.0.1", "sebastian/environment": "^3.0", "sebastian/version": "^2.0.1", @@ -1852,7 +1852,7 @@ "testing", "xunit" ], - "time": "2017-08-03T12:40:43+00:00" + "time": "2017-11-03T13:47:33+00:00" }, { "name": "phpunit/php-file-iterator", From 5d4fb0a8c656bf22fe03a05340164fcc65539bdc Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 5 Nov 2017 16:25:25 +0100 Subject: [PATCH 16/77] We don't need to explicitely require Smarty --- composer.json | 1 - composer.lock | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 509f291..6dff269 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,6 @@ "homepage": "http://alltubedownload.net/", "type": "project", "require": { - "smarty/smarty": "~3.1.29", "slim/slim": "~3.8.1", "mathmarques/smarty-view": "~1.1.0", "symfony/yaml": "~3.3.9", diff --git a/composer.lock b/composer.lock index 6833407..0471a8e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "94c8aba82bc6ac2e9e23a84b1530178e", + "content-hash": "b4620e248b66d7c23f04b56bb37cf35b", "packages": [ { "name": "aura/session", From 528c9eedf23c993a6b37387cc5a6cd71fb63cdac Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Tue, 7 Nov 2017 01:34:18 +0100 Subject: [PATCH 17/77] yarn upgrade --- yarn.lock | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/yarn.lock b/yarn.lock index d7a5009..3ddb557 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11,13 +11,13 @@ abbrev@1: resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" ajv@^5.1.0: - version "5.2.3" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.2.3.tgz#c06f598778c44c6b161abafe3466b81ad1814ed2" + version "5.3.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.3.0.tgz#4414ff74a50879c208ee5fdc826e32c303549eda" dependencies: co "^4.6.0" fast-deep-equal "^1.0.0" + fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.3.0" - json-stable-stringify "^1.0.1" alce@1.0.0: version "1.0.0" @@ -453,6 +453,10 @@ fast-deep-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff" +fast-json-stable-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + faye-websocket@~0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.10.0.tgz#4e492f8d04dfb6f89003507f6edbf2d501e7c6f4" @@ -942,20 +946,10 @@ json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" -json-stable-stringify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" - dependencies: - jsonify "~0.0.0" - json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" -jsonify@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" - jsonlint@1.6.2: version "1.6.2" resolved "https://registry.yarnpkg.com/jsonlint/-/jsonlint-1.6.2.tgz#5737045085f55eb455c68b1ff4ebc01bd50e8830" @@ -1095,8 +1089,10 @@ nan@^2.6.2: resolved "https://registry.yarnpkg.com/nan/-/nan-2.7.0.tgz#d95bf721ec877e08db276ed3fc6eb78f9083ad46" node-abi@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-2.1.1.tgz#c9cda256ec8aa99bcab2f6446db38af143338b2a" + version "2.1.2" + resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-2.1.2.tgz#4da6caceb6685fcd31e7dd1994ef6bb7d0a9c0b2" + dependencies: + semver "^5.4.1" node-gyp@^3.6.2: version "3.6.2" @@ -1437,8 +1433,8 @@ request@2: uuid "^3.1.0" resolve@^1.1.6: - version "1.4.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.4.0.tgz#a75be01c53da25d934a98ebd0e4c4a7312f92a86" + version "1.5.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" dependencies: path-parse "^1.0.5" @@ -1460,7 +1456,7 @@ safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" -"semver@2 || 3 || 4 || 5": +"semver@2 || 3 || 4 || 5", semver@^5.4.1: version "5.4.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" @@ -1493,8 +1489,8 @@ simple-get@^1.4.2: xtend "^4.0.0" sntp@2.x.x: - version "2.0.2" - resolved "https://registry.yarnpkg.com/sntp/-/sntp-2.0.2.tgz#5064110f0af85f7cfdb7d6b67a40028ce52b4b2b" + version "2.1.0" + resolved "https://registry.yarnpkg.com/sntp/-/sntp-2.1.0.tgz#2c6cec14fedc2222739caf9b5c3d85d1cc5a2cc8" dependencies: hoek "4.x.x" @@ -1535,8 +1531,8 @@ sshpk@^1.7.0: tweetnacl "~0.14.0" statuses@1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.1.tgz#faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e" + version "1.4.0" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.4.0.tgz#bb73d446da2796106efcc1b601a253d6c46bd087" stream-buffers@^2.1.0: version "2.2.0" From c994f8ac9afae1ca22683b2eade69f0ce5525b89 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Fri, 10 Nov 2017 11:47:23 +0100 Subject: [PATCH 18/77] Add missing assertions to testGetInstanceWithEmptyFile --- tests/ConfigTest.php | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index 37e7419..2ecb6a0 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -46,11 +46,27 @@ class ConfigTest extends TestCase public function testGetInstance() { $this->assertEquals($this->config->convert, false); - $this->assertInternalType('array', $this->config->params); - $this->assertInternalType('string', $this->config->youtubedl); - $this->assertInternalType('string', $this->config->python); - $this->assertInternalType('string', $this->config->avconv); - $this->assertInternalType('string', $this->config->rtmpdump); + $this->assertConfig($this->config); + } + + /** + * Assert that a Config object is correctly instantiated. + * + * @param Config $config Config class instance. + * + * @return void + */ + private function assertConfig(Config $config) + { + $this->assertInternalType('array', $config->params); + $this->assertInternalType('string', $config->youtubedl); + $this->assertInternalType('string', $config->python); + $this->assertInternalType('string', $config->avconv); + $this->assertInternalType('string', $config->rtmpdump); + $this->assertInternalType('bool', $config->convert); + $this->assertInternalType('bool', $config->uglyUrls); + $this->assertInternalType('bool', $config->stream); + $this->assertInternalType('bool', $config->remux); } /** @@ -65,13 +81,14 @@ class ConfigTest extends TestCase } /** - * Test the getInstance function with aen empty filename. + * Test the getInstance function with an empty filename. * * @return void */ public function testGetInstanceWithEmptyFile() { - Config::getInstance(''); + $config = Config::getInstance(''); + $this->assertConfig($config); } /** From 8848a8dbf398963ef6e523f5e5560ef4db8608c0 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Fri, 10 Nov 2017 12:18:20 +0100 Subject: [PATCH 19/77] Improve LocaleMiddlewareTest Add a way to unset the current locale --- classes/LocaleManager.php | 9 +++++++ tests/LocaleManagerTest.php | 11 ++++++++ tests/LocaleMiddlewareTest.php | 46 +++++++++++++++++++++++++++------- 3 files changed, 57 insertions(+), 9 deletions(-) diff --git a/classes/LocaleManager.php b/classes/LocaleManager.php index 7e36e8c..03531fb 100644 --- a/classes/LocaleManager.php +++ b/classes/LocaleManager.php @@ -95,4 +95,13 @@ class LocaleManager $this->curLocale = $locale; $this->sessionSegment->set('locale', $locale); } + + /** + * Unset the current locale. + */ + public function unsetLocale() + { + $this->curLocale = null; + $this->sessionSegment->clear('locale'); + } } diff --git a/tests/LocaleManagerTest.php b/tests/LocaleManagerTest.php index 7eb5cdb..2808362 100644 --- a/tests/LocaleManagerTest.php +++ b/tests/LocaleManagerTest.php @@ -75,4 +75,15 @@ class LocaleManagerTest extends TestCase $this->assertInstanceOf(Locale::class, $locale); $this->assertEquals('foo_BAR', (string) $locale); } + + /** + * Test the unsetLocale function. + * + * @return void + */ + public function testUnsetLocale() + { + $this->localeManager->unsetLocale(); + $this->assertNull($this->localeManager->getLocale()); + } } diff --git a/tests/LocaleMiddlewareTest.php b/tests/LocaleMiddlewareTest.php index 1845327..35c30e2 100644 --- a/tests/LocaleMiddlewareTest.php +++ b/tests/LocaleMiddlewareTest.php @@ -5,6 +5,7 @@ namespace Alltube\Test; +use Alltube\Locale; use Alltube\LocaleManager; use Alltube\LocaleMiddleware; use PHPUnit\Framework\TestCase; @@ -30,9 +31,19 @@ class LocaleMiddlewareTest extends TestCase */ protected function setUp() { - $container = new Container(); - $container['locale'] = new LocaleManager(); - $this->middleware = new LocaleMiddleware($container); + $this->container = new Container(); + $this->container['locale'] = new LocaleManager(); + $this->middleware = new LocaleMiddleware($this->container); + } + + /** + * Unset locale cookie after each test. + * + * @return void + */ + protected function tearDown() + { + $this->container['locale']->unsetLocale(); } /** @@ -66,12 +77,29 @@ class LocaleMiddlewareTest extends TestCase } /** - * Mock function that does nothing. + * Check that the request contains an Accept-Language header. + * + * @param Request $request PSR-7 request * * @return void */ - public function nothing() + public function assertHeader(Request $request) { + $header = $request->getHeader('Accept-Language'); + $this->assertEquals('foo-BAR', $header[0]); + } + + /** + * Check that the request contains no Accept-Language header. + * + * @param Request $request PSR-7 request + * + * @return void + */ + public function assertNoHeader(Request $request) + { + $header = $request->getHeader('Accept-Language'); + $this->assertEmpty($header); } /** @@ -83,14 +111,14 @@ class LocaleMiddlewareTest extends TestCase { $request = Request::createFromEnvironment(Environment::mock()); $this->middleware->__invoke( - $request->withHeader('Accept-Language', 'fr-FR'), + $request->withHeader('Accept-Language', 'foo-BAR'), new Response(), - [$this, 'nothing'] + [$this, 'assertHeader'] ); } /** - * Test the __invoke() function withot the Accept-Language header. + * Test the __invoke() function without the Accept-Language header. * * @return void */ @@ -100,7 +128,7 @@ class LocaleMiddlewareTest extends TestCase $this->middleware->__invoke( $request->withoutHeader('Accept-Language'), new Response(), - [$this, 'nothing'] + [$this, 'assertNoHeader'] ); } From bdcbf19cee8525bbdd60b15e70a934394d8e0cd6 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Fri, 10 Nov 2017 12:19:04 +0100 Subject: [PATCH 20/77] Lint --- tests/ConfigTest.php | 2 +- tests/FrontControllerTest.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index 2ecb6a0..8e49632 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -52,7 +52,7 @@ class ConfigTest extends TestCase /** * Assert that a Config object is correctly instantiated. * - * @param Config $config Config class instance. + * @param Config $config Config class instance. * * @return void */ diff --git a/tests/FrontControllerTest.php b/tests/FrontControllerTest.php index f8bd064..69ce74c 100644 --- a/tests/FrontControllerTest.php +++ b/tests/FrontControllerTest.php @@ -262,7 +262,10 @@ class FrontControllerTest extends TestCase { $this->assertRequestIsRedirect( 'video', - ['url' => 'https://2080.bandcamp.com/track/cygnus-x-the-orange-theme-2080-faulty-chip-cover', 'audio' => true] + [ + 'url' => 'https://2080.bandcamp.com/track/cygnus-x-the-orange-theme-2080-faulty-chip-cover', + 'audio' => true, + ] ); } From 55c64f75d8e6c80a4b46a5169453263fddc8dc44 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Fri, 10 Nov 2017 12:47:19 +0100 Subject: [PATCH 21/77] phpunit update --- composer.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index 0471a8e..d4a3e6b 100644 --- a/composer.lock +++ b/composer.lock @@ -2042,16 +2042,16 @@ }, { "name": "phpunit/phpunit", - "version": "6.4.3", + "version": "6.4.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "06b28548fd2b4a20c3cd6e247dc86331a7d4db13" + "reference": "562f7dc75d46510a4ed5d16189ae57fbe45a9932" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/06b28548fd2b4a20c3cd6e247dc86331a7d4db13", - "reference": "06b28548fd2b4a20c3cd6e247dc86331a7d4db13", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/562f7dc75d46510a4ed5d16189ae57fbe45a9932", + "reference": "562f7dc75d46510a4ed5d16189ae57fbe45a9932", "shasum": "" }, "require": { @@ -2122,7 +2122,7 @@ "testing", "xunit" ], - "time": "2017-10-16T13:18:59+00:00" + "time": "2017-11-08T11:26:09+00:00" }, { "name": "phpunit/phpunit-mock-objects", From baad5e73ea74b87faf367f76a79d9429f57eb431 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Fri, 10 Nov 2017 13:04:14 +0100 Subject: [PATCH 22/77] Add a way to easily run youtube-dl with Composer --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6dff269..cc62c44 100644 --- a/composer.json +++ b/composer.json @@ -84,6 +84,7 @@ }, "scripts": { "compile": "composer install --ignore-platform-reqs", - "update-locales": "tsmarty2c.php templates > i18n/template.pot" + "update-locales": "tsmarty2c.php templates > i18n/template.pot", + "youtube-dl": "vendor/rg3/youtube-dl/youtube_dl/__main__.py" } } From 078ead9aec572fe573ac43327c7af2fe1686ed29 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Fri, 10 Nov 2017 13:23:23 +0100 Subject: [PATCH 23/77] Update youtube-dl to 2017.11.06 --- composer.json | 6 +++--- composer.lock | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index cc62c44..f35678b 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "phpunit/phpunit": "~6.4.3", "doctrine/instantiator": "~1.0.0", "ffmpeg/ffmpeg": "dev-release", - "rg3/youtube-dl": "2017.10.29", + "rg3/youtube-dl": "2017.11.06", "rudloff/rtmpdump-bin": "~2.3.0", "heroku/heroku-buildpack-php": "*", "composer/composer": "~1.5.0" @@ -40,10 +40,10 @@ "type": "package", "package": { "name": "rg3/youtube-dl", - "version": "2017.10.29", + "version": "2017.11.06", "dist": { "type": "zip", - "url": "https://github.com/rg3/youtube-dl/archive/2017.10.29.zip" + "url": "https://github.com/rg3/youtube-dl/archive/2017.11.06.zip" } } }, diff --git a/composer.lock b/composer.lock index d4a3e6b..99a2d79 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "b4620e248b66d7c23f04b56bb37cf35b", + "content-hash": "2f2bb96c33a90fba39cb7e492875684e", "packages": [ { "name": "aura/session", @@ -2232,10 +2232,10 @@ }, { "name": "rg3/youtube-dl", - "version": "2017.10.29", + "version": "2017.11.06", "dist": { "type": "zip", - "url": "https://github.com/rg3/youtube-dl/archive/2017.10.29.zip", + "url": "https://github.com/rg3/youtube-dl/archive/2017.11.06.zip", "reference": null, "shasum": null }, From dbcb9a95583c34d76aac0d0f4c76ab95c735d29e Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Fri, 10 Nov 2017 13:46:23 +0100 Subject: [PATCH 24/77] Cleaner way to call Grunt on Travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 01aa3d8..cef7f4e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ after_success: - bash <(curl -s https://codecov.io/bash) before_deploy: - yarn install --ignore-scripts - - ./node_modules/.bin/grunt doc + - yarn grunt doc deploy: provider: surge project: ./docs/ From 627108e08d33af01717c8790611ed48a033a449e Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Fri, 10 Nov 2017 14:14:42 +0100 Subject: [PATCH 25/77] Cleaner way to call phpunit on Travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index cef7f4e..de96aef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ addons: - language-pack-fr install: - composer install -script: vendor/bin/phpunit +script: composer exec -v phpunit after_success: - bash <(curl -s https://codecov.io/bash) before_deploy: From fd2a4d874577c272e0a8317f99be33092deeeba0 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Fri, 10 Nov 2017 23:50:17 +0100 Subject: [PATCH 26/77] Add an option to set the MP3 bitrate when converting (fixes #113) --- classes/Config.php | 7 +++++++ classes/VideoDownload.php | 1 + config/config.example.yml | 3 +++ tests/ConfigTest.php | 1 + 4 files changed, 12 insertions(+) diff --git a/classes/Config.php b/classes/Config.php index 6226f26..09d06c8 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -82,6 +82,13 @@ class Config */ public $remux = false; + /** + * MP3 bitrate when converting (in kbit/s) + * + * @var int + */ + public $audioBitrate = 128; + /** * YAML config file path. * diff --git a/classes/VideoDownload.php b/classes/VideoDownload.php index 3140d08..9005c85 100644 --- a/classes/VideoDownload.php +++ b/classes/VideoDownload.php @@ -281,6 +281,7 @@ class VideoDownload '-user-agent', $this->getProp(null, null, 'dump-user-agent'), '-i', $url, '-f', 'mp3', + '-b:a', $this->config->audioBitrate.'k', '-vn', 'pipe:1', ] diff --git a/config/config.example.yml b/config/config.example.yml index 9470464..3479f61 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -26,3 +26,6 @@ uglyUrls: false # True to stream videos through server stream: false + +# MP3 bitrate when converting (in kbit/s) +audioBitrate: 128 diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index 8e49632..5535109 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -67,6 +67,7 @@ class ConfigTest extends TestCase $this->assertInternalType('bool', $config->uglyUrls); $this->assertInternalType('bool', $config->stream); $this->assertInternalType('bool', $config->remux); + $this->assertInternalType('int', $config->audioBitrate); } /** From 600c8757e98d8334039a9ee7f60ac3999a0846bf Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Fri, 10 Nov 2017 23:52:04 +0100 Subject: [PATCH 27/77] Lint --- classes/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/Config.php b/classes/Config.php index 09d06c8..513202a 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -83,7 +83,7 @@ class Config public $remux = false; /** - * MP3 bitrate when converting (in kbit/s) + * MP3 bitrate when converting (in kbit/s). * * @var int */ From 2432a06c1bdce7cf05d778f5b114278ce1bb1e61 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 11 Nov 2017 13:58:55 +0100 Subject: [PATCH 28/77] Make tests run on Windows (fixes #137) Use AppVeyor to run tests --- .appveyor.yml | 20 +++++++++++ classes/PlaylistArchiveStream.php | 4 +-- classes/VideoDownload.php | 4 +-- config/config.example.yml | 6 ++-- config/config_test_windows.yml | 12 +++++++ controllers/FrontController.php | 2 +- tests/FrontControllerTest.php | 54 +++++++++++++++++++++++------ tests/PlaylistArchiveStreamTest.php | 8 ++++- tests/VideoDownloadTest.php | 35 +++++++++++++------ 9 files changed, 116 insertions(+), 29 deletions(-) create mode 100644 .appveyor.yml create mode 100644 config/config_test_windows.yml diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 0000000..12ea72f --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,20 @@ +--- +install: + - sc config wuauserv start= auto + - net start wuauserv + - cinst php composer ffmpeg rtmpdump + - refreshenv + - copy C:\tools\php71\php.ini-development C:\tools\php71\php.ini + - echo extension=C:\tools\php71\ext\php_gmp.dll >> C:\tools\php71\php.ini + - echo extension=C:\tools\php71\ext\php_gettext.dll >> C:\tools\php71\php.ini + - echo extension=C:\tools\php71\ext\php_intl.dll >> C:\tools\php71\php.ini + - echo extension=C:\tools\php71\ext\php_openssl.dll >> C:\tools\php71\php.ini + - echo extension=C:\tools\php71\ext\php_mbstring.dll >> C:\tools\php71\php.ini + - composer install --no-dev + - composer global require phpunit/phpunit + - C:\Python36\python.exe -m pip install youtube-dl + +test_script: + - phpunit + +build: "off" diff --git a/classes/PlaylistArchiveStream.php b/classes/PlaylistArchiveStream.php index c97f6b8..d9b37d5 100644 --- a/classes/PlaylistArchiveStream.php +++ b/classes/PlaylistArchiveStream.php @@ -61,10 +61,10 @@ class PlaylistArchiveStream extends TarArchive /** * PlaylistArchiveStream constructor. */ - public function __construct() + public function __construct(Config $config = null) { $this->client = new \GuzzleHttp\Client(); - $this->download = new VideoDownload(); + $this->download = new VideoDownload($config); } /** diff --git a/classes/VideoDownload.php b/classes/VideoDownload.php index 9005c85..12cb4fd 100644 --- a/classes/VideoDownload.php +++ b/classes/VideoDownload.php @@ -58,7 +58,7 @@ class VideoDownload * */ public function listExtractors() { - return explode(PHP_EOL, trim($this->getProp(null, null, 'list-extractors'))); + return explode("\n", trim($this->getProp(null, null, 'list-extractors'))); } /** @@ -135,7 +135,7 @@ class VideoDownload * */ public function getURL($url, $format = null, $password = null) { - return explode(PHP_EOL, $this->getProp($url, $format, 'get-url', $password)); + return explode("\n", $this->getProp($url, $format, 'get-url', $password)); } /** diff --git a/config/config.example.yml b/config/config.example.yml index 3479f61..2740303 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -7,10 +7,10 @@ python: /usr/bin/python # An array of parameters to pass to youtube-dl params: - - --no-playlist - --no-warnings - - --playlist-end - - 1 + - --ignore-errors + - --flat-playlist + - --restrict-filenames # True to enable audio conversion convert: false diff --git a/config/config_test_windows.yml b/config/config_test_windows.yml new file mode 100644 index 0000000..29a7740 --- /dev/null +++ b/config/config_test_windows.yml @@ -0,0 +1,12 @@ +--- +convert: false +python: C:\Python36\python.exe +avconv: C:\ProgramData\chocolatey\bin\ffmpeg.exe +rtmpdump: C:\ProgramData\chocolatey\bin\rtmpdump +youtubedl: C:\Python36\Lib\site-packages\youtube_dl\__main__.py +params: + - --no-warnings + - --ignore-errors + - --flat-playlist + - --restrict-filenames + - --no-check-certificate diff --git a/controllers/FrontController.php b/controllers/FrontController.php index 39c68a8..5ac9459 100644 --- a/controllers/FrontController.php +++ b/controllers/FrontController.php @@ -83,7 +83,7 @@ class FrontController } else { $this->config = Config::getInstance(); } - $this->download = new VideoDownload(); + $this->download = new VideoDownload($this->config); $this->container = $container; $this->view = $this->container->get('view'); $this->localeManager = $this->container->get('locale'); diff --git a/tests/FrontControllerTest.php b/tests/FrontControllerTest.php index 69ce74c..40e8d2e 100644 --- a/tests/FrontControllerTest.php +++ b/tests/FrontControllerTest.php @@ -48,6 +48,13 @@ class FrontControllerTest extends TestCase */ private $controller; + /** + * Config class instance. + * + * @var Config + */ + private $config; + /** * Prepare tests. */ @@ -58,7 +65,15 @@ class FrontControllerTest extends TestCase $this->response = new Response(); $this->container['view'] = ViewFactory::create($this->container, $this->request); $this->container['locale'] = new LocaleManager(); - $this->controller = new FrontController($this->container, Config::getInstance('config/config_test.yml')); + + if (PHP_OS == 'WINNT') { + $configFile = 'config_test_windows.yml'; + } else { + $configFile = 'config_test.yml'; + } + $this->config = Config::getInstance('config/'.$configFile); + $this->controller = new FrontController($this->container, $this->config); + $this->container['router']->map(['GET'], '/', [$this->controller, 'index']) ->setName('index'); $this->container['router']->map(['GET'], '/video', [$this->controller, 'video']) @@ -150,6 +165,18 @@ class FrontControllerTest extends TestCase * @return void */ public function testConstructor() + { + $controller = new FrontController($this->container, $this->config); + $this->assertInstanceOf(FrontController::class, $controller); + } + + /** + * Test the constructor with a default config. + * + * @return void + * @requires OS Linux + */ + public function testConstructorWithDefaultConfig() { $controller = new FrontController($this->container); $this->assertInstanceOf(FrontController::class, $controller); @@ -162,7 +189,8 @@ class FrontControllerTest extends TestCase */ public function testConstructorWithStream() { - $controller = new FrontController($this->container, new Config(['stream' => true])); + $this->config->stream = true; + $controller = new FrontController($this->container, $this->config); $this->assertInstanceOf(FrontController::class, $controller); } @@ -302,12 +330,12 @@ class FrontControllerTest extends TestCase */ public function testVideoWithStream() { - $config = new Config(['stream' => true]); - $this->assertRequestIsOk('video', ['url' => 'https://www.youtube.com/watch?v=M7IpKCZ47pU'], $config); + $this->config->stream = true; + $this->assertRequestIsOk('video', ['url' => 'https://www.youtube.com/watch?v=M7IpKCZ47pU'], $this->config); $this->assertRequestIsOk( 'video', ['url' => 'https://www.youtube.com/watch?v=M7IpKCZ47pU', 'audio' => true], - $config + $this->config ); } @@ -375,10 +403,11 @@ class FrontControllerTest extends TestCase */ public function testRedirectWithStream() { + $this->config->stream = true; $this->assertRequestIsOk( 'redirect', ['url' => 'https://www.youtube.com/watch?v=M7IpKCZ47pU'], - new Config(['stream' => true]) + $this->config ); } @@ -389,10 +418,11 @@ class FrontControllerTest extends TestCase */ public function testRedirectWithM3uStream() { + $this->config->stream = true; $this->assertRequestIsOk( 'redirect', ['url' => 'https://twitter.com/verge/status/813055465324056576/video/1'], - new Config(['stream' => true]) + $this->config ); } @@ -403,10 +433,11 @@ class FrontControllerTest extends TestCase */ public function testRedirectWithRtmpStream() { + $this->config->stream = true; $this->assertRequestIsOk( 'redirect', ['url' => 'http://www.canalc2.tv/video/12163', 'format' => 'rtmp'], - new Config(['stream' => true]) + $this->config ); } @@ -417,13 +448,14 @@ class FrontControllerTest extends TestCase */ public function testRedirectWithRemux() { + $this->config->remux = true; $this->assertRequestIsOk( 'redirect', [ 'url' => 'https://www.youtube.com/watch?v=M7IpKCZ47pU', 'format' => 'bestvideo+bestaudio', ], - new Config(['remux' => true]) + $this->config ); } @@ -481,13 +513,15 @@ class FrontControllerTest extends TestCase * Test the redirect() function with a playlist stream. * * @return void + * @requires OS Linux */ public function testRedirectWithPlaylist() { + $this->config->stream = true; $this->assertRequestIsOk( 'redirect', ['url' => 'https://www.youtube.com/playlist?list=PLgdySZU6KUXL_8Jq5aUkyNV7wCa-4wZsC'], - new Config(['stream' => true]) + $this->config ); } diff --git a/tests/PlaylistArchiveStreamTest.php b/tests/PlaylistArchiveStreamTest.php index 2e3e4a7..35ac628 100644 --- a/tests/PlaylistArchiveStreamTest.php +++ b/tests/PlaylistArchiveStreamTest.php @@ -5,6 +5,7 @@ namespace Alltube\Test; +use Alltube\Config; use Alltube\PlaylistArchiveStream; use PHPUnit\Framework\TestCase; @@ -25,7 +26,12 @@ class PlaylistArchiveStreamTest extends TestCase */ protected function setUp() { - $this->stream = new PlaylistArchiveStream(); + if (PHP_OS == 'WINNT') { + $configFile = 'config_test_windows.yml'; + } else { + $configFile = 'config_test.yml'; + } + $this->stream = new PlaylistArchiveStream(Config::getInstance('config/'.$configFile)); } /** diff --git a/tests/VideoDownloadTest.php b/tests/VideoDownloadTest.php index ed5d75c..4cad529 100644 --- a/tests/VideoDownloadTest.php +++ b/tests/VideoDownloadTest.php @@ -21,12 +21,25 @@ class VideoDownloadTest extends TestCase */ private $download; + /** + * Config class instance. + * + * @var Config + */ + private $config; + /** * Initialize properties used by test. */ protected function setUp() { - $this->download = new VideoDownload(Config::getInstance('config/config_test.yml')); + if (PHP_OS == 'WINNT') { + $configFile = 'config_test_windows.yml'; + } else { + $configFile = 'config_test.yml'; + } + $this->config = Config::getInstance('config/'.$configFile); + $this->download = new VideoDownload($this->config); } /** @@ -45,9 +58,8 @@ class VideoDownloadTest extends TestCase */ public function testConstructorWithMissingYoutubedl() { - new VideoDownload( - new Config(['youtubedl' => 'foo']) - ); + $this->config->youtubedl = 'foo'; + new VideoDownload($this->config); } /** @@ -58,9 +70,8 @@ class VideoDownloadTest extends TestCase */ public function testConstructorWithMissingPython() { - new VideoDownload( - new Config(['python' => 'foo']) - ); + $this->config->python = 'foo'; + new VideoDownload($this->config); } /** @@ -364,7 +375,8 @@ class VideoDownloadTest extends TestCase */ public function testGetAudioStreamAvconvError($url, $format) { - $download = new VideoDownload(new Config(['avconv' => 'foobar'])); + $this->config->avconv = 'foobar'; + $download = new VideoDownload($this->config); $download->getAudioStream($url, $format); } @@ -380,7 +392,8 @@ class VideoDownloadTest extends TestCase */ public function testGetAudioStreamRtmpError($url, $format) { - $download = new VideoDownload(new Config(['rtmpdump' => 'foobar'])); + $this->config->rtmpdump = 'foobar'; + $download = new VideoDownload($this->config); $download->getAudioStream($url, $format); } @@ -477,7 +490,8 @@ class VideoDownloadTest extends TestCase */ public function testGetM3uStreamAvconvError($url, $format) { - $download = new VideoDownload(new Config(['avconv' => 'foobar'])); + $this->config->avconv = 'foobar'; + $download = new VideoDownload($this->config); $video = $download->getJSON($url, $format); $download->getM3uStream($video); } @@ -486,6 +500,7 @@ class VideoDownloadTest extends TestCase * Test getPlaylistArchiveStream function without avconv. * * @return void + * @requires OS Linux */ public function testGetPlaylistArchiveStream() { From 244fb85379c2e3baaae7805da2f81e2dff987669 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 11 Nov 2017 18:30:23 +0100 Subject: [PATCH 29/77] Update Symfony to 3.3.11 --- composer.lock | 187 +++++++++++++++++++++++++------------------------- 1 file changed, 94 insertions(+), 93 deletions(-) diff --git a/composer.lock b/composer.lock index 99a2d79..715954a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,6 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], + "hash": "05212c2b0afc10d25327aae804b5077b", "content-hash": "2f2bb96c33a90fba39cb7e492875684e", "packages": [ { @@ -66,7 +67,7 @@ "session", "sessions" ], - "time": "2016-10-03T20:28:32+00:00" + "time": "2016-10-03 20:28:32" }, { "name": "barracudanetworks/archivestream-php", @@ -106,7 +107,7 @@ "tar", "zip" ], - "time": "2017-01-13T14:52:38+00:00" + "time": "2017-01-13 14:52:38" }, { "name": "container-interop/container-interop", @@ -137,7 +138,7 @@ ], "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", "homepage": "https://github.com/container-interop/container-interop", - "time": "2017-02-14T19:40:03+00:00" + "time": "2017-02-14 19:40:03" }, { "name": "guzzlehttp/guzzle", @@ -202,7 +203,7 @@ "rest", "web service" ], - "time": "2017-06-22T18:50:49+00:00" + "time": "2017-06-22 18:50:49" }, { "name": "guzzlehttp/promises", @@ -253,7 +254,7 @@ "keywords": [ "promise" ], - "time": "2016-12-20T10:07:11+00:00" + "time": "2016-12-20 10:07:11" }, { "name": "guzzlehttp/psr7", @@ -318,7 +319,7 @@ "uri", "url" ], - "time": "2017-03-20T17:10:46+00:00" + "time": "2017-03-20 17:10:46" }, { "name": "mathmarques/smarty-view", @@ -368,7 +369,7 @@ "template", "view" ], - "time": "2016-08-25T19:04:49+00:00" + "time": "2016-08-25 19:04:49" }, { "name": "nikic/fast-route", @@ -411,7 +412,7 @@ "router", "routing" ], - "time": "2017-01-19T11:35:12+00:00" + "time": "2017-01-19 11:35:12" }, { "name": "pimple/pimple", @@ -461,7 +462,7 @@ "container", "dependency injection" ], - "time": "2017-07-23T07:32:15+00:00" + "time": "2017-07-23 07:32:15" }, { "name": "psr/container", @@ -510,7 +511,7 @@ "container-interop", "psr" ], - "time": "2017-02-14T16:28:37+00:00" + "time": "2017-02-14 16:28:37" }, { "name": "psr/http-message", @@ -560,7 +561,7 @@ "request", "response" ], - "time": "2016-08-06T14:39:51+00:00" + "time": "2016-08-06 14:39:51" }, { "name": "ptachoire/process-builder-chain", @@ -596,7 +597,7 @@ } ], "description": "Add ability to chain symfony processes", - "time": "2016-04-10T08:33:20+00:00" + "time": "2016-04-10 08:33:20" }, { "name": "rinvex/country", @@ -670,7 +671,7 @@ "rinvex", "svg" ], - "time": "2017-03-07T18:40:20+00:00" + "time": "2017-03-07 18:40:20" }, { "name": "slim/slim", @@ -741,7 +742,7 @@ "micro", "router" ], - "time": "2017-03-19T17:55:20+00:00" + "time": "2017-03-19 17:55:20" }, { "name": "smarty-gettext/smarty-gettext", @@ -795,7 +796,7 @@ ], "description": "Gettext plugin enabling internationalization in Smarty Package files", "homepage": "https://github.com/smarty-gettext/smarty-gettext", - "time": "2017-05-12T12:14:46+00:00" + "time": "2017-05-12 12:14:46" }, { "name": "smarty/smarty", @@ -848,20 +849,20 @@ "keywords": [ "templating" ], - "time": "2016-12-14T21:57:25+00:00" + "time": "2016-12-14 21:57:25" }, { "name": "symfony/process", - "version": "v3.3.10", + "version": "v3.3.11", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "fdf89e57a723a29baf536e288d6e232c059697b1" + "reference": "e14bb64d7559e6923fb13ee3b3d8fa763a2c0930" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/fdf89e57a723a29baf536e288d6e232c059697b1", - "reference": "fdf89e57a723a29baf536e288d6e232c059697b1", + "url": "https://api.github.com/repos/symfony/process/zipball/e14bb64d7559e6923fb13ee3b3d8fa763a2c0930", + "reference": "e14bb64d7559e6923fb13ee3b3d8fa763a2c0930", "shasum": "" }, "require": { @@ -897,20 +898,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-10-02T06:42:24+00:00" + "time": "2017-11-05 15:47:03" }, { "name": "symfony/yaml", - "version": "v3.3.10", + "version": "v3.3.11", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "8c7bf1e7d5d6b05a690b715729cb4cd0c0a99c46" + "reference": "0938408c4faa518d95230deabb5f595bf0de31b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/8c7bf1e7d5d6b05a690b715729cb4cd0c0a99c46", - "reference": "8c7bf1e7d5d6b05a690b715729cb4cd0c0a99c46", + "url": "https://api.github.com/repos/symfony/yaml/zipball/0938408c4faa518d95230deabb5f595bf0de31b9", + "reference": "0938408c4faa518d95230deabb5f595bf0de31b9", "shasum": "" }, "require": { @@ -952,7 +953,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-10-05T14:43:42+00:00" + "time": "2017-11-10 18:26:04" }, { "name": "zonuexe/http-accept-language", @@ -993,7 +994,7 @@ } ], "description": "HTTP Accept-Language Header parser", - "time": "2014-10-19T09:22:18+00:00" + "time": "2014-10-19 09:22:18" } ], "packages-dev": [ @@ -1054,7 +1055,7 @@ "ssl", "tls" ], - "time": "2017-09-11T07:24:36+00:00" + "time": "2017-09-11 07:24:36" }, { "name": "composer/composer", @@ -1131,7 +1132,7 @@ "dependency", "package" ], - "time": "2017-09-11T14:59:26+00:00" + "time": "2017-09-11 14:59:26" }, { "name": "composer/semver", @@ -1193,7 +1194,7 @@ "validation", "versioning" ], - "time": "2016-08-30T16:08:34+00:00" + "time": "2016-08-30 16:08:34" }, { "name": "composer/spdx-licenses", @@ -1254,7 +1255,7 @@ "spdx", "validator" ], - "time": "2017-04-03T19:08:52+00:00" + "time": "2017-04-03 19:08:52" }, { "name": "doctrine/instantiator", @@ -1308,7 +1309,7 @@ "constructor", "instantiate" ], - "time": "2015-06-14T21:17:01+00:00" + "time": "2015-06-14 21:17:01" }, { "name": "ffmpeg/ffmpeg", @@ -1366,7 +1367,7 @@ "nginx", "php" ], - "time": "2017-10-28T00:17:41+00:00" + "time": "2017-10-28 00:17:41" }, { "name": "justinrainbow/json-schema", @@ -1432,7 +1433,7 @@ "json", "schema" ], - "time": "2017-10-21T13:15:38+00:00" + "time": "2017-10-21 13:15:38" }, { "name": "myclabs/deep-copy", @@ -1477,7 +1478,7 @@ "object", "object graph" ], - "time": "2017-10-19T19:58:43+00:00" + "time": "2017-10-19 19:58:43" }, { "name": "phar-io/manifest", @@ -1532,7 +1533,7 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2017-03-05T18:14:27+00:00" + "time": "2017-03-05 18:14:27" }, { "name": "phar-io/version", @@ -1579,7 +1580,7 @@ } ], "description": "Library for handling version information and constraints", - "time": "2017-03-05T17:38:23+00:00" + "time": "2017-03-05 17:38:23" }, { "name": "phpdocumentor/reflection-common", @@ -1633,7 +1634,7 @@ "reflection", "static analysis" ], - "time": "2017-09-11T18:02:19+00:00" + "time": "2017-09-11 18:02:19" }, { "name": "phpdocumentor/reflection-docblock", @@ -1678,7 +1679,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-08-30T18:51:59+00:00" + "time": "2017-08-30 18:51:59" }, { "name": "phpdocumentor/type-resolver", @@ -1725,7 +1726,7 @@ "email": "me@mikevanriel.com" } ], - "time": "2017-07-14T14:27:02+00:00" + "time": "2017-07-14 14:27:02" }, { "name": "phpspec/prophecy", @@ -1788,7 +1789,7 @@ "spy", "stub" ], - "time": "2017-09-04T11:05:03+00:00" + "time": "2017-09-04 11:05:03" }, { "name": "phpunit/php-code-coverage", @@ -1852,7 +1853,7 @@ "testing", "xunit" ], - "time": "2017-11-03T13:47:33+00:00" + "time": "2017-11-03 13:47:33" }, { "name": "phpunit/php-file-iterator", @@ -1899,7 +1900,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03T07:40:28+00:00" + "time": "2016-10-03 07:40:28" }, { "name": "phpunit/php-text-template", @@ -1940,7 +1941,7 @@ "keywords": [ "template" ], - "time": "2015-06-21T13:50:34+00:00" + "time": "2015-06-21 13:50:34" }, { "name": "phpunit/php-timer", @@ -1989,7 +1990,7 @@ "keywords": [ "timer" ], - "time": "2017-02-26T11:10:40+00:00" + "time": "2017-02-26 11:10:40" }, { "name": "phpunit/php-token-stream", @@ -2038,7 +2039,7 @@ "keywords": [ "tokenizer" ], - "time": "2017-08-20T05:47:52+00:00" + "time": "2017-08-20 05:47:52" }, { "name": "phpunit/phpunit", @@ -2122,7 +2123,7 @@ "testing", "xunit" ], - "time": "2017-11-08T11:26:09+00:00" + "time": "2017-11-08 11:26:09" }, { "name": "phpunit/phpunit-mock-objects", @@ -2181,7 +2182,7 @@ "mock", "xunit" ], - "time": "2017-08-03T14:08:16+00:00" + "time": "2017-08-03 14:08:16" }, { "name": "psr/log", @@ -2228,7 +2229,7 @@ "psr", "psr-3" ], - "time": "2016-10-10T12:19:37+00:00" + "time": "2016-10-10 12:19:37" }, { "name": "rg3/youtube-dl", @@ -2267,7 +2268,7 @@ "GPL-2.0" ], "description": "rtmpdump binary for Linux 64 bit", - "time": "2016-04-12T19:17:32+00:00" + "time": "2016-04-12 19:17:32" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -2312,7 +2313,7 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04T06:30:41+00:00" + "time": "2017-03-04 06:30:41" }, { "name": "sebastian/comparator", @@ -2376,7 +2377,7 @@ "compare", "equality" ], - "time": "2017-11-03T07:16:52+00:00" + "time": "2017-11-03 07:16:52" }, { "name": "sebastian/diff", @@ -2428,7 +2429,7 @@ "keywords": [ "diff" ], - "time": "2017-08-03T08:09:46+00:00" + "time": "2017-08-03 08:09:46" }, { "name": "sebastian/environment", @@ -2478,7 +2479,7 @@ "environment", "hhvm" ], - "time": "2017-07-01T08:51:00+00:00" + "time": "2017-07-01 08:51:00" }, { "name": "sebastian/exporter", @@ -2545,7 +2546,7 @@ "export", "exporter" ], - "time": "2017-04-03T13:19:02+00:00" + "time": "2017-04-03 13:19:02" }, { "name": "sebastian/global-state", @@ -2596,7 +2597,7 @@ "keywords": [ "global state" ], - "time": "2017-04-27T15:39:26+00:00" + "time": "2017-04-27 15:39:26" }, { "name": "sebastian/object-enumerator", @@ -2643,7 +2644,7 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-08-03T12:35:26+00:00" + "time": "2017-08-03 12:35:26" }, { "name": "sebastian/object-reflector", @@ -2688,7 +2689,7 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "time": "2017-03-29T09:07:27+00:00" + "time": "2017-03-29 09:07:27" }, { "name": "sebastian/recursion-context", @@ -2741,7 +2742,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2017-03-03T06:23:57+00:00" + "time": "2017-03-03 06:23:57" }, { "name": "sebastian/resource-operations", @@ -2783,7 +2784,7 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28T20:34:47+00:00" + "time": "2015-07-28 20:34:47" }, { "name": "sebastian/version", @@ -2826,7 +2827,7 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03T07:35:21+00:00" + "time": "2016-10-03 07:35:21" }, { "name": "seld/cli-prompt", @@ -2874,7 +2875,7 @@ "input", "prompt" ], - "time": "2017-03-18T11:32:45+00:00" + "time": "2017-03-18 11:32:45" }, { "name": "seld/jsonlint", @@ -2923,7 +2924,7 @@ "parser", "validator" ], - "time": "2017-06-18T15:11:04+00:00" + "time": "2017-06-18 15:11:04" }, { "name": "seld/phar-utils", @@ -2967,7 +2968,7 @@ "keywords": [ "phra" ], - "time": "2015-10-13T18:44:15+00:00" + "time": "2015-10-13 18:44:15" }, { "name": "squizlabs/php_codesniffer", @@ -3018,20 +3019,20 @@ "phpcs", "standards" ], - "time": "2017-10-16T22:40:25+00:00" + "time": "2017-10-16 22:40:25" }, { "name": "symfony/console", - "version": "v3.3.10", + "version": "v3.3.11", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "116bc56e45a8e5572e51eb43ab58c769a352366c" + "reference": "fd684d68f83568d8293564b4971928a2c4bdfc5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/116bc56e45a8e5572e51eb43ab58c769a352366c", - "reference": "116bc56e45a8e5572e51eb43ab58c769a352366c", + "url": "https://api.github.com/repos/symfony/console/zipball/fd684d68f83568d8293564b4971928a2c4bdfc5c", + "reference": "fd684d68f83568d8293564b4971928a2c4bdfc5c", "shasum": "" }, "require": { @@ -3086,20 +3087,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-10-02T06:42:24+00:00" + "time": "2017-11-07 14:16:22" }, { "name": "symfony/debug", - "version": "v3.3.10", + "version": "v3.3.11", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "eb95d9ce8f18dcc1b3dfff00cb624c402be78ffd" + "reference": "74557880e2846b5c84029faa96b834da37e29810" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/eb95d9ce8f18dcc1b3dfff00cb624c402be78ffd", - "reference": "eb95d9ce8f18dcc1b3dfff00cb624c402be78ffd", + "url": "https://api.github.com/repos/symfony/debug/zipball/74557880e2846b5c84029faa96b834da37e29810", + "reference": "74557880e2846b5c84029faa96b834da37e29810", "shasum": "" }, "require": { @@ -3142,20 +3143,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-10-02T06:42:24+00:00" + "time": "2017-11-10 16:38:39" }, { "name": "symfony/filesystem", - "version": "v3.3.10", + "version": "v3.3.11", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "90bc45abf02ae6b7deb43895c1052cb0038506f1" + "reference": "77db266766b54db3ee982fe51868328b887ce15c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/90bc45abf02ae6b7deb43895c1052cb0038506f1", - "reference": "90bc45abf02ae6b7deb43895c1052cb0038506f1", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/77db266766b54db3ee982fe51868328b887ce15c", + "reference": "77db266766b54db3ee982fe51868328b887ce15c", "shasum": "" }, "require": { @@ -3191,20 +3192,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2017-10-03T13:33:10+00:00" + "time": "2017-11-07 14:12:55" }, { "name": "symfony/finder", - "version": "v3.3.10", + "version": "v3.3.11", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "773e19a491d97926f236942484cb541560ce862d" + "reference": "138af5ec075d4b1d1bd19de08c38a34bb2d7d880" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/773e19a491d97926f236942484cb541560ce862d", - "reference": "773e19a491d97926f236942484cb541560ce862d", + "url": "https://api.github.com/repos/symfony/finder/zipball/138af5ec075d4b1d1bd19de08c38a34bb2d7d880", + "reference": "138af5ec075d4b1d1bd19de08c38a34bb2d7d880", "shasum": "" }, "require": { @@ -3240,7 +3241,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-10-02T06:42:24+00:00" + "time": "2017-11-05 15:47:03" }, { "name": "symfony/polyfill-mbstring", @@ -3299,20 +3300,20 @@ "portable", "shim" ], - "time": "2017-10-11T12:05:26+00:00" + "time": "2017-10-11 12:05:26" }, { "name": "symfony/var-dumper", - "version": "v3.3.10", + "version": "v3.3.11", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "03e3693a36701f1c581dd24a6d6eea2eba2113f6" + "reference": "805de6bd6869073e60610df1b14ab7d969c61b01" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/03e3693a36701f1c581dd24a6d6eea2eba2113f6", - "reference": "03e3693a36701f1c581dd24a6d6eea2eba2113f6", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/805de6bd6869073e60610df1b14ab7d969c61b01", + "reference": "805de6bd6869073e60610df1b14ab7d969c61b01", "shasum": "" }, "require": { @@ -3367,7 +3368,7 @@ "debug", "dump" ], - "time": "2017-10-02T06:42:24+00:00" + "time": "2017-11-07 14:16:22" }, { "name": "theseer/tokenizer", @@ -3407,7 +3408,7 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2017-04-07T12:08:54+00:00" + "time": "2017-04-07 12:08:54" }, { "name": "webmozart/assert", @@ -3457,7 +3458,7 @@ "check", "validate" ], - "time": "2016-11-23T20:04:58+00:00" + "time": "2016-11-23 20:04:58" } ], "aliases": [], From 3ffdec9ca1f6c9fbf994634ea2fc5fe93166fa4e Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 11 Nov 2017 22:39:41 +0100 Subject: [PATCH 30/77] Run testTestLocale on Travis --- tests/LocaleMiddlewareTest.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/LocaleMiddlewareTest.php b/tests/LocaleMiddlewareTest.php index 35c30e2..b156dd4 100644 --- a/tests/LocaleMiddlewareTest.php +++ b/tests/LocaleMiddlewareTest.php @@ -53,12 +53,11 @@ class LocaleMiddlewareTest extends TestCase */ public function testTestLocale() { - $this->markTestSkipped('For some reason, this test fails on Travis even if the fr_FR locale is installed.'); $locale = [ - 'language' => 'fr', - 'region' => 'FR', + 'language' => 'en', + 'region' => 'US', ]; - $this->assertEquals('fr_FR', $this->middleware->testLocale($locale)); + $this->assertEquals('en_US', $this->middleware->testLocale($locale)); } /** From 0027250de7b38bc373906b9e0ebe5117ffd59d73 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 11 Nov 2017 22:48:11 +0100 Subject: [PATCH 31/77] testTestLocale fails on Windows --- tests/LocaleMiddlewareTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/LocaleMiddlewareTest.php b/tests/LocaleMiddlewareTest.php index b156dd4..2b85619 100644 --- a/tests/LocaleMiddlewareTest.php +++ b/tests/LocaleMiddlewareTest.php @@ -50,6 +50,7 @@ class LocaleMiddlewareTest extends TestCase * Test the testLocale() function. * * @return void + * @requires OS Linux */ public function testTestLocale() { From c07322e1600c72e3ee327faaf95a0348b7fb3378 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 11 Nov 2017 22:50:54 +0100 Subject: [PATCH 32/77] Remove buggy test (the video is not available anymore) --- tests/FrontControllerTest.php | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/tests/FrontControllerTest.php b/tests/FrontControllerTest.php index 40e8d2e..4962c7f 100644 --- a/tests/FrontControllerTest.php +++ b/tests/FrontControllerTest.php @@ -260,17 +260,6 @@ class FrontControllerTest extends TestCase $this->assertRequestIsOk('video', ['url' => 'https://www.youtube.com/watch?v=M7IpKCZ47pU']); } - /** - * Test the video() function with a video that does not have a title. - * - * @return void - */ - public function testVideoWithoutTitle() - { - $this->markTestSkipped('This URL triggers a curl SSL error on Travis'); - $this->assertRequestIsOk('video', ['url' => 'http://html5demos.com/video']); - } - /** * Test the video() function with audio conversion. * From 1b5e99403f78f66163f1a5707d686ca79304f90b Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 11 Nov 2017 23:00:53 +0100 Subject: [PATCH 33/77] Basic testEnv test --- tests/LocaleManagerTest.php | 11 +++++++++++ tests/LocaleMiddlewareTest.php | 10 ---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/LocaleManagerTest.php b/tests/LocaleManagerTest.php index 2808362..0e88239 100644 --- a/tests/LocaleManagerTest.php +++ b/tests/LocaleManagerTest.php @@ -86,4 +86,15 @@ class LocaleManagerTest extends TestCase $this->localeManager->unsetLocale(); $this->assertNull($this->localeManager->getLocale()); } + + /** + * Test that the environment is correctly set up. + * + * @return void + */ + public function testEnv() + { + $this->localeManager->setLocale(new Locale('foo_BAR')); + $this->assertEquals('foo_BAR', getenv('LANG')); + } } diff --git a/tests/LocaleMiddlewareTest.php b/tests/LocaleMiddlewareTest.php index 2b85619..0db9f9f 100644 --- a/tests/LocaleMiddlewareTest.php +++ b/tests/LocaleMiddlewareTest.php @@ -131,14 +131,4 @@ class LocaleMiddlewareTest extends TestCase [$this, 'assertNoHeader'] ); } - - /** - * Test that the environment is correctly set up. - * - * @return void - */ - public function testEnv() - { - $this->markTestIncomplete('We need to find a way to reliably test LC_ALL and LANG values'); - } } From 383ffca6d495544e862be9c453548afb566879fd Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 12 Nov 2017 15:05:47 +0100 Subject: [PATCH 34/77] -user-agent has been replaced by -user_agent in ffmpeg --- classes/VideoDownload.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/VideoDownload.php b/classes/VideoDownload.php index 12cb4fd..31121c3 100644 --- a/classes/VideoDownload.php +++ b/classes/VideoDownload.php @@ -278,7 +278,7 @@ class VideoDownload $this->config->avconv, '-v', 'quiet', //Vimeo needs a correct user-agent - '-user-agent', $this->getProp(null, null, 'dump-user-agent'), + '-user_agent', $this->getProp(null, null, 'dump-user-agent'), '-i', $url, '-f', 'mp3', '-b:a', $this->config->audioBitrate.'k', From dcec7115bcd4880f945b52507c8bb1a3798e6b95 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 12 Nov 2017 15:14:59 +0100 Subject: [PATCH 35/77] Check that Python can be executed --- classes/VideoDownload.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/VideoDownload.php b/classes/VideoDownload.php index 31121c3..e1ba707 100644 --- a/classes/VideoDownload.php +++ b/classes/VideoDownload.php @@ -40,7 +40,7 @@ class VideoDownload $this->procBuilder = new ProcessBuilder(); if (!is_file($this->config->youtubedl)) { throw new \Exception("Can't find youtube-dl at ".$this->config->youtubedl); - } elseif (!is_file($this->config->python)) { + } elseif (!$this->checkCommand([$this->config->python, '--version'])) { throw new \Exception("Can't find Python at ".$this->config->python); } $this->procBuilder->setPrefix( From 21aedb08f010177f0feccf01dab983e83719d887 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 12 Nov 2017 16:34:14 +0100 Subject: [PATCH 36/77] Remove useless argument --- classes/LocaleManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/LocaleManager.php b/classes/LocaleManager.php index 03531fb..73e9a6f 100644 --- a/classes/LocaleManager.php +++ b/classes/LocaleManager.php @@ -102,6 +102,6 @@ class LocaleManager public function unsetLocale() { $this->curLocale = null; - $this->sessionSegment->clear('locale'); + $this->sessionSegment->clear(); } } From 31576056c720e0aa08854236408d4fd305ad431e Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 12 Nov 2017 16:36:44 +0100 Subject: [PATCH 37/77] Fix types in docblock --- classes/VideoDownload.php | 2 +- classes/ViewFactory.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/VideoDownload.php b/classes/VideoDownload.php index e1ba707..67b1e34 100644 --- a/classes/VideoDownload.php +++ b/classes/VideoDownload.php @@ -392,7 +392,7 @@ class VideoDownload * @param object $video Video object returned by youtube-dl * @param string $format Requested format * - * @return Response HTTP response + * @return resource */ public function getPlaylistArchiveStream(\stdClass $video, $format) { diff --git a/classes/ViewFactory.php b/classes/ViewFactory.php index 5928efd..95503fc 100644 --- a/classes/ViewFactory.php +++ b/classes/ViewFactory.php @@ -18,8 +18,8 @@ class ViewFactory /** * Create Smarty view object. * - * @param Container $container Slim dependency container - * @param Request $request PSR-7 request + * @param ContainerInterface $container Slim dependency container + * @param Request $request PSR-7 request * * @return Smarty */ From 3f325ddaae3948ce36329a39ee068b6a59645216 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 12 Nov 2017 16:39:56 +0100 Subject: [PATCH 38/77] Missing property --- controllers/FrontController.php | 1 + tests/LocaleMiddlewareTest.php | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/controllers/FrontController.php b/controllers/FrontController.php index 5ac9459..711f474 100644 --- a/controllers/FrontController.php +++ b/controllers/FrontController.php @@ -7,6 +7,7 @@ namespace Alltube\Controller; use Alltube\Config; use Alltube\Locale; +use Alltube\LocaleManager; use Alltube\PasswordException; use Alltube\VideoDownload; use Psr\Container\ContainerInterface; diff --git a/tests/LocaleMiddlewareTest.php b/tests/LocaleMiddlewareTest.php index 0db9f9f..f7455fd 100644 --- a/tests/LocaleMiddlewareTest.php +++ b/tests/LocaleMiddlewareTest.php @@ -26,6 +26,13 @@ class LocaleMiddlewareTest extends TestCase */ private $middleware; + /** + * Slim dependency container. + * + * @var Container + */ + private $container; + /** * Prepare tests. */ From c197b5ef9678e840c49d812e8f812efe43e2db76 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Fri, 17 Nov 2017 01:21:31 +0100 Subject: [PATCH 39/77] Symfony update --- composer.lock | 165 +++++++++++++++++++++++++------------------------- 1 file changed, 82 insertions(+), 83 deletions(-) diff --git a/composer.lock b/composer.lock index 715954a..20266b9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,6 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "05212c2b0afc10d25327aae804b5077b", "content-hash": "2f2bb96c33a90fba39cb7e492875684e", "packages": [ { @@ -67,7 +66,7 @@ "session", "sessions" ], - "time": "2016-10-03 20:28:32" + "time": "2016-10-03T20:28:32+00:00" }, { "name": "barracudanetworks/archivestream-php", @@ -107,7 +106,7 @@ "tar", "zip" ], - "time": "2017-01-13 14:52:38" + "time": "2017-01-13T14:52:38+00:00" }, { "name": "container-interop/container-interop", @@ -138,7 +137,7 @@ ], "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", "homepage": "https://github.com/container-interop/container-interop", - "time": "2017-02-14 19:40:03" + "time": "2017-02-14T19:40:03+00:00" }, { "name": "guzzlehttp/guzzle", @@ -203,7 +202,7 @@ "rest", "web service" ], - "time": "2017-06-22 18:50:49" + "time": "2017-06-22T18:50:49+00:00" }, { "name": "guzzlehttp/promises", @@ -254,7 +253,7 @@ "keywords": [ "promise" ], - "time": "2016-12-20 10:07:11" + "time": "2016-12-20T10:07:11+00:00" }, { "name": "guzzlehttp/psr7", @@ -319,7 +318,7 @@ "uri", "url" ], - "time": "2017-03-20 17:10:46" + "time": "2017-03-20T17:10:46+00:00" }, { "name": "mathmarques/smarty-view", @@ -369,7 +368,7 @@ "template", "view" ], - "time": "2016-08-25 19:04:49" + "time": "2016-08-25T19:04:49+00:00" }, { "name": "nikic/fast-route", @@ -412,7 +411,7 @@ "router", "routing" ], - "time": "2017-01-19 11:35:12" + "time": "2017-01-19T11:35:12+00:00" }, { "name": "pimple/pimple", @@ -462,7 +461,7 @@ "container", "dependency injection" ], - "time": "2017-07-23 07:32:15" + "time": "2017-07-23T07:32:15+00:00" }, { "name": "psr/container", @@ -511,7 +510,7 @@ "container-interop", "psr" ], - "time": "2017-02-14 16:28:37" + "time": "2017-02-14T16:28:37+00:00" }, { "name": "psr/http-message", @@ -561,7 +560,7 @@ "request", "response" ], - "time": "2016-08-06 14:39:51" + "time": "2016-08-06T14:39:51+00:00" }, { "name": "ptachoire/process-builder-chain", @@ -597,7 +596,7 @@ } ], "description": "Add ability to chain symfony processes", - "time": "2016-04-10 08:33:20" + "time": "2016-04-10T08:33:20+00:00" }, { "name": "rinvex/country", @@ -671,7 +670,7 @@ "rinvex", "svg" ], - "time": "2017-03-07 18:40:20" + "time": "2017-03-07T18:40:20+00:00" }, { "name": "slim/slim", @@ -742,7 +741,7 @@ "micro", "router" ], - "time": "2017-03-19 17:55:20" + "time": "2017-03-19T17:55:20+00:00" }, { "name": "smarty-gettext/smarty-gettext", @@ -796,7 +795,7 @@ ], "description": "Gettext plugin enabling internationalization in Smarty Package files", "homepage": "https://github.com/smarty-gettext/smarty-gettext", - "time": "2017-05-12 12:14:46" + "time": "2017-05-12T12:14:46+00:00" }, { "name": "smarty/smarty", @@ -849,20 +848,20 @@ "keywords": [ "templating" ], - "time": "2016-12-14 21:57:25" + "time": "2016-12-14T21:57:25+00:00" }, { "name": "symfony/process", - "version": "v3.3.11", + "version": "v3.3.13", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "e14bb64d7559e6923fb13ee3b3d8fa763a2c0930" + "reference": "a56a3989fb762d7b19a0cf8e7693ee99a6ffb78d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/e14bb64d7559e6923fb13ee3b3d8fa763a2c0930", - "reference": "e14bb64d7559e6923fb13ee3b3d8fa763a2c0930", + "url": "https://api.github.com/repos/symfony/process/zipball/a56a3989fb762d7b19a0cf8e7693ee99a6ffb78d", + "reference": "a56a3989fb762d7b19a0cf8e7693ee99a6ffb78d", "shasum": "" }, "require": { @@ -898,11 +897,11 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-11-05 15:47:03" + "time": "2017-11-13T15:31:11+00:00" }, { "name": "symfony/yaml", - "version": "v3.3.11", + "version": "v3.3.13", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", @@ -953,7 +952,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-11-10 18:26:04" + "time": "2017-11-10T18:26:04+00:00" }, { "name": "zonuexe/http-accept-language", @@ -994,22 +993,22 @@ } ], "description": "HTTP Accept-Language Header parser", - "time": "2014-10-19 09:22:18" + "time": "2014-10-19T09:22:18+00:00" } ], "packages-dev": [ { "name": "composer/ca-bundle", - "version": "1.0.8", + "version": "1.0.9", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "9dd73a03951357922d8aee6cc084500de93e2343" + "reference": "36344aeffdc37711335563e6108cda86566432a6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/9dd73a03951357922d8aee6cc084500de93e2343", - "reference": "9dd73a03951357922d8aee6cc084500de93e2343", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/36344aeffdc37711335563e6108cda86566432a6", + "reference": "36344aeffdc37711335563e6108cda86566432a6", "shasum": "" }, "require": { @@ -1055,7 +1054,7 @@ "ssl", "tls" ], - "time": "2017-09-11 07:24:36" + "time": "2017-11-13T15:51:25+00:00" }, { "name": "composer/composer", @@ -1132,7 +1131,7 @@ "dependency", "package" ], - "time": "2017-09-11 14:59:26" + "time": "2017-09-11T14:59:26+00:00" }, { "name": "composer/semver", @@ -1194,7 +1193,7 @@ "validation", "versioning" ], - "time": "2016-08-30 16:08:34" + "time": "2016-08-30T16:08:34+00:00" }, { "name": "composer/spdx-licenses", @@ -1255,7 +1254,7 @@ "spdx", "validator" ], - "time": "2017-04-03 19:08:52" + "time": "2017-04-03T19:08:52+00:00" }, { "name": "doctrine/instantiator", @@ -1309,7 +1308,7 @@ "constructor", "instantiate" ], - "time": "2015-06-14 21:17:01" + "time": "2015-06-14T21:17:01+00:00" }, { "name": "ffmpeg/ffmpeg", @@ -1367,7 +1366,7 @@ "nginx", "php" ], - "time": "2017-10-28 00:17:41" + "time": "2017-10-28T00:17:41+00:00" }, { "name": "justinrainbow/json-schema", @@ -1433,7 +1432,7 @@ "json", "schema" ], - "time": "2017-10-21 13:15:38" + "time": "2017-10-21T13:15:38+00:00" }, { "name": "myclabs/deep-copy", @@ -1478,7 +1477,7 @@ "object", "object graph" ], - "time": "2017-10-19 19:58:43" + "time": "2017-10-19T19:58:43+00:00" }, { "name": "phar-io/manifest", @@ -1533,7 +1532,7 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2017-03-05 18:14:27" + "time": "2017-03-05T18:14:27+00:00" }, { "name": "phar-io/version", @@ -1580,7 +1579,7 @@ } ], "description": "Library for handling version information and constraints", - "time": "2017-03-05 17:38:23" + "time": "2017-03-05T17:38:23+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -1634,7 +1633,7 @@ "reflection", "static analysis" ], - "time": "2017-09-11 18:02:19" + "time": "2017-09-11T18:02:19+00:00" }, { "name": "phpdocumentor/reflection-docblock", @@ -1679,7 +1678,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-08-30 18:51:59" + "time": "2017-08-30T18:51:59+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -1726,7 +1725,7 @@ "email": "me@mikevanriel.com" } ], - "time": "2017-07-14 14:27:02" + "time": "2017-07-14T14:27:02+00:00" }, { "name": "phpspec/prophecy", @@ -1789,7 +1788,7 @@ "spy", "stub" ], - "time": "2017-09-04 11:05:03" + "time": "2017-09-04T11:05:03+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1853,7 +1852,7 @@ "testing", "xunit" ], - "time": "2017-11-03 13:47:33" + "time": "2017-11-03T13:47:33+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1900,7 +1899,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03 07:40:28" + "time": "2016-10-03T07:40:28+00:00" }, { "name": "phpunit/php-text-template", @@ -1941,7 +1940,7 @@ "keywords": [ "template" ], - "time": "2015-06-21 13:50:34" + "time": "2015-06-21T13:50:34+00:00" }, { "name": "phpunit/php-timer", @@ -1990,7 +1989,7 @@ "keywords": [ "timer" ], - "time": "2017-02-26 11:10:40" + "time": "2017-02-26T11:10:40+00:00" }, { "name": "phpunit/php-token-stream", @@ -2039,7 +2038,7 @@ "keywords": [ "tokenizer" ], - "time": "2017-08-20 05:47:52" + "time": "2017-08-20T05:47:52+00:00" }, { "name": "phpunit/phpunit", @@ -2123,7 +2122,7 @@ "testing", "xunit" ], - "time": "2017-11-08 11:26:09" + "time": "2017-11-08T11:26:09+00:00" }, { "name": "phpunit/phpunit-mock-objects", @@ -2182,7 +2181,7 @@ "mock", "xunit" ], - "time": "2017-08-03 14:08:16" + "time": "2017-08-03T14:08:16+00:00" }, { "name": "psr/log", @@ -2229,7 +2228,7 @@ "psr", "psr-3" ], - "time": "2016-10-10 12:19:37" + "time": "2016-10-10T12:19:37+00:00" }, { "name": "rg3/youtube-dl", @@ -2268,7 +2267,7 @@ "GPL-2.0" ], "description": "rtmpdump binary for Linux 64 bit", - "time": "2016-04-12 19:17:32" + "time": "2016-04-12T19:17:32+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -2313,7 +2312,7 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04 06:30:41" + "time": "2017-03-04T06:30:41+00:00" }, { "name": "sebastian/comparator", @@ -2377,7 +2376,7 @@ "compare", "equality" ], - "time": "2017-11-03 07:16:52" + "time": "2017-11-03T07:16:52+00:00" }, { "name": "sebastian/diff", @@ -2429,7 +2428,7 @@ "keywords": [ "diff" ], - "time": "2017-08-03 08:09:46" + "time": "2017-08-03T08:09:46+00:00" }, { "name": "sebastian/environment", @@ -2479,7 +2478,7 @@ "environment", "hhvm" ], - "time": "2017-07-01 08:51:00" + "time": "2017-07-01T08:51:00+00:00" }, { "name": "sebastian/exporter", @@ -2546,7 +2545,7 @@ "export", "exporter" ], - "time": "2017-04-03 13:19:02" + "time": "2017-04-03T13:19:02+00:00" }, { "name": "sebastian/global-state", @@ -2597,7 +2596,7 @@ "keywords": [ "global state" ], - "time": "2017-04-27 15:39:26" + "time": "2017-04-27T15:39:26+00:00" }, { "name": "sebastian/object-enumerator", @@ -2644,7 +2643,7 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-08-03 12:35:26" + "time": "2017-08-03T12:35:26+00:00" }, { "name": "sebastian/object-reflector", @@ -2689,7 +2688,7 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "time": "2017-03-29 09:07:27" + "time": "2017-03-29T09:07:27+00:00" }, { "name": "sebastian/recursion-context", @@ -2742,7 +2741,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2017-03-03 06:23:57" + "time": "2017-03-03T06:23:57+00:00" }, { "name": "sebastian/resource-operations", @@ -2784,7 +2783,7 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28 20:34:47" + "time": "2015-07-28T20:34:47+00:00" }, { "name": "sebastian/version", @@ -2827,7 +2826,7 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03 07:35:21" + "time": "2016-10-03T07:35:21+00:00" }, { "name": "seld/cli-prompt", @@ -2875,7 +2874,7 @@ "input", "prompt" ], - "time": "2017-03-18 11:32:45" + "time": "2017-03-18T11:32:45+00:00" }, { "name": "seld/jsonlint", @@ -2924,7 +2923,7 @@ "parser", "validator" ], - "time": "2017-06-18 15:11:04" + "time": "2017-06-18T15:11:04+00:00" }, { "name": "seld/phar-utils", @@ -2968,7 +2967,7 @@ "keywords": [ "phra" ], - "time": "2015-10-13 18:44:15" + "time": "2015-10-13T18:44:15+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -3019,20 +3018,20 @@ "phpcs", "standards" ], - "time": "2017-10-16 22:40:25" + "time": "2017-10-16T22:40:25+00:00" }, { "name": "symfony/console", - "version": "v3.3.11", + "version": "v3.3.13", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "fd684d68f83568d8293564b4971928a2c4bdfc5c" + "reference": "63cd7960a0a522c3537f6326706d7f3b8de65805" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/fd684d68f83568d8293564b4971928a2c4bdfc5c", - "reference": "fd684d68f83568d8293564b4971928a2c4bdfc5c", + "url": "https://api.github.com/repos/symfony/console/zipball/63cd7960a0a522c3537f6326706d7f3b8de65805", + "reference": "63cd7960a0a522c3537f6326706d7f3b8de65805", "shasum": "" }, "require": { @@ -3087,11 +3086,11 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-11-07 14:16:22" + "time": "2017-11-16T15:24:32+00:00" }, { "name": "symfony/debug", - "version": "v3.3.11", + "version": "v3.3.13", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", @@ -3143,11 +3142,11 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-11-10 16:38:39" + "time": "2017-11-10T16:38:39+00:00" }, { "name": "symfony/filesystem", - "version": "v3.3.11", + "version": "v3.3.13", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -3192,11 +3191,11 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2017-11-07 14:12:55" + "time": "2017-11-07T14:12:55+00:00" }, { "name": "symfony/finder", - "version": "v3.3.11", + "version": "v3.3.13", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", @@ -3241,7 +3240,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-11-05 15:47:03" + "time": "2017-11-05T15:47:03+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -3300,11 +3299,11 @@ "portable", "shim" ], - "time": "2017-10-11 12:05:26" + "time": "2017-10-11T12:05:26+00:00" }, { "name": "symfony/var-dumper", - "version": "v3.3.11", + "version": "v3.3.13", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", @@ -3368,7 +3367,7 @@ "debug", "dump" ], - "time": "2017-11-07 14:16:22" + "time": "2017-11-07T14:16:22+00:00" }, { "name": "theseer/tokenizer", @@ -3408,7 +3407,7 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2017-04-07 12:08:54" + "time": "2017-04-07T12:08:54+00:00" }, { "name": "webmozart/assert", @@ -3458,7 +3457,7 @@ "check", "validate" ], - "time": "2016-11-23 20:04:58" + "time": "2016-11-23T20:04:58+00:00" } ], "aliases": [], From 2401b6b4a0471eabe52ffcd5d5b4fcf3a132dff9 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Tue, 21 Nov 2017 11:22:38 +0100 Subject: [PATCH 40/77] We don't always need to install dev dependencies with Yarn --- Dockerfile | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 52fd230..ecfc795 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,6 @@ RUN curl -sS https://getcomposer.org/installer | php COPY resources/php.ini /usr/local/etc/php/ COPY . /var/www/html/ RUN php composer.phar install --prefer-dist -RUN yarn install +RUN yarn install --prod RUN ./node_modules/.bin/grunt ENV CONVERT=1 diff --git a/README.md b/README.md index db0db29..f956f1b 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ When updating from Git, you need to run yarn and Composer again: ```bash git pull -yarn install +yarn install --prod composer install ``` From e2a5cbdb3054c0687fe0ad905df1de1ee1cd9912 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Tue, 21 Nov 2017 11:24:55 +0100 Subject: [PATCH 41/77] We don't need grunt-contrib-csslint in prod --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a44573f..08a3258 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,6 @@ "bugs": "https://github.com/Rudloff/alltube/issues", "dependencies": { "grunt": "~1.0.1", - "grunt-contrib-csslint": "~2.0.0", "grunt-contrib-cssmin": "~2.2.1", "grunt-contrib-uglify": "~3.1.0", "grunt-potomo": "~3.5.0", @@ -14,6 +13,7 @@ }, "devDependencies": { "grunt-contrib-compress": "~1.4.1", + "grunt-contrib-csslint": "~2.0.0", "grunt-contrib-watch": "~1.0.0", "grunt-fixpack": "~0.1.0", "grunt-githash": "~0.1.3", From d5efd1cbd7653a86b170d17ecfa101ed5397ad5f Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Thu, 23 Nov 2017 11:52:34 +0100 Subject: [PATCH 42/77] main in package.json should point to a JS file Since we only use Node for Grunt, the Gruntfile is what makes the most sense. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 08a3258..231fc31 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "youtube" ], "license": "GPL-3.0", - "main": "index.php", + "main": "Gruntfile.js", "repository": { "type": "git", "url": "https://github.com/Rudloff/alltube.git" From a6b5e4cc690a607124d1aa6f24b4c76a3c5b23f6 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Tue, 5 Dec 2017 14:09:06 +0100 Subject: [PATCH 43/77] Stop using a local Composer It is a bit overkill just to fix a timestamp issue Symfony update --- composer.json | 3 +- composer.lock | 835 ++++---------------------------------------------- 2 files changed, 54 insertions(+), 784 deletions(-) diff --git a/composer.json b/composer.json index f35678b..d47e8ba 100644 --- a/composer.json +++ b/composer.json @@ -25,8 +25,7 @@ "ffmpeg/ffmpeg": "dev-release", "rg3/youtube-dl": "2017.11.06", "rudloff/rtmpdump-bin": "~2.3.0", - "heroku/heroku-buildpack-php": "*", - "composer/composer": "~1.5.0" + "heroku/heroku-buildpack-php": "*" }, "extra": { "paas": { diff --git a/composer.lock b/composer.lock index 20266b9..41f9d19 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "2f2bb96c33a90fba39cb7e492875684e", + "content-hash": "571ff0ac0262ea0ad5b992fa2d0705cd", "packages": [ { "name": "aura/session", @@ -852,7 +852,7 @@ }, { "name": "symfony/process", - "version": "v3.3.13", + "version": "v3.3.14", "source": { "type": "git", "url": "https://github.com/symfony/process.git", @@ -901,16 +901,16 @@ }, { "name": "symfony/yaml", - "version": "v3.3.13", + "version": "v3.3.14", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "0938408c4faa518d95230deabb5f595bf0de31b9" + "reference": "36353762fdca3a0ecdce4640764efc885df979f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/0938408c4faa518d95230deabb5f595bf0de31b9", - "reference": "0938408c4faa518d95230deabb5f595bf0de31b9", + "url": "https://api.github.com/repos/symfony/yaml/zipball/36353762fdca3a0ecdce4640764efc885df979f6", + "reference": "36353762fdca3a0ecdce4640764efc885df979f6", "shasum": "" }, "require": { @@ -952,7 +952,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-11-10T18:26:04+00:00" + "time": "2017-12-04T14:51:35+00:00" }, { "name": "zonuexe/http-accept-language", @@ -997,265 +997,6 @@ } ], "packages-dev": [ - { - "name": "composer/ca-bundle", - "version": "1.0.9", - "source": { - "type": "git", - "url": "https://github.com/composer/ca-bundle.git", - "reference": "36344aeffdc37711335563e6108cda86566432a6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/36344aeffdc37711335563e6108cda86566432a6", - "reference": "36344aeffdc37711335563e6108cda86566432a6", - "shasum": "" - }, - "require": { - "ext-openssl": "*", - "ext-pcre": "*", - "php": "^5.3.2 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.5", - "psr/log": "^1.0", - "symfony/process": "^2.5 || ^3.0" - }, - "suggest": { - "symfony/process": "This is necessary to reliably check whether openssl_x509_parse is vulnerable on older php versions, but can be ignored on PHP 5.5.6+" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\CaBundle\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", - "keywords": [ - "cabundle", - "cacert", - "certificate", - "ssl", - "tls" - ], - "time": "2017-11-13T15:51:25+00:00" - }, - { - "name": "composer/composer", - "version": "1.5.2", - "source": { - "type": "git", - "url": "https://github.com/composer/composer.git", - "reference": "c639623fa2178b404ed4bab80f0d1263853fa4ae" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/c639623fa2178b404ed4bab80f0d1263853fa4ae", - "reference": "c639623fa2178b404ed4bab80f0d1263853fa4ae", - "shasum": "" - }, - "require": { - "composer/ca-bundle": "^1.0", - "composer/semver": "^1.0", - "composer/spdx-licenses": "^1.0", - "justinrainbow/json-schema": "^3.0 || ^4.0 || ^5.0", - "php": "^5.3.2 || ^7.0", - "psr/log": "^1.0", - "seld/cli-prompt": "^1.0", - "seld/jsonlint": "^1.4", - "seld/phar-utils": "^1.0", - "symfony/console": "^2.7 || ^3.0", - "symfony/filesystem": "^2.7 || ^3.0", - "symfony/finder": "^2.7 || ^3.0", - "symfony/process": "^2.7 || ^3.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.5 || ^5.0.5", - "phpunit/phpunit-mock-objects": "^2.3 || ^3.0" - }, - "suggest": { - "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", - "ext-zip": "Enabling the zip extension allows you to unzip archives", - "ext-zlib": "Allow gzip compression of HTTP requests" - }, - "bin": [ - "bin/composer" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.5-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\": "src/Composer" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Composer helps you declare, manage and install dependencies of PHP projects, ensuring you have the right stack everywhere.", - "homepage": "https://getcomposer.org/", - "keywords": [ - "autoload", - "dependency", - "package" - ], - "time": "2017-09-11T14:59:26+00:00" - }, - { - "name": "composer/semver", - "version": "1.4.2", - "source": { - "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/c7cb9a2095a074d131b65a8a0cd294479d785573", - "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.5 || ^5.0.5", - "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "keywords": [ - "semantic", - "semver", - "validation", - "versioning" - ], - "time": "2016-08-30T16:08:34+00:00" - }, - { - "name": "composer/spdx-licenses", - "version": "1.1.6", - "source": { - "type": "git", - "url": "https://github.com/composer/spdx-licenses.git", - "reference": "2603a0d7ddc00a015deb576fa5297ca43dee6b1c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/2603a0d7ddc00a015deb576fa5297ca43dee6b1c", - "reference": "2603a0d7ddc00a015deb576fa5297ca43dee6b1c", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.5 || ^5.0.5", - "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Spdx\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "SPDX licenses list and validation library.", - "keywords": [ - "license", - "spdx", - "validator" - ], - "time": "2017-04-03T19:08:52+00:00" - }, { "name": "doctrine/instantiator", "version": "1.0.5", @@ -1326,16 +1067,16 @@ }, { "name": "heroku/heroku-buildpack-php", - "version": "v126", + "version": "v127", "source": { "type": "git", "url": "https://github.com/heroku/heroku-buildpack-php.git", - "reference": "8288ddb4b717019f5e39db384e3a9a5b41d73e93" + "reference": "4428a20862137d682c9c15434c82a65c20541f97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/heroku/heroku-buildpack-php/zipball/8288ddb4b717019f5e39db384e3a9a5b41d73e93", - "reference": "8288ddb4b717019f5e39db384e3a9a5b41d73e93", + "url": "https://api.github.com/repos/heroku/heroku-buildpack-php/zipball/4428a20862137d682c9c15434c82a65c20541f97", + "reference": "4428a20862137d682c9c15434c82a65c20541f97", "shasum": "" }, "bin": [ @@ -1366,73 +1107,7 @@ "nginx", "php" ], - "time": "2017-10-28T00:17:41+00:00" - }, - { - "name": "justinrainbow/json-schema", - "version": "5.2.6", - "source": { - "type": "git", - "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "d283e11b6e14c6f4664cf080415c4341293e5bbd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/d283e11b6e14c6f4664cf080415c4341293e5bbd", - "reference": "d283e11b6e14c6f4664cf080415c4341293e5bbd", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.1", - "json-schema/json-schema-test-suite": "1.2.0", - "phpunit/phpunit": "^4.8.22" - }, - "bin": [ - "bin/validate-json" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "JsonSchema\\": "src/JsonSchema/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bruno Prieto Reis", - "email": "bruno.p.reis@gmail.com" - }, - { - "name": "Justin Rainbow", - "email": "justin.rainbow@gmail.com" - }, - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - }, - { - "name": "Robert Schönthal", - "email": "seroscho@googlemail.com" - } - ], - "description": "A library to validate a json schema.", - "homepage": "https://github.com/justinrainbow/json-schema", - "keywords": [ - "json", - "schema" - ], - "time": "2017-10-21T13:15:38+00:00" + "time": "2017-11-30T16:10:52+00:00" }, { "name": "myclabs/deep-copy", @@ -1637,29 +1312,35 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.1.1", + "version": "4.2.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2" + "reference": "66465776cfc249844bde6d117abff1d22e06c2da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/2d3d238c433cf69caeb4842e97a3223a116f94b2", - "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/66465776cfc249844bde6d117abff1d22e06c2da", + "reference": "66465776cfc249844bde6d117abff1d22e06c2da", "shasum": "" }, "require": { "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/reflection-common": "^1.0.0", "phpdocumentor/type-resolver": "^0.4.0", "webmozart/assert": "^1.0" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^4.4" + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, "autoload": { "psr-4": { "phpDocumentor\\Reflection\\": [ @@ -1678,7 +1359,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-08-30T18:51:59+00:00" + "time": "2017-11-27T17:38:31+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -1729,16 +1410,16 @@ }, { "name": "phpspec/prophecy", - "version": "v1.7.2", + "version": "1.7.3", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6" + "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", - "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", + "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", "shasum": "" }, "require": { @@ -1750,7 +1431,7 @@ }, "require-dev": { "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8 || ^5.6.5" + "phpunit/phpunit": "^4.8.35 || ^5.7" }, "type": "library", "extra": { @@ -1788,20 +1469,20 @@ "spy", "stub" ], - "time": "2017-09-04T11:05:03+00:00" + "time": "2017-11-24T13:59:53+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "5.2.3", + "version": "5.2.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "8e1d2397d8adf59a3f12b2878a3aaa66d1ab189d" + "reference": "033ec97498cf530cc1be4199264cad568b19be26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/8e1d2397d8adf59a3f12b2878a3aaa66d1ab189d", - "reference": "8e1d2397d8adf59a3f12b2878a3aaa66d1ab189d", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/033ec97498cf530cc1be4199264cad568b19be26", + "reference": "033ec97498cf530cc1be4199264cad568b19be26", "shasum": "" }, "require": { @@ -1810,7 +1491,7 @@ "php": "^7.0", "phpunit/php-file-iterator": "^1.4.2", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^2.0", + "phpunit/php-token-stream": "^2.0.1", "sebastian/code-unit-reverse-lookup": "^1.0.1", "sebastian/environment": "^3.0", "sebastian/version": "^2.0.1", @@ -1852,20 +1533,20 @@ "testing", "xunit" ], - "time": "2017-11-03T13:47:33+00:00" + "time": "2017-11-27T09:00:30+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.2", + "version": "1.4.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", "shasum": "" }, "require": { @@ -1899,7 +1580,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03T07:40:28+00:00" + "time": "2017-11-27T13:52:08+00:00" }, { "name": "phpunit/php-text-template", @@ -1993,16 +1674,16 @@ }, { "name": "phpunit/php-token-stream", - "version": "2.0.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0" + "reference": "791198a2c6254db10131eecfe8c06670700904db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9a02332089ac48e704c70f6cefed30c224e3c0b0", - "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", "shasum": "" }, "require": { @@ -2038,7 +1719,7 @@ "keywords": [ "tokenizer" ], - "time": "2017-08-20T05:47:52+00:00" + "time": "2017-11-27T05:48:46+00:00" }, { "name": "phpunit/phpunit", @@ -2183,53 +1864,6 @@ ], "time": "2017-08-03T14:08:16+00:00" }, - { - "name": "psr/log", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "time": "2016-10-10T12:19:37+00:00" - }, { "name": "rg3/youtube-dl", "version": "2017.11.06", @@ -2828,147 +2462,6 @@ "homepage": "https://github.com/sebastianbergmann/version", "time": "2016-10-03T07:35:21+00:00" }, - { - "name": "seld/cli-prompt", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/cli-prompt.git", - "reference": "a19a7376a4689d4d94cab66ab4f3c816019ba8dd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/cli-prompt/zipball/a19a7376a4689d4d94cab66ab4f3c816019ba8dd", - "reference": "a19a7376a4689d4d94cab66ab4f3c816019ba8dd", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Seld\\CliPrompt\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be" - } - ], - "description": "Allows you to prompt for user input on the command line, and optionally hide the characters they type", - "keywords": [ - "cli", - "console", - "hidden", - "input", - "prompt" - ], - "time": "2017-03-18T11:32:45+00:00" - }, - { - "name": "seld/jsonlint", - "version": "1.6.1", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "50d63f2858d87c4738d5b76a7dcbb99fa8cf7c77" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/50d63f2858d87c4738d5b76a7dcbb99fa8cf7c77", - "reference": "50d63f2858d87c4738d5b76a7dcbb99fa8cf7c77", - "shasum": "" - }, - "require": { - "php": "^5.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.5" - }, - "bin": [ - "bin/jsonlint" - ], - "type": "library", - "autoload": { - "psr-4": { - "Seld\\JsonLint\\": "src/Seld/JsonLint/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "JSON Linter", - "keywords": [ - "json", - "linter", - "parser", - "validator" - ], - "time": "2017-06-18T15:11:04+00:00" - }, - { - "name": "seld/phar-utils", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/phar-utils.git", - "reference": "7009b5139491975ef6486545a39f3e6dad5ac30a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/7009b5139491975ef6486545a39f3e6dad5ac30a", - "reference": "7009b5139491975ef6486545a39f3e6dad5ac30a", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Seld\\PharUtils\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be" - } - ], - "description": "PHAR file format utilities, for when PHP phars you up", - "keywords": [ - "phra" - ], - "time": "2015-10-13T18:44:15+00:00" - }, { "name": "squizlabs/php_codesniffer", "version": "3.1.1", @@ -3020,228 +2513,6 @@ ], "time": "2017-10-16T22:40:25+00:00" }, - { - "name": "symfony/console", - "version": "v3.3.13", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "63cd7960a0a522c3537f6326706d7f3b8de65805" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/63cd7960a0a522c3537f6326706d7f3b8de65805", - "reference": "63cd7960a0a522c3537f6326706d7f3b8de65805", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/debug": "~2.8|~3.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/dependency-injection": "<3.3" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~3.3", - "symfony/dependency-injection": "~3.3", - "symfony/event-dispatcher": "~2.8|~3.0", - "symfony/filesystem": "~2.8|~3.0", - "symfony/process": "~2.8|~3.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/filesystem": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com", - "time": "2017-11-16T15:24:32+00:00" - }, - { - "name": "symfony/debug", - "version": "v3.3.13", - "source": { - "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "74557880e2846b5c84029faa96b834da37e29810" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/74557880e2846b5c84029faa96b834da37e29810", - "reference": "74557880e2846b5c84029faa96b834da37e29810", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" - }, - "require-dev": { - "symfony/http-kernel": "~2.8|~3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Debug\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Debug Component", - "homepage": "https://symfony.com", - "time": "2017-11-10T16:38:39+00:00" - }, - { - "name": "symfony/filesystem", - "version": "v3.3.13", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "77db266766b54db3ee982fe51868328b887ce15c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/77db266766b54db3ee982fe51868328b887ce15c", - "reference": "77db266766b54db3ee982fe51868328b887ce15c", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Filesystem Component", - "homepage": "https://symfony.com", - "time": "2017-11-07T14:12:55+00:00" - }, - { - "name": "symfony/finder", - "version": "v3.3.13", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "138af5ec075d4b1d1bd19de08c38a34bb2d7d880" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/138af5ec075d4b1d1bd19de08c38a34bb2d7d880", - "reference": "138af5ec075d4b1d1bd19de08c38a34bb2d7d880", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "time": "2017-11-05T15:47:03+00:00" - }, { "name": "symfony/polyfill-mbstring", "version": "v1.6.0", @@ -3303,16 +2574,16 @@ }, { "name": "symfony/var-dumper", - "version": "v3.3.13", + "version": "v3.3.14", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "805de6bd6869073e60610df1b14ab7d969c61b01" + "reference": "f193230a7fd5051910de4e8238139921f3a40af8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/805de6bd6869073e60610df1b14ab7d969c61b01", - "reference": "805de6bd6869073e60610df1b14ab7d969c61b01", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/f193230a7fd5051910de4e8238139921f3a40af8", + "reference": "f193230a7fd5051910de4e8238139921f3a40af8", "shasum": "" }, "require": { @@ -3367,7 +2638,7 @@ "debug", "dump" ], - "time": "2017-11-07T14:16:22+00:00" + "time": "2017-11-30T09:28:49+00:00" }, { "name": "theseer/tokenizer", From 5cd6ea0c4401ca4db6d585bd82489c3f05d2abab Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Tue, 5 Dec 2017 14:14:27 +0100 Subject: [PATCH 44/77] AppVeyor now uses PHP 7.2 --- .appveyor.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 12ea72f..dbcdd30 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -4,12 +4,12 @@ install: - net start wuauserv - cinst php composer ffmpeg rtmpdump - refreshenv - - copy C:\tools\php71\php.ini-development C:\tools\php71\php.ini - - echo extension=C:\tools\php71\ext\php_gmp.dll >> C:\tools\php71\php.ini - - echo extension=C:\tools\php71\ext\php_gettext.dll >> C:\tools\php71\php.ini - - echo extension=C:\tools\php71\ext\php_intl.dll >> C:\tools\php71\php.ini - - echo extension=C:\tools\php71\ext\php_openssl.dll >> C:\tools\php71\php.ini - - echo extension=C:\tools\php71\ext\php_mbstring.dll >> C:\tools\php71\php.ini + - copy C:\tools\php72\php.ini-development C:\tools\php72\php.ini + - echo extension=C:\tools\php72\ext\php_gmp.dll >> C:\tools\php72\php.ini + - echo extension=C:\tools\php72\ext\php_gettext.dll >> C:\tools\php72\php.ini + - echo extension=C:\tools\php72\ext\php_intl.dll >> C:\tools\php72\php.ini + - echo extension=C:\tools\php72\ext\php_openssl.dll >> C:\tools\php72\php.ini + - echo extension=C:\tools\php72\ext\php_mbstring.dll >> C:\tools\php72\php.ini - composer install --no-dev - composer global require phpunit/phpunit - C:\Python36\python.exe -m pip install youtube-dl From 6b73026194caf596ae759cff2cf902380beb9466 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Tue, 5 Dec 2017 14:37:23 +0100 Subject: [PATCH 45/77] Fix cookie settings in tests --- classes/LocaleManager.php | 1 - tests/LocaleManagerTest.php | 2 +- tests/bootstrap.php | 2 ++ 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/classes/LocaleManager.php b/classes/LocaleManager.php index 73e9a6f..e220674 100644 --- a/classes/LocaleManager.php +++ b/classes/LocaleManager.php @@ -42,7 +42,6 @@ class LocaleManager { $session_factory = new \Aura\Session\SessionFactory(); $session = $session_factory->newInstance($cookies); - $session->setCookieParams(['httponly' => true]); $this->sessionSegment = $session->getSegment('Alltube\LocaleManager'); $cookieLocale = $this->sessionSegment->get('locale'); if (isset($cookieLocale)) { diff --git a/tests/LocaleManagerTest.php b/tests/LocaleManagerTest.php index 0e88239..ae9cb14 100644 --- a/tests/LocaleManagerTest.php +++ b/tests/LocaleManagerTest.php @@ -27,6 +27,7 @@ class LocaleManagerTest extends TestCase protected function setUp() { $this->localeManager = new LocaleManager(); + $_SESSION['Alltube\LocaleManager']['locale'] = 'foo_BAR'; } /** @@ -36,7 +37,6 @@ class LocaleManagerTest extends TestCase */ public function testConstructorWithCookies() { - $_SESSION['Alltube\LocaleManager']['locale'] = 'foo_BAR'; $localeManager = new LocaleManager([]); $this->assertEquals('foo_BAR', (string) $localeManager->getLocale()); } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 634e02a..44bb21f 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -9,6 +9,8 @@ use Alltube\PlaylistArchiveStream; */ require_once __DIR__.'/../vendor/autoload.php'; +ini_set('session.use_cookies', 0); +session_cache_limiter(''); session_start(); stream_wrapper_register('playlist', PlaylistArchiveStream::class); From 8cb3eb720887b60d828c343468708a89dec9a58d Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Tue, 5 Dec 2017 14:52:20 +0100 Subject: [PATCH 46/77] Ignore unused parameters in test --- tests/VideoDownloadTest.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/VideoDownloadTest.php b/tests/VideoDownloadTest.php index 4cad529..9bf200d 100644 --- a/tests/VideoDownloadTest.php +++ b/tests/VideoDownloadTest.php @@ -100,8 +100,13 @@ class VideoDownloadTest extends TestCase * @dataProvider rtmpUrlProvider * @dataProvider remuxUrlProvider */ - public function testGetURL($url, $format, $filename, $extension, $domain) - { + public function testGetURL( + $url, + $format, + /* @scrutinizer ignore-unused */ $filename, + /* @scrutinizer ignore-unused */ $extension, + $domain + ) { $videoURL = $this->download->getURL($url, $format); $this->assertContains($domain, $videoURL[0]); } From c3719f68e5fd3824fd828ea122662a4f9670da1a Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Tue, 5 Dec 2017 15:49:13 +0100 Subject: [PATCH 47/77] Add type checks in PlaylistArchiveStream --- classes/PlaylistArchiveStream.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/classes/PlaylistArchiveStream.php b/classes/PlaylistArchiveStream.php index d9b37d5..6bf74b3 100644 --- a/classes/PlaylistArchiveStream.php +++ b/classes/PlaylistArchiveStream.php @@ -78,7 +78,9 @@ class PlaylistArchiveStream extends TarArchive { $pos = ftell($this->buffer); fwrite($this->buffer, $data); - fseek($this->buffer, $pos); + if ($pos !== false) { + fseek($this->buffer, $pos); + } } /** @@ -91,7 +93,10 @@ class PlaylistArchiveStream extends TarArchive public function stream_open($path) { $this->format = ltrim(parse_url($path, PHP_URL_PATH), '/'); - $this->buffer = fopen('php://temp', 'r+'); + $buffer = fopen('php://temp', 'r+'); + if ($buffer !== false) { + $this->buffer = $buffer; + } foreach (explode(';', parse_url($path, PHP_URL_HOST)) as $url) { $this->files[] = [ 'url' => urldecode($url), @@ -131,7 +136,7 @@ class PlaylistArchiveStream extends TarArchive /** * Called when ftell() is used on the stream. * - * @return int + * @return int|false */ public function stream_tell() { @@ -171,7 +176,7 @@ class PlaylistArchiveStream extends TarArchive * * @param int $count Number of bytes to read * - * @return string + * @return string|false */ public function stream_read($count) { From d35b43dc177ad4a14f7e3d2a3a62cfb04ff653a0 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Tue, 5 Dec 2017 15:56:34 +0100 Subject: [PATCH 48/77] popen can also return false --- classes/VideoDownload.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/classes/VideoDownload.php b/classes/VideoDownload.php index 67b1e34..eb8b071 100644 --- a/classes/VideoDownload.php +++ b/classes/VideoDownload.php @@ -297,7 +297,7 @@ class VideoDownload * @param string $format Format to use for the video * @param string $password Video password * - * @return resource popen stream + * @return resource|false popen stream */ public function getAudioStream($url, $format, $password = null) { @@ -324,7 +324,7 @@ class VideoDownload * * @param \stdClass $video Video object returned by getJSON * - * @return resource popen stream + * @return resource|false popen stream */ public function getM3uStream(\stdClass $video) { @@ -353,7 +353,7 @@ class VideoDownload * * @param array $urls URLs of the video ($urls[0]) and audio ($urls[1]) files * - * @return resource popen stream + * @return resource|false popen stream */ public function getRemuxStream(array $urls) { @@ -379,7 +379,7 @@ class VideoDownload * * @param \stdClass $video Video object returned by getJSON * - * @return resource popen stream + * @return resource|false popen stream */ public function getRtmpStream(\stdClass $video) { @@ -392,7 +392,7 @@ class VideoDownload * @param object $video Video object returned by youtube-dl * @param string $format Requested format * - * @return resource + * @return resource|false */ public function getPlaylistArchiveStream(\stdClass $video, $format) { From 47789f8f8db9b6b29222cb2b7f0fdd5f3f7eb878 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Tue, 5 Dec 2017 16:06:57 +0100 Subject: [PATCH 49/77] Check that PlaylistArchiveStream::stream_read returns a string --- classes/VideoDownload.php | 44 ++++- composer.json | 6 +- composer.lock | 281 +++++++++++++++++++++++++++- tests/PlaylistArchiveStreamTest.php | 6 +- tests/bootstrap.php | 7 + 5 files changed, 330 insertions(+), 14 deletions(-) diff --git a/classes/VideoDownload.php b/classes/VideoDownload.php index eb8b071..7e847e1 100644 --- a/classes/VideoDownload.php +++ b/classes/VideoDownload.php @@ -297,7 +297,7 @@ class VideoDownload * @param string $format Format to use for the video * @param string $password Video password * - * @return resource|false popen stream + * @return resource popen stream */ public function getAudioStream($url, $format, $password = null) { @@ -311,12 +311,18 @@ class VideoDownload $chain = new Chain($process); $chain->add('|', $this->getAvconvMp3Process('-')); - return popen($chain->getProcess()->getCommandLine(), 'r'); + $stream = popen($chain->getProcess()->getCommandLine(), 'r'); } else { $avconvProc = $this->getAvconvMp3Process($video->url); - return popen($avconvProc->getCommandLine(), 'r'); + $stream = popen($avconvProc->getCommandLine(), 'r'); } + + if (!is_resource($stream)) { + throw new \Exception('Could not open popen stream.'); + } + + return $stream; } /** @@ -324,7 +330,7 @@ class VideoDownload * * @param \stdClass $video Video object returned by getJSON * - * @return resource|false popen stream + * @return resource popen stream */ public function getM3uStream(\stdClass $video) { @@ -345,7 +351,12 @@ class VideoDownload ] ); - return popen($procBuilder->getProcess()->getCommandLine(), 'r'); + $stream = popen($procBuilder->getProcess()->getCommandLine(), 'r'); + if (!is_resource($stream)) { + throw new \Exception('Could not open popen stream.'); + } + + return $stream; } /** @@ -353,7 +364,7 @@ class VideoDownload * * @param array $urls URLs of the video ($urls[0]) and audio ($urls[1]) files * - * @return resource|false popen stream + * @return resource popen stream */ public function getRemuxStream(array $urls) { @@ -371,7 +382,12 @@ class VideoDownload ] ); - return popen($procBuilder->getProcess()->getCommandLine(), 'r'); + $stream = popen($procBuilder->getProcess()->getCommandLine(), 'r'); + if (!is_resource($stream)) { + throw new \Exception('Could not open popen stream.'); + } + + return $stream; } /** @@ -379,11 +395,16 @@ class VideoDownload * * @param \stdClass $video Video object returned by getJSON * - * @return resource|false popen stream + * @return resource popen stream */ public function getRtmpStream(\stdClass $video) { - return popen($this->getRtmpProcess($video)->getCommandLine(), 'r'); + $stream = popen($this->getRtmpProcess($video)->getCommandLine(), 'r'); + if (!is_resource($stream)) { + throw new \Exception('Could not open popen stream.'); + } + + return $stream; } /** @@ -392,7 +413,7 @@ class VideoDownload * @param object $video Video object returned by youtube-dl * @param string $format Requested format * - * @return resource|false + * @return resource */ public function getPlaylistArchiveStream(\stdClass $video, $format) { @@ -401,6 +422,9 @@ class VideoDownload $playlistItems[] = urlencode($entry->url); } $stream = fopen('playlist://'.implode(';', $playlistItems).'/'.$format, 'r'); + if (!is_resource($stream)) { + throw new \Exception('Could not fopen popen stream.'); + } return $stream; } diff --git a/composer.json b/composer.json index d47e8ba..1ab082c 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,8 @@ "ffmpeg/ffmpeg": "dev-release", "rg3/youtube-dl": "2017.11.06", "rudloff/rtmpdump-bin": "~2.3.0", - "heroku/heroku-buildpack-php": "*" + "heroku/heroku-buildpack-php": "*", + "php-mock/php-mock-mockery": "~1.1.0" }, "extra": { "paas": { @@ -78,7 +79,8 @@ "autoload": { "psr-4": { "Alltube\\": "classes/", - "Alltube\\Controller\\": "controllers/" + "Alltube\\Controller\\": "controllers/", + "Alltube\\Test\\": "tests/" } }, "scripts": { diff --git a/composer.lock b/composer.lock index 41f9d19..f9fe3ba 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "571ff0ac0262ea0ad5b992fa2d0705cd", + "content-hash": "195cbc39a8ad0fbd9ed135f6c81944a9", "packages": [ { "name": "aura/session", @@ -1065,6 +1065,51 @@ ], "type": "library" }, + { + "name": "hamcrest/hamcrest-php", + "version": "v1.2.2", + "source": { + "type": "git", + "url": "https://github.com/hamcrest/hamcrest-php.git", + "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/b37020aa976fa52d3de9aa904aa2522dc518f79c", + "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "replace": { + "cordoval/hamcrest-php": "*", + "davedevelopment/hamcrest-php": "*", + "kodova/hamcrest-php": "*" + }, + "require-dev": { + "phpunit/php-file-iterator": "1.3.3", + "satooshi/php-coveralls": "dev-master" + }, + "type": "library", + "autoload": { + "classmap": [ + "hamcrest" + ], + "files": [ + "hamcrest/Hamcrest.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD" + ], + "description": "This is the PHP port of Hamcrest Matchers", + "keywords": [ + "test" + ], + "time": "2015-05-11T14:41:42+00:00" + }, { "name": "heroku/heroku-buildpack-php", "version": "v127", @@ -1109,6 +1154,71 @@ ], "time": "2017-11-30T16:10:52+00:00" }, + { + "name": "mockery/mockery", + "version": "0.9.9", + "source": { + "type": "git", + "url": "https://github.com/mockery/mockery.git", + "reference": "6fdb61243844dc924071d3404bb23994ea0b6856" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mockery/mockery/zipball/6fdb61243844dc924071d3404bb23994ea0b6856", + "reference": "6fdb61243844dc924071d3404bb23994ea0b6856", + "shasum": "" + }, + "require": { + "hamcrest/hamcrest-php": "~1.1", + "lib-pcre": ">=7.0", + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.9.x-dev" + } + }, + "autoload": { + "psr-0": { + "Mockery": "library/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Pádraic Brady", + "email": "padraic.brady@gmail.com", + "homepage": "http://blog.astrumfutura.com" + }, + { + "name": "Dave Marshall", + "email": "dave.marshall@atstsolutions.co.uk", + "homepage": "http://davedevelopment.co.uk" + } + ], + "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.", + "homepage": "http://github.com/padraic/mockery", + "keywords": [ + "BDD", + "TDD", + "library", + "mock", + "mock objects", + "mockery", + "stub", + "test", + "test double", + "testing" + ], + "time": "2017-02-28T12:52:32+00:00" + }, { "name": "myclabs/deep-copy", "version": "1.7.0", @@ -1256,6 +1366,175 @@ "description": "Library for handling version information and constraints", "time": "2017-03-05T17:38:23+00:00" }, + { + "name": "php-mock/php-mock", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-mock/php-mock.git", + "reference": "bfa2d17d64dbf129073a7ba2051a96ce52749570" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-mock/php-mock/zipball/bfa2d17d64dbf129073a7ba2051a96ce52749570", + "reference": "bfa2d17d64dbf129073a7ba2051a96ce52749570", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpunit/php-text-template": "^1" + }, + "replace": { + "malkusch/php-mock": "*" + }, + "require-dev": { + "phpunit/phpunit": "^4|^5" + }, + "suggest": { + "php-mock/php-mock-mockery": "Allows using PHPMockery for Mockery integration", + "php-mock/php-mock-phpunit": "Allows integration into PHPUnit testcase with the trait PHPMock." + }, + "type": "library", + "autoload": { + "psr-4": { + "phpmock\\": [ + "classes/", + "tests/unit/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "WTFPL" + ], + "authors": [ + { + "name": "Markus Malkusch", + "email": "markus@malkusch.de", + "homepage": "http://markus.malkusch.de", + "role": "Developer" + } + ], + "description": "PHP-Mock can mock built-in PHP functions (e.g. time()). PHP-Mock relies on PHP's namespace fallback policy. No further extension is needed.", + "homepage": "https://github.com/php-mock/php-mock", + "keywords": [ + "BDD", + "TDD", + "function", + "mock", + "stub", + "test", + "test double" + ], + "time": "2015-11-11T22:37:09+00:00" + }, + { + "name": "php-mock/php-mock-integration", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-mock/php-mock-integration.git", + "reference": "e83fb65dd20cd3cf250d554cbd4682b96b684f4b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-mock/php-mock-integration/zipball/e83fb65dd20cd3cf250d554cbd4682b96b684f4b", + "reference": "e83fb65dd20cd3cf250d554cbd4682b96b684f4b", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "php-mock/php-mock": "^1", + "phpunit/php-text-template": "^1" + }, + "require-dev": { + "phpunit/phpunit": "^4|^5" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpmock\\integration\\": "classes/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "WTFPL" + ], + "authors": [ + { + "name": "Markus Malkusch", + "email": "markus@malkusch.de", + "homepage": "http://markus.malkusch.de", + "role": "Developer" + } + ], + "description": "Integration package for PHP-Mock", + "homepage": "https://github.com/php-mock/php-mock-integration", + "keywords": [ + "BDD", + "TDD", + "function", + "mock", + "stub", + "test", + "test double" + ], + "time": "2015-10-26T21:21:42+00:00" + }, + { + "name": "php-mock/php-mock-mockery", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-mock/php-mock-mockery.git", + "reference": "bc1fe0608cd47c939aba5eac1cb50de1cda9cbc3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-mock/php-mock-mockery/zipball/bc1fe0608cd47c939aba5eac1cb50de1cda9cbc3", + "reference": "bc1fe0608cd47c939aba5eac1cb50de1cda9cbc3", + "shasum": "" + }, + "require": { + "mockery/mockery": "^0.9", + "php": ">=5.5", + "php-mock/php-mock-integration": "^1" + }, + "require-dev": { + "phpunit/phpunit": "^4|^5" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpmock\\mockery\\": "classes/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "WTFPL" + ], + "authors": [ + { + "name": "Markus Malkusch", + "email": "markus@malkusch.de", + "homepage": "http://markus.malkusch.de", + "role": "Developer" + } + ], + "description": "Mock built-in PHP functions (e.g. time()) with Mockery. This package relies on PHP's namespace fallback policy. No further extension is needed.", + "homepage": "https://github.com/php-mock/php-mock-mockery", + "keywords": [ + "BDD", + "TDD", + "function", + "mock", + "mockery", + "stub", + "test", + "test double" + ], + "time": "2015-11-11T22:48:58+00:00" + }, { "name": "phpdocumentor/reflection-common", "version": "1.0.1", diff --git a/tests/PlaylistArchiveStreamTest.php b/tests/PlaylistArchiveStreamTest.php index 35ac628..fde76c6 100644 --- a/tests/PlaylistArchiveStreamTest.php +++ b/tests/PlaylistArchiveStreamTest.php @@ -95,7 +95,11 @@ class PlaylistArchiveStreamTest extends TestCase { $this->stream->stream_open('playlist://BaW_jenozKc;BaW_jenozKc/worst'); while (!$this->stream->stream_eof()) { - $this->assertLessThanOrEqual(8192, strlen($this->stream->stream_read(8192))); + $result = $this->stream->stream_read(8192); + $this->assertInternalType('string', $result); + if (is_string($result)) { + $this->assertLessThanOrEqual(8192, strlen($result)); + } } } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 44bb21f..320d6d1 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -3,6 +3,7 @@ * File used to bootstrap tests. */ use Alltube\PlaylistArchiveStream; +use phpmock\mockery\PHPMockery; /** * Composer autoload. @@ -14,3 +15,9 @@ session_cache_limiter(''); session_start(); stream_wrapper_register('playlist', PlaylistArchiveStream::class); + +/** + * @see https://bugs.php.net/bug.php?id=68541 + */ +PHPMockery::define('Alltube', 'popen'); +PHPMockery::define('Alltube', 'fopen'); From d581621f1be2b16f49f1a0458ee7188c06c79d25 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Tue, 5 Dec 2017 19:42:57 +0100 Subject: [PATCH 50/77] Throw an exception when a popen stream is not created correctly --- composer.json | 6 +- composer.lock | 645 ++++++++++++++++--------------- tests/VideoDownloadStubsTest.php | 127 ++++++ tests/bootstrap.php | 2 +- 4 files changed, 455 insertions(+), 325 deletions(-) create mode 100644 tests/VideoDownloadStubsTest.php diff --git a/composer.json b/composer.json index 1ab082c..b612982 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,8 @@ "barracudanetworks/archivestream-php": "~1.0.5", "smarty-gettext/smarty-gettext": "~1.5.1", "zonuexe/http-accept-language": "~0.4.1", - "rinvex/country": "~3.1.0" + "rinvex/country": "~3.1.0", + "php-mock/php-mock-mockery": "~1.2.0" }, "require-dev": { "symfony/var-dumper": "~3.3.9", @@ -25,8 +26,7 @@ "ffmpeg/ffmpeg": "dev-release", "rg3/youtube-dl": "2017.11.06", "rudloff/rtmpdump-bin": "~2.3.0", - "heroku/heroku-buildpack-php": "*", - "php-mock/php-mock-mockery": "~1.1.0" + "heroku/heroku-buildpack-php": "*" }, "extra": { "paas": { diff --git a/composer.lock b/composer.lock index f9fe3ba..ccce1b1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "195cbc39a8ad0fbd9ed135f6c81944a9", + "content-hash": "211f5fdec300d8764b22ea63c0912750", "packages": [ { "name": "aura/session", @@ -320,6 +320,54 @@ ], "time": "2017-03-20T17:10:46+00:00" }, + { + "name": "hamcrest/hamcrest-php", + "version": "v2.0.0", + "source": { + "type": "git", + "url": "https://github.com/hamcrest/hamcrest-php.git", + "reference": "776503d3a8e85d4f9a1148614f95b7a608b046ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/776503d3a8e85d4f9a1148614f95b7a608b046ad", + "reference": "776503d3a8e85d4f9a1148614f95b7a608b046ad", + "shasum": "" + }, + "require": { + "php": "^5.3|^7.0" + }, + "replace": { + "cordoval/hamcrest-php": "*", + "davedevelopment/hamcrest-php": "*", + "kodova/hamcrest-php": "*" + }, + "require-dev": { + "phpunit/php-file-iterator": "1.3.3", + "phpunit/phpunit": "~4.0", + "satooshi/php-coveralls": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "hamcrest" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD" + ], + "description": "This is the PHP port of Hamcrest Matchers", + "keywords": [ + "test" + ], + "time": "2016-01-20T08:20:44+00:00" + }, { "name": "mathmarques/smarty-view", "version": "1.1.1", @@ -370,6 +418,71 @@ ], "time": "2016-08-25T19:04:49+00:00" }, + { + "name": "mockery/mockery", + "version": "1.0", + "source": { + "type": "git", + "url": "https://github.com/mockery/mockery.git", + "reference": "1bac8c362b12f522fdd1f1fa3556284c91affa38" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mockery/mockery/zipball/1bac8c362b12f522fdd1f1fa3556284c91affa38", + "reference": "1bac8c362b12f522fdd1f1fa3556284c91affa38", + "shasum": "" + }, + "require": { + "hamcrest/hamcrest-php": "~2.0", + "lib-pcre": ">=7.0", + "php": ">=5.6.0" + }, + "require-dev": { + "phpunit/phpunit": "~5.7|~6.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Mockery": "library/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Pádraic Brady", + "email": "padraic.brady@gmail.com", + "homepage": "http://blog.astrumfutura.com" + }, + { + "name": "Dave Marshall", + "email": "dave.marshall@atstsolutions.co.uk", + "homepage": "http://davedevelopment.co.uk" + } + ], + "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.", + "homepage": "http://github.com/mockery/mockery", + "keywords": [ + "BDD", + "TDD", + "library", + "mock", + "mock objects", + "mockery", + "stub", + "test", + "test double", + "testing" + ], + "time": "2017-10-06T16:20:43+00:00" + }, { "name": "nikic/fast-route", "version": "v1.2.0", @@ -413,6 +526,216 @@ ], "time": "2017-01-19T11:35:12+00:00" }, + { + "name": "php-mock/php-mock", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-mock/php-mock.git", + "reference": "bfa2d17d64dbf129073a7ba2051a96ce52749570" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-mock/php-mock/zipball/bfa2d17d64dbf129073a7ba2051a96ce52749570", + "reference": "bfa2d17d64dbf129073a7ba2051a96ce52749570", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpunit/php-text-template": "^1" + }, + "replace": { + "malkusch/php-mock": "*" + }, + "require-dev": { + "phpunit/phpunit": "^4|^5" + }, + "suggest": { + "php-mock/php-mock-mockery": "Allows using PHPMockery for Mockery integration", + "php-mock/php-mock-phpunit": "Allows integration into PHPUnit testcase with the trait PHPMock." + }, + "type": "library", + "autoload": { + "psr-4": { + "phpmock\\": [ + "classes/", + "tests/unit/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "WTFPL" + ], + "authors": [ + { + "name": "Markus Malkusch", + "email": "markus@malkusch.de", + "homepage": "http://markus.malkusch.de", + "role": "Developer" + } + ], + "description": "PHP-Mock can mock built-in PHP functions (e.g. time()). PHP-Mock relies on PHP's namespace fallback policy. No further extension is needed.", + "homepage": "https://github.com/php-mock/php-mock", + "keywords": [ + "BDD", + "TDD", + "function", + "mock", + "stub", + "test", + "test double" + ], + "time": "2015-11-11T22:37:09+00:00" + }, + { + "name": "php-mock/php-mock-integration", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-mock/php-mock-integration.git", + "reference": "e83fb65dd20cd3cf250d554cbd4682b96b684f4b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-mock/php-mock-integration/zipball/e83fb65dd20cd3cf250d554cbd4682b96b684f4b", + "reference": "e83fb65dd20cd3cf250d554cbd4682b96b684f4b", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "php-mock/php-mock": "^1", + "phpunit/php-text-template": "^1" + }, + "require-dev": { + "phpunit/phpunit": "^4|^5" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpmock\\integration\\": "classes/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "WTFPL" + ], + "authors": [ + { + "name": "Markus Malkusch", + "email": "markus@malkusch.de", + "homepage": "http://markus.malkusch.de", + "role": "Developer" + } + ], + "description": "Integration package for PHP-Mock", + "homepage": "https://github.com/php-mock/php-mock-integration", + "keywords": [ + "BDD", + "TDD", + "function", + "mock", + "stub", + "test", + "test double" + ], + "time": "2015-10-26T21:21:42+00:00" + }, + { + "name": "php-mock/php-mock-mockery", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/php-mock/php-mock-mockery.git", + "reference": "f3d67a36558c6d1fb912ed8ba786fffaf94e0755" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-mock/php-mock-mockery/zipball/f3d67a36558c6d1fb912ed8ba786fffaf94e0755", + "reference": "f3d67a36558c6d1fb912ed8ba786fffaf94e0755", + "shasum": "" + }, + "require": { + "mockery/mockery": "^1", + "php": ">=5.6", + "php-mock/php-mock-integration": "^1" + }, + "require-dev": { + "phpunit/phpunit": "^4|^5" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpmock\\mockery\\": "classes/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "WTFPL" + ], + "authors": [ + { + "name": "Markus Malkusch", + "email": "markus@malkusch.de", + "homepage": "http://markus.malkusch.de", + "role": "Developer" + } + ], + "description": "Mock built-in PHP functions (e.g. time()) with Mockery. This package relies on PHP's namespace fallback policy. No further extension is needed.", + "homepage": "https://github.com/php-mock/php-mock-mockery", + "keywords": [ + "BDD", + "TDD", + "function", + "mock", + "mockery", + "stub", + "test", + "test double" + ], + "time": "2017-10-13T09:34:01+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21T13:50:34+00:00" + }, { "name": "pimple/pimple", "version": "v3.2.2", @@ -1065,51 +1388,6 @@ ], "type": "library" }, - { - "name": "hamcrest/hamcrest-php", - "version": "v1.2.2", - "source": { - "type": "git", - "url": "https://github.com/hamcrest/hamcrest-php.git", - "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/b37020aa976fa52d3de9aa904aa2522dc518f79c", - "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "replace": { - "cordoval/hamcrest-php": "*", - "davedevelopment/hamcrest-php": "*", - "kodova/hamcrest-php": "*" - }, - "require-dev": { - "phpunit/php-file-iterator": "1.3.3", - "satooshi/php-coveralls": "dev-master" - }, - "type": "library", - "autoload": { - "classmap": [ - "hamcrest" - ], - "files": [ - "hamcrest/Hamcrest.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD" - ], - "description": "This is the PHP port of Hamcrest Matchers", - "keywords": [ - "test" - ], - "time": "2015-05-11T14:41:42+00:00" - }, { "name": "heroku/heroku-buildpack-php", "version": "v127", @@ -1154,71 +1432,6 @@ ], "time": "2017-11-30T16:10:52+00:00" }, - { - "name": "mockery/mockery", - "version": "0.9.9", - "source": { - "type": "git", - "url": "https://github.com/mockery/mockery.git", - "reference": "6fdb61243844dc924071d3404bb23994ea0b6856" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/6fdb61243844dc924071d3404bb23994ea0b6856", - "reference": "6fdb61243844dc924071d3404bb23994ea0b6856", - "shasum": "" - }, - "require": { - "hamcrest/hamcrest-php": "~1.1", - "lib-pcre": ">=7.0", - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.9.x-dev" - } - }, - "autoload": { - "psr-0": { - "Mockery": "library/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Pádraic Brady", - "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" - }, - { - "name": "Dave Marshall", - "email": "dave.marshall@atstsolutions.co.uk", - "homepage": "http://davedevelopment.co.uk" - } - ], - "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.", - "homepage": "http://github.com/padraic/mockery", - "keywords": [ - "BDD", - "TDD", - "library", - "mock", - "mock objects", - "mockery", - "stub", - "test", - "test double", - "testing" - ], - "time": "2017-02-28T12:52:32+00:00" - }, { "name": "myclabs/deep-copy", "version": "1.7.0", @@ -1366,175 +1579,6 @@ "description": "Library for handling version information and constraints", "time": "2017-03-05T17:38:23+00:00" }, - { - "name": "php-mock/php-mock", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-mock/php-mock.git", - "reference": "bfa2d17d64dbf129073a7ba2051a96ce52749570" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-mock/php-mock/zipball/bfa2d17d64dbf129073a7ba2051a96ce52749570", - "reference": "bfa2d17d64dbf129073a7ba2051a96ce52749570", - "shasum": "" - }, - "require": { - "php": ">=5.5", - "phpunit/php-text-template": "^1" - }, - "replace": { - "malkusch/php-mock": "*" - }, - "require-dev": { - "phpunit/phpunit": "^4|^5" - }, - "suggest": { - "php-mock/php-mock-mockery": "Allows using PHPMockery for Mockery integration", - "php-mock/php-mock-phpunit": "Allows integration into PHPUnit testcase with the trait PHPMock." - }, - "type": "library", - "autoload": { - "psr-4": { - "phpmock\\": [ - "classes/", - "tests/unit/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "WTFPL" - ], - "authors": [ - { - "name": "Markus Malkusch", - "email": "markus@malkusch.de", - "homepage": "http://markus.malkusch.de", - "role": "Developer" - } - ], - "description": "PHP-Mock can mock built-in PHP functions (e.g. time()). PHP-Mock relies on PHP's namespace fallback policy. No further extension is needed.", - "homepage": "https://github.com/php-mock/php-mock", - "keywords": [ - "BDD", - "TDD", - "function", - "mock", - "stub", - "test", - "test double" - ], - "time": "2015-11-11T22:37:09+00:00" - }, - { - "name": "php-mock/php-mock-integration", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-mock/php-mock-integration.git", - "reference": "e83fb65dd20cd3cf250d554cbd4682b96b684f4b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-mock/php-mock-integration/zipball/e83fb65dd20cd3cf250d554cbd4682b96b684f4b", - "reference": "e83fb65dd20cd3cf250d554cbd4682b96b684f4b", - "shasum": "" - }, - "require": { - "php": ">=5.5", - "php-mock/php-mock": "^1", - "phpunit/php-text-template": "^1" - }, - "require-dev": { - "phpunit/phpunit": "^4|^5" - }, - "type": "library", - "autoload": { - "psr-4": { - "phpmock\\integration\\": "classes/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "WTFPL" - ], - "authors": [ - { - "name": "Markus Malkusch", - "email": "markus@malkusch.de", - "homepage": "http://markus.malkusch.de", - "role": "Developer" - } - ], - "description": "Integration package for PHP-Mock", - "homepage": "https://github.com/php-mock/php-mock-integration", - "keywords": [ - "BDD", - "TDD", - "function", - "mock", - "stub", - "test", - "test double" - ], - "time": "2015-10-26T21:21:42+00:00" - }, - { - "name": "php-mock/php-mock-mockery", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/php-mock/php-mock-mockery.git", - "reference": "bc1fe0608cd47c939aba5eac1cb50de1cda9cbc3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-mock/php-mock-mockery/zipball/bc1fe0608cd47c939aba5eac1cb50de1cda9cbc3", - "reference": "bc1fe0608cd47c939aba5eac1cb50de1cda9cbc3", - "shasum": "" - }, - "require": { - "mockery/mockery": "^0.9", - "php": ">=5.5", - "php-mock/php-mock-integration": "^1" - }, - "require-dev": { - "phpunit/phpunit": "^4|^5" - }, - "type": "library", - "autoload": { - "psr-4": { - "phpmock\\mockery\\": "classes/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "WTFPL" - ], - "authors": [ - { - "name": "Markus Malkusch", - "email": "markus@malkusch.de", - "homepage": "http://markus.malkusch.de", - "role": "Developer" - } - ], - "description": "Mock built-in PHP functions (e.g. time()) with Mockery. This package relies on PHP's namespace fallback policy. No further extension is needed.", - "homepage": "https://github.com/php-mock/php-mock-mockery", - "keywords": [ - "BDD", - "TDD", - "function", - "mock", - "mockery", - "stub", - "test", - "test double" - ], - "time": "2015-11-11T22:48:58+00:00" - }, { "name": "phpdocumentor/reflection-common", "version": "1.0.1", @@ -1861,47 +1905,6 @@ ], "time": "2017-11-27T13:52:08+00:00" }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2015-06-21T13:50:34+00:00" - }, { "name": "phpunit/php-timer", "version": "1.0.9", diff --git a/tests/VideoDownloadStubsTest.php b/tests/VideoDownloadStubsTest.php new file mode 100644 index 0000000..8db9d0b --- /dev/null +++ b/tests/VideoDownloadStubsTest.php @@ -0,0 +1,127 @@ +config = Config::getInstance('config/'.$configFile); + $this->download = new VideoDownload($this->config); + $this->url = 'https://www.youtube.com/watch?v=XJC9_JkzugE'; + } + + /** + * Remove stubs. + * + * @return void + */ + protected function tearDown() + { + Mockery::close(); + } + + /** + * Test getAudioStream function with a buggy popen. + * + * @return void + * @expectedException Exception + */ + public function testGetAudioStreamWithPopenError() + { + $this->download->getAudioStream($this->url, 'best'); + } + + /** + * Test getM3uStream function with a buggy popen. + * + * @return void + * @expectedException Exception + */ + public function testGetM3uStreamWithPopenError() + { + $this->download->getM3uStream($this->download->getJSON($this->url, 'best')); + } + + /** + * Test getRtmpStream function with a buggy popen. + * + * @return void + * @expectedException Exception + */ + public function testGetRtmpStreamWithPopenError() + { + $this->download->getRtmpStream($this->download->getJSON($this->url, 'best')); + } + + /** + * Test getRemuxStream function with a buggy popen. + * + * @return void + * @expectedException Exception + */ + public function testGetRemuxStreamWithPopenError() + { + $this->download->getRemuxStream([$this->url, $this->url]); + } + + /** + * Test getPlaylistArchiveStream function with a buggy popen. + * + * @return void + * @expectedException Exception + */ + public function testGetPlaylistArchiveStreamWithPopenError() + { + $video = $this->download->getJSON( + 'https://www.youtube.com/playlist?list=PLgdySZU6KUXL_8Jq5aUkyNV7wCa-4wZsC', + 'best' + ); + $this->download->getPlaylistArchiveStream($video, 'best'); + } +} diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 320d6d1..4f64daf 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -16,7 +16,7 @@ session_start(); stream_wrapper_register('playlist', PlaylistArchiveStream::class); -/** +/* * @see https://bugs.php.net/bug.php?id=68541 */ PHPMockery::define('Alltube', 'popen'); From 019fc269fe30c41d071df7db73da6d7ca255483e Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Tue, 5 Dec 2017 21:02:57 +0100 Subject: [PATCH 51/77] Update phpunit to 6.5 Update Slim to 3.9 --- composer.json | 4 ++-- composer.lock | 48 ++++++++++++++++++++++++------------------------ 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/composer.json b/composer.json index b612982..fa5c08c 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "homepage": "http://alltubedownload.net/", "type": "project", "require": { - "slim/slim": "~3.8.1", + "slim/slim": "~3.9.2", "mathmarques/smarty-view": "~1.1.0", "symfony/yaml": "~3.3.9", "symfony/process": "~3.3.9", @@ -21,7 +21,7 @@ "require-dev": { "symfony/var-dumper": "~3.3.9", "squizlabs/php_codesniffer": "~3.1.0", - "phpunit/phpunit": "~6.4.3", + "phpunit/phpunit": "~6.5.2", "doctrine/instantiator": "~1.0.0", "ffmpeg/ffmpeg": "dev-release", "rg3/youtube-dl": "2017.11.06", diff --git a/composer.lock b/composer.lock index ccce1b1..bd6af6a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "211f5fdec300d8764b22ea63c0912750", + "content-hash": "1ddc68bc8402785971a268a869f50d8c", "packages": [ { "name": "aura/session", @@ -997,16 +997,16 @@ }, { "name": "slim/slim", - "version": "3.8.1", + "version": "3.9.2", "source": { "type": "git", "url": "https://github.com/slimphp/Slim.git", - "reference": "5385302707530b2bccee1769613ad769859b826d" + "reference": "4086d0106cf5a7135c69fce4161fe355a8feb118" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slimphp/Slim/zipball/5385302707530b2bccee1769613ad769859b826d", - "reference": "5385302707530b2bccee1769613ad769859b826d", + "url": "https://api.github.com/repos/slimphp/Slim/zipball/4086d0106cf5a7135c69fce4161fe355a8feb118", + "reference": "4086d0106cf5a7135c69fce4161fe355a8feb118", "shasum": "" }, "require": { @@ -1064,7 +1064,7 @@ "micro", "router" ], - "time": "2017-03-19T17:55:20+00:00" + "time": "2017-11-26T19:13:09+00:00" }, { "name": "smarty-gettext/smarty-gettext", @@ -2005,16 +2005,16 @@ }, { "name": "phpunit/phpunit", - "version": "6.4.4", + "version": "6.5.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "562f7dc75d46510a4ed5d16189ae57fbe45a9932" + "reference": "24b708f2fd725bcef1c8153b366043381aa324f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/562f7dc75d46510a4ed5d16189ae57fbe45a9932", - "reference": "562f7dc75d46510a4ed5d16189ae57fbe45a9932", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/24b708f2fd725bcef1c8153b366043381aa324f2", + "reference": "24b708f2fd725bcef1c8153b366043381aa324f2", "shasum": "" }, "require": { @@ -2028,12 +2028,12 @@ "phar-io/version": "^1.0", "php": "^7.0", "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^5.2.2", - "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-code-coverage": "^5.2.3", + "phpunit/php-file-iterator": "^1.4.3", "phpunit/php-text-template": "^1.2.1", "phpunit/php-timer": "^1.0.9", - "phpunit/phpunit-mock-objects": "^4.0.3", - "sebastian/comparator": "^2.0.2", + "phpunit/phpunit-mock-objects": "^5.0.4", + "sebastian/comparator": "^2.1", "sebastian/diff": "^2.0", "sebastian/environment": "^3.1", "sebastian/exporter": "^3.1", @@ -2059,7 +2059,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.4.x-dev" + "dev-master": "6.5.x-dev" } }, "autoload": { @@ -2085,20 +2085,20 @@ "testing", "xunit" ], - "time": "2017-11-08T11:26:09+00:00" + "time": "2017-12-02T05:36:24+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "4.0.4", + "version": "5.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "2f789b59ab89669015ad984afa350c4ec577ade0" + "reference": "16b50f4167e5e85e81ca8a3dd105d0a5fd32009a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/2f789b59ab89669015ad984afa350c4ec577ade0", - "reference": "2f789b59ab89669015ad984afa350c4ec577ade0", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/16b50f4167e5e85e81ca8a3dd105d0a5fd32009a", + "reference": "16b50f4167e5e85e81ca8a3dd105d0a5fd32009a", "shasum": "" }, "require": { @@ -2111,7 +2111,7 @@ "phpunit/phpunit": "<6.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^6.5" }, "suggest": { "ext-soap": "*" @@ -2119,7 +2119,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0.x-dev" + "dev-master": "5.0.x-dev" } }, "autoload": { @@ -2134,7 +2134,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -2144,7 +2144,7 @@ "mock", "xunit" ], - "time": "2017-08-03T14:08:16+00:00" + "time": "2017-12-02T05:31:19+00:00" }, { "name": "rg3/youtube-dl", From 0bc5120751f69c2b2dabc39c3a0df6d337958bcb Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Tue, 5 Dec 2017 21:12:59 +0100 Subject: [PATCH 52/77] Cleaner way to add a pipe --- classes/VideoDownload.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/VideoDownload.php b/classes/VideoDownload.php index 7e847e1..f711341 100644 --- a/classes/VideoDownload.php +++ b/classes/VideoDownload.php @@ -309,7 +309,7 @@ class VideoDownload if (parse_url($video->url, PHP_URL_SCHEME) == 'rtmp') { $process = $this->getRtmpProcess($video); $chain = new Chain($process); - $chain->add('|', $this->getAvconvMp3Process('-')); + $chain->pipe($this->getAvconvMp3Process('-')); $stream = popen($chain->getProcess()->getCommandLine(), 'r'); } else { From c171e9b3e38557449a37951c159f5265952f0e14 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Wed, 6 Dec 2017 13:28:56 +0100 Subject: [PATCH 53/77] Minor phpunit update --- composer.lock | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/composer.lock b/composer.lock index bd6af6a..5dda001 100644 --- a/composer.lock +++ b/composer.lock @@ -1796,16 +1796,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "5.2.4", + "version": "5.3.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "033ec97498cf530cc1be4199264cad568b19be26" + "reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/033ec97498cf530cc1be4199264cad568b19be26", - "reference": "033ec97498cf530cc1be4199264cad568b19be26", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/661f34d0bd3f1a7225ef491a70a020ad23a057a1", + "reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1", "shasum": "" }, "require": { @@ -1821,7 +1821,6 @@ "theseer/tokenizer": "^1.1" }, "require-dev": { - "ext-xdebug": "^2.5", "phpunit/phpunit": "^6.0" }, "suggest": { @@ -1830,7 +1829,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.2.x-dev" + "dev-master": "5.3.x-dev" } }, "autoload": { @@ -1845,7 +1844,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -1856,7 +1855,7 @@ "testing", "xunit" ], - "time": "2017-11-27T09:00:30+00:00" + "time": "2017-12-06T09:29:45+00:00" }, { "name": "phpunit/php-file-iterator", @@ -2005,16 +2004,16 @@ }, { "name": "phpunit/phpunit", - "version": "6.5.2", + "version": "6.5.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "24b708f2fd725bcef1c8153b366043381aa324f2" + "reference": "882e886cc928a0abd3c61282b2a64026237d14a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/24b708f2fd725bcef1c8153b366043381aa324f2", - "reference": "24b708f2fd725bcef1c8153b366043381aa324f2", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/882e886cc928a0abd3c61282b2a64026237d14a4", + "reference": "882e886cc928a0abd3c61282b2a64026237d14a4", "shasum": "" }, "require": { @@ -2028,7 +2027,7 @@ "phar-io/version": "^1.0", "php": "^7.0", "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^5.2.3", + "phpunit/php-code-coverage": "^5.3", "phpunit/php-file-iterator": "^1.4.3", "phpunit/php-text-template": "^1.2.1", "phpunit/php-timer": "^1.0.9", @@ -2085,7 +2084,7 @@ "testing", "xunit" ], - "time": "2017-12-02T05:36:24+00:00" + "time": "2017-12-06T09:42:03+00:00" }, { "name": "phpunit/phpunit-mock-objects", From d3ea76faaf088cc145495e8a0acb16c7abcd490f Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Wed, 6 Dec 2017 13:31:25 +0100 Subject: [PATCH 54/77] We don't need the xdebug workaround anymore (see https://getcomposer.org/doc/articles/troubleshooting.md#xdebug-impact-on-composer) --- Gruntfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 7101e0a..9632e8e 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -54,7 +54,7 @@ module.exports = function (grunt) { }, phpunit: { options: { - bin: 'php -dzend_extension=xdebug.so ./vendor/bin/phpunit', + bin: 'vendor/bin/phpunit', stopOnError: true, stopOnFailure: true, followOutput: true From 29a262562a3b84701cdee74fdfe1fe4408b2f8ad Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Wed, 6 Dec 2017 13:34:12 +0100 Subject: [PATCH 55/77] Update Symfony to 3.4 --- composer.json | 8 +++---- composer.lock | 59 ++++++++++++++++++++++++++++----------------------- 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/composer.json b/composer.json index fa5c08c..b5b307c 100644 --- a/composer.json +++ b/composer.json @@ -7,9 +7,9 @@ "require": { "slim/slim": "~3.9.2", "mathmarques/smarty-view": "~1.1.0", - "symfony/yaml": "~3.3.9", - "symfony/process": "~3.3.9", - "ptachoire/process-builder-chain": "~1.2.0", + "symfony/yaml": "~3.4.1", + "symfony/process": "~3.4.1", + "ptachoire/process-builder-chain": "~1.3.0", "guzzlehttp/guzzle": "~6.3.0", "aura/session": "~2.1.0", "barracudanetworks/archivestream-php": "~1.0.5", @@ -19,7 +19,7 @@ "php-mock/php-mock-mockery": "~1.2.0" }, "require-dev": { - "symfony/var-dumper": "~3.3.9", + "symfony/var-dumper": "~3.4.1", "squizlabs/php_codesniffer": "~3.1.0", "phpunit/phpunit": "~6.5.2", "doctrine/instantiator": "~1.0.0", diff --git a/composer.lock b/composer.lock index 5dda001..e8f96d3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "1ddc68bc8402785971a268a869f50d8c", + "content-hash": "1a9cd462b9581ad2fa7cc5815535a050", "packages": [ { "name": "aura/session", @@ -887,20 +887,23 @@ }, { "name": "ptachoire/process-builder-chain", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/krichprollsch/process-builder-chain.git", - "reference": "465055dbcc3b5ef792a768df935571551de4781a" + "reference": "67e94493dac63429683e43936cee9d36eca28105" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/krichprollsch/process-builder-chain/zipball/465055dbcc3b5ef792a768df935571551de4781a", - "reference": "465055dbcc3b5ef792a768df935571551de4781a", + "url": "https://api.github.com/repos/krichprollsch/process-builder-chain/zipball/67e94493dac63429683e43936cee9d36eca28105", + "reference": "67e94493dac63429683e43936cee9d36eca28105", "shasum": "" }, "require": { - "symfony/process": "~2.5 || ~3.0" + "symfony/process": "~2.5 || ~3.0 || ~4.0" + }, + "require-dev": { + "phpunit/phpunit": "~5.0" }, "type": "library", "autoload": { @@ -919,7 +922,7 @@ } ], "description": "Add ability to chain symfony processes", - "time": "2016-04-10T08:33:20+00:00" + "time": "2017-12-06T12:24:36+00:00" }, { "name": "rinvex/country", @@ -1175,16 +1178,16 @@ }, { "name": "symfony/process", - "version": "v3.3.14", + "version": "v3.4.1", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "a56a3989fb762d7b19a0cf8e7693ee99a6ffb78d" + "reference": "db25e810fd5e124085e3777257d0cf4ae533d0ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/a56a3989fb762d7b19a0cf8e7693ee99a6ffb78d", - "reference": "a56a3989fb762d7b19a0cf8e7693ee99a6ffb78d", + "url": "https://api.github.com/repos/symfony/process/zipball/db25e810fd5e124085e3777257d0cf4ae533d0ea", + "reference": "db25e810fd5e124085e3777257d0cf4ae533d0ea", "shasum": "" }, "require": { @@ -1193,7 +1196,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1220,27 +1223,30 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-11-13T15:31:11+00:00" + "time": "2017-11-22T12:18:49+00:00" }, { "name": "symfony/yaml", - "version": "v3.3.14", + "version": "v3.4.1", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "36353762fdca3a0ecdce4640764efc885df979f6" + "reference": "f6a99b95b338799645fe9f7880d7d4ca1bf79cc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/36353762fdca3a0ecdce4640764efc885df979f6", - "reference": "36353762fdca3a0ecdce4640764efc885df979f6", + "url": "https://api.github.com/repos/symfony/yaml/zipball/f6a99b95b338799645fe9f7880d7d4ca1bf79cc1", + "reference": "f6a99b95b338799645fe9f7880d7d4ca1bf79cc1", "shasum": "" }, "require": { "php": "^5.5.9|>=7.0.8" }, + "conflict": { + "symfony/console": "<3.4" + }, "require-dev": { - "symfony/console": "~2.8|~3.0" + "symfony/console": "~3.4|~4.0" }, "suggest": { "symfony/console": "For validating YAML files using the lint command" @@ -1248,7 +1254,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -1275,7 +1281,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-12-04T14:51:35+00:00" + "time": "2017-12-04T18:15:22+00:00" }, { "name": "zonuexe/http-accept-language", @@ -2855,16 +2861,16 @@ }, { "name": "symfony/var-dumper", - "version": "v3.3.14", + "version": "v3.4.1", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "f193230a7fd5051910de4e8238139921f3a40af8" + "reference": "ec650a975a8e04e0c114d35eab732981243db3a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/f193230a7fd5051910de4e8238139921f3a40af8", - "reference": "f193230a7fd5051910de4e8238139921f3a40af8", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/ec650a975a8e04e0c114d35eab732981243db3a2", + "reference": "ec650a975a8e04e0c114d35eab732981243db3a2", "shasum": "" }, "require": { @@ -2880,12 +2886,13 @@ }, "suggest": { "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", + "ext-intl": "To show region name in time zone dump", "ext-symfony_debug": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -2919,7 +2926,7 @@ "debug", "dump" ], - "time": "2017-11-30T09:28:49+00:00" + "time": "2017-11-30T14:59:23+00:00" }, { "name": "theseer/tokenizer", From 4ae585eef1adae94f3abeda84b7d347bacc0752a Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 9 Dec 2017 22:22:07 +0100 Subject: [PATCH 56/77] Output ffmpeg errors to STDERR (fixes #140) --- classes/VideoDownload.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/VideoDownload.php b/classes/VideoDownload.php index f711341..26ac1f9 100644 --- a/classes/VideoDownload.php +++ b/classes/VideoDownload.php @@ -276,7 +276,7 @@ class VideoDownload $builder = ProcessBuilder::create( [ $this->config->avconv, - '-v', 'quiet', + '-v', 'error', //Vimeo needs a correct user-agent '-user_agent', $this->getProp(null, null, 'dump-user-agent'), '-i', $url, From 959b141282786d4cf46556e2d549e8b4a5281812 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 9 Dec 2017 23:16:48 +0100 Subject: [PATCH 57/77] Add a setting that controls ffmpeg verbosity Don't display ffmpeg errors in tests --- classes/Config.php | 8 ++++++++ classes/VideoDownload.php | 2 +- config/config.example.yml | 3 +++ config/config_test.yml | 1 + config/config_test_windows.yml | 1 + 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/classes/Config.php b/classes/Config.php index 513202a..65dd62d 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -89,6 +89,14 @@ class Config */ public $audioBitrate = 128; + /** + * avconv/ffmpeg logging level. + * Must be one of these: quiet, panic, fatal, error, warning, info, verbose, debug + * + * @var string + */ + public $avconvVerbosity = 'error'; + /** * YAML config file path. * diff --git a/classes/VideoDownload.php b/classes/VideoDownload.php index 26ac1f9..7480d8b 100644 --- a/classes/VideoDownload.php +++ b/classes/VideoDownload.php @@ -276,7 +276,7 @@ class VideoDownload $builder = ProcessBuilder::create( [ $this->config->avconv, - '-v', 'error', + '-v', $this->config->avconvVerbosity, //Vimeo needs a correct user-agent '-user_agent', $this->getProp(null, null, 'dump-user-agent'), '-i', $url, diff --git a/config/config.example.yml b/config/config.example.yml index 2740303..4b25bcd 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -18,6 +18,9 @@ convert: false # Path to your avconv or ffmpeg binary avconv: vendor/bin/ffmpeg +# avconv/ffmpeg logging level. +avconvVerbosity: error + # Path to your rtmpdump binary rtmpdump: vendor/bin/rtmpdump diff --git a/config/config_test.yml b/config/config_test.yml index 8968c0f..99b704b 100644 --- a/config/config_test.yml +++ b/config/config_test.yml @@ -1,2 +1,3 @@ --- convert: false +avconvVerbosity: fatal diff --git a/config/config_test_windows.yml b/config/config_test_windows.yml index 29a7740..78f24df 100644 --- a/config/config_test_windows.yml +++ b/config/config_test_windows.yml @@ -2,6 +2,7 @@ convert: false python: C:\Python36\python.exe avconv: C:\ProgramData\chocolatey\bin\ffmpeg.exe +avconvVerbosity: fatal rtmpdump: C:\ProgramData\chocolatey\bin\rtmpdump youtubedl: C:\Python36\Lib\site-packages\youtube_dl\__main__.py params: From 8c0ed9d9f4d67544fe0337887b4dd51b5bbc0d01 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 9 Dec 2017 23:56:34 +0100 Subject: [PATCH 58/77] Don't set ffmpeg user agent when it is reading from a pipe --- classes/VideoDownload.php | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/classes/VideoDownload.php b/classes/VideoDownload.php index 7480d8b..03ab854 100644 --- a/classes/VideoDownload.php +++ b/classes/VideoDownload.php @@ -273,19 +273,22 @@ class VideoDownload throw(new \Exception('Can\'t find avconv or ffmpeg')); } - $builder = ProcessBuilder::create( - [ - $this->config->avconv, - '-v', $this->config->avconvVerbosity, - //Vimeo needs a correct user-agent - '-user_agent', $this->getProp(null, null, 'dump-user-agent'), - '-i', $url, - '-f', 'mp3', - '-b:a', $this->config->audioBitrate.'k', - '-vn', - 'pipe:1', - ] - ); + $arguments = [ + $this->config->avconv, + '-v', $this->config->avconvVerbosity, + '-i', $url, + '-f', 'mp3', + '-b:a', $this->config->audioBitrate.'k', + '-vn', + 'pipe:1', + ]; + if ($url != '-') { + //Vimeo needs a correct user-agent + $arguments[] = '-user_agent'; + $arguments[] = $this->getProp(null, null, 'dump-user-agent'); + } + + $builder = ProcessBuilder::create($arguments); return $builder->getProcess(); } From 8c9c35b673d7eb8bfd189d4367790f0ea579980c Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 9 Dec 2017 23:57:21 +0100 Subject: [PATCH 59/77] Lint --- classes/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/Config.php b/classes/Config.php index 65dd62d..cc2abf3 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -91,7 +91,7 @@ class Config /** * avconv/ffmpeg logging level. - * Must be one of these: quiet, panic, fatal, error, warning, info, verbose, debug + * Must be one of these: quiet, panic, fatal, error, warning, info, verbose, debug. * * @var string */ From ee6cc165df5b4148c3ca6afef8eeb739655871ff Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 10 Dec 2017 18:35:28 +0100 Subject: [PATCH 60/77] Update youtube-dl to 2017.12.10 --- composer.json | 6 +++--- composer.lock | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index b5b307c..a46dcd9 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "phpunit/phpunit": "~6.5.2", "doctrine/instantiator": "~1.0.0", "ffmpeg/ffmpeg": "dev-release", - "rg3/youtube-dl": "2017.11.06", + "rg3/youtube-dl": "2017.12.10", "rudloff/rtmpdump-bin": "~2.3.0", "heroku/heroku-buildpack-php": "*" }, @@ -40,10 +40,10 @@ "type": "package", "package": { "name": "rg3/youtube-dl", - "version": "2017.11.06", + "version": "2017.12.10", "dist": { "type": "zip", - "url": "https://github.com/rg3/youtube-dl/archive/2017.11.06.zip" + "url": "https://github.com/rg3/youtube-dl/archive/2017.12.10.zip" } } }, diff --git a/composer.lock b/composer.lock index e8f96d3..bfdc36c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "1a9cd462b9581ad2fa7cc5815535a050", + "content-hash": "b636ad920a7d0763b49838f8ee7a4804", "packages": [ { "name": "aura/session", @@ -2153,10 +2153,10 @@ }, { "name": "rg3/youtube-dl", - "version": "2017.11.06", + "version": "2017.12.10", "dist": { "type": "zip", - "url": "https://github.com/rg3/youtube-dl/archive/2017.11.06.zip", + "url": "https://github.com/rg3/youtube-dl/archive/2017.12.10.zip", "reference": null, "shasum": null }, From 25ae2493b746bc8c3d7f657a9d52e6831da430e0 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 10 Dec 2017 18:47:42 +0100 Subject: [PATCH 61/77] Force HLS format for M3U tests --- tests/VideoDownloadTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/VideoDownloadTest.php b/tests/VideoDownloadTest.php index 9bf200d..436b41d 100644 --- a/tests/VideoDownloadTest.php +++ b/tests/VideoDownloadTest.php @@ -226,7 +226,7 @@ class VideoDownloadTest extends TestCase { return [ [ - 'https://twitter.com/verge/status/813055465324056576/video/1', 'best', + 'https://twitter.com/verge/status/813055465324056576/video/1', 'hls-2176', 'The_Verge_-_This_tiny_origami_robot_can_self-fold_and_complete_tasks-813055465324056576', 'mp4', 'video.twimg.com', From 968106758c7a88dc61723646feed5f2a85c9682d Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 10 Dec 2017 21:36:18 +0100 Subject: [PATCH 62/77] phpunit update --- composer.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/composer.lock b/composer.lock index bfdc36c..252a249 100644 --- a/composer.lock +++ b/composer.lock @@ -2010,16 +2010,16 @@ }, { "name": "phpunit/phpunit", - "version": "6.5.3", + "version": "6.5.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "882e886cc928a0abd3c61282b2a64026237d14a4" + "reference": "1b2f933d5775f9237369deaa2d2bfbf9d652be4c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/882e886cc928a0abd3c61282b2a64026237d14a4", - "reference": "882e886cc928a0abd3c61282b2a64026237d14a4", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1b2f933d5775f9237369deaa2d2bfbf9d652be4c", + "reference": "1b2f933d5775f9237369deaa2d2bfbf9d652be4c", "shasum": "" }, "require": { @@ -2037,7 +2037,7 @@ "phpunit/php-file-iterator": "^1.4.3", "phpunit/php-text-template": "^1.2.1", "phpunit/php-timer": "^1.0.9", - "phpunit/phpunit-mock-objects": "^5.0.4", + "phpunit/phpunit-mock-objects": "^5.0.5", "sebastian/comparator": "^2.1", "sebastian/diff": "^2.0", "sebastian/environment": "^3.1", @@ -2090,27 +2090,27 @@ "testing", "xunit" ], - "time": "2017-12-06T09:42:03+00:00" + "time": "2017-12-10T08:06:19+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "5.0.4", + "version": "5.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "16b50f4167e5e85e81ca8a3dd105d0a5fd32009a" + "reference": "283b9f4f670e3a6fd6c4ff95c51a952eb5c75933" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/16b50f4167e5e85e81ca8a3dd105d0a5fd32009a", - "reference": "16b50f4167e5e85e81ca8a3dd105d0a5fd32009a", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/283b9f4f670e3a6fd6c4ff95c51a952eb5c75933", + "reference": "283b9f4f670e3a6fd6c4ff95c51a952eb5c75933", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.5", "php": "^7.0", "phpunit/php-text-template": "^1.2.1", - "sebastian/exporter": "^3.0" + "sebastian/exporter": "^3.1" }, "conflict": { "phpunit/phpunit": "<6.0" @@ -2149,7 +2149,7 @@ "mock", "xunit" ], - "time": "2017-12-02T05:31:19+00:00" + "time": "2017-12-10T08:01:53+00:00" }, { "name": "rg3/youtube-dl", From f218f032fb429ee997cf68a63b10394ebb77bdaa Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 10 Dec 2017 21:38:35 +0100 Subject: [PATCH 63/77] Update grunt-contrib-uglify to 3.2 --- package.json | 2 +- yarn.lock | 30 +++++++++++++++++------------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 231fc31..cbca146 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "dependencies": { "grunt": "~1.0.1", "grunt-contrib-cssmin": "~2.2.1", - "grunt-contrib-uglify": "~3.1.0", + "grunt-contrib-uglify": "~3.2.1", "grunt-potomo": "~3.5.0", "open-sans-fontface": "~1.4.0" }, diff --git a/yarn.lock b/yarn.lock index 3ddb557..699eb1b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -269,9 +269,9 @@ combined-stream@^1.0.5, combined-stream@~1.0.5: dependencies: delayed-stream "~1.0.0" -commander@~2.11.0: - version "2.11.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" +commander@~2.12.1: + version "2.12.2" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.12.2.tgz#0f5946c427ed9ec0d91a46bb9def53e54650e555" compress-commons@^1.2.0: version "1.2.2" @@ -640,13 +640,13 @@ grunt-contrib-cssmin@~2.2.1: clean-css "~4.1.1" maxmin "^2.1.0" -grunt-contrib-uglify@~3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/grunt-contrib-uglify/-/grunt-contrib-uglify-3.1.0.tgz#10d1e4849210ec92bf0b08247e24186354d5e9ee" +grunt-contrib-uglify@~3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/grunt-contrib-uglify/-/grunt-contrib-uglify-3.2.1.tgz#8458943eb6053badff829b6f0c9126b1ea624c4a" dependencies: chalk "^1.0.0" maxmin "^1.1.0" - uglify-js "~3.0.4" + uglify-js "~3.2.0" uri-path "^1.0.0" grunt-contrib-watch@~1.0.0: @@ -1494,10 +1494,14 @@ sntp@2.x.x: dependencies: hoek "4.x.x" -source-map@0.5.x, source-map@~0.5.1: +source-map@0.5.x: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" +source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + spdx-correct@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" @@ -1662,12 +1666,12 @@ typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" -uglify-js@~3.0.4: - version "3.0.28" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.0.28.tgz#96b8495f0272944787b5843a1679aa326640d5f7" +uglify-js@~3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.2.2.tgz#870e4b34ed733d179284f9998efd3293f7fd73f6" dependencies: - commander "~2.11.0" - source-map "~0.5.1" + commander "~2.12.1" + source-map "~0.6.1" underscore.string@~3.2.3: version "3.2.3" From cdc4c003441c8c0d3c652e605bcefce14b2ab8b1 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Fri, 15 Dec 2017 14:47:31 +0100 Subject: [PATCH 64/77] Symfony update --- composer.lock | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/composer.lock b/composer.lock index 252a249..91008ca 100644 --- a/composer.lock +++ b/composer.lock @@ -1178,16 +1178,16 @@ }, { "name": "symfony/process", - "version": "v3.4.1", + "version": "v3.4.2", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "db25e810fd5e124085e3777257d0cf4ae533d0ea" + "reference": "bb3ef65d493a6d57297cad6c560ee04e2a8f5098" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/db25e810fd5e124085e3777257d0cf4ae533d0ea", - "reference": "db25e810fd5e124085e3777257d0cf4ae533d0ea", + "url": "https://api.github.com/repos/symfony/process/zipball/bb3ef65d493a6d57297cad6c560ee04e2a8f5098", + "reference": "bb3ef65d493a6d57297cad6c560ee04e2a8f5098", "shasum": "" }, "require": { @@ -1223,20 +1223,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2017-11-22T12:18:49+00:00" + "time": "2017-12-14T19:40:10+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.1", + "version": "v3.4.2", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "f6a99b95b338799645fe9f7880d7d4ca1bf79cc1" + "reference": "afe0cd38486505c9703707707d91450cfc1bd536" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/f6a99b95b338799645fe9f7880d7d4ca1bf79cc1", - "reference": "f6a99b95b338799645fe9f7880d7d4ca1bf79cc1", + "url": "https://api.github.com/repos/symfony/yaml/zipball/afe0cd38486505c9703707707d91450cfc1bd536", + "reference": "afe0cd38486505c9703707707d91450cfc1bd536", "shasum": "" }, "require": { @@ -1281,7 +1281,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-12-04T18:15:22+00:00" + "time": "2017-12-11T20:38:23+00:00" }, { "name": "zonuexe/http-accept-language", @@ -2861,16 +2861,16 @@ }, { "name": "symfony/var-dumper", - "version": "v3.4.1", + "version": "v3.4.2", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "ec650a975a8e04e0c114d35eab732981243db3a2" + "reference": "757074cf71b952ce9e75b557538948811c2bf006" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/ec650a975a8e04e0c114d35eab732981243db3a2", - "reference": "ec650a975a8e04e0c114d35eab732981243db3a2", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/757074cf71b952ce9e75b557538948811c2bf006", + "reference": "757074cf71b952ce9e75b557538948811c2bf006", "shasum": "" }, "require": { @@ -2926,7 +2926,7 @@ "debug", "dump" ], - "time": "2017-11-30T14:59:23+00:00" + "time": "2017-12-11T22:06:16+00:00" }, { "name": "theseer/tokenizer", From 17df0b63cbd870a5e3b7206a50b63787a154dd29 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Tue, 19 Dec 2017 15:20:52 +0100 Subject: [PATCH 65/77] Document exceptions in VideoDownload --- classes/VideoDownload.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/classes/VideoDownload.php b/classes/VideoDownload.php index 03ab854..bd0c9e7 100644 --- a/classes/VideoDownload.php +++ b/classes/VideoDownload.php @@ -29,6 +29,9 @@ class VideoDownload /** * VideoDownload constructor. + * + * @throws \Exception If youtube-dl is missing + * @throws \Exception If Python is missing */ public function __construct(Config $config = null) { @@ -69,6 +72,10 @@ class VideoDownload * @param string $prop Property * @param string $password Video password * + * @throws PasswordException If the video is protected by a password and no password was specified + * @throws \Exception If the password is wrong + * @throws \Exception If youtube-dl returns an error + * * @return string */ private function getProp($url, $format = null, $prop = 'dump-json', $password = null) @@ -220,6 +227,8 @@ class VideoDownload * * @param object $video Video object returned by youtube-dl * + * @throws \Exception If rtmpdump is missing + * * @return \Symfony\Component\Process\Process Process */ private function getRtmpProcess(\stdClass $video) @@ -265,6 +274,8 @@ class VideoDownload * * @param string $url URL of the video file * + * @throws \Exception If avconv/ffmpeg is missing + * * @return \Symfony\Component\Process\Process Process */ private function getAvconvMp3Process($url) @@ -300,6 +311,9 @@ class VideoDownload * @param string $format Format to use for the video * @param string $password Video password * + * @throws \Exception If your try to convert and M3U8 video + * @throws \Exception If the popen stream was not created correctly + * * @return resource popen stream */ public function getAudioStream($url, $format, $password = null) @@ -333,6 +347,9 @@ class VideoDownload * * @param \stdClass $video Video object returned by getJSON * + * @throws \Exception If avconv/ffmpeg is missing + * @throws \Exception If the popen stream was not created correctly + * * @return resource popen stream */ public function getM3uStream(\stdClass $video) @@ -367,6 +384,8 @@ class VideoDownload * * @param array $urls URLs of the video ($urls[0]) and audio ($urls[1]) files * + * @throws \Exception If the popen stream was not created correctly + * * @return resource popen stream */ public function getRemuxStream(array $urls) @@ -398,6 +417,8 @@ class VideoDownload * * @param \stdClass $video Video object returned by getJSON * + * @throws \Exception If the popen stream was not created correctly + * * @return resource popen stream */ public function getRtmpStream(\stdClass $video) @@ -416,6 +437,8 @@ class VideoDownload * @param object $video Video object returned by youtube-dl * @param string $format Requested format * + * @throws \Exception If the popen stream was not created correctly + * * @return resource */ public function getPlaylistArchiveStream(\stdClass $video, $format) From b74a092700d00094a557aa737e5d270cdb8c19d2 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Wed, 20 Dec 2017 11:21:36 +0100 Subject: [PATCH 66/77] Lint markdown files --- CONTRIBUTING.md | 3 ++- Gruntfile.js | 10 ++++++++-- README.md | 16 +++++++++++----- package.json | 1 + resources/FAQ.md | 26 ++++++++++++++++++-------- yarn.lock | 42 +++++++++++++++++++++++++++++++++++++++++- 6 files changed, 81 insertions(+), 17 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 63ccbed..f5f081a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,4 +10,5 @@ Before opening a new issue, make sure that: ## Translation -If you want to help translating Alltube in your language, you can join our [POEditor project](https://poeditor.com/join/project/GJmE0wN7Xw). +If you want to help translating Alltube in your language, +you can join our [POEditor project](https://poeditor.com/join/project/GJmE0wN7Xw). diff --git a/Gruntfile.js b/Gruntfile.js index 9632e8e..4d20de1 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -111,7 +111,12 @@ module.exports = function (grunt) { css: { src: 'css/*' } - } + }, + markdownlint: { + doc: { + src: ['README.md', 'CONTRIBUTING.md', 'resources/*.md'] + } + } } ); @@ -128,9 +133,10 @@ module.exports = function (grunt) { grunt.loadNpmTasks('grunt-fixpack'); grunt.loadNpmTasks('grunt-potomo'); grunt.loadNpmTasks('grunt-contrib-csslint'); + grunt.loadNpmTasks('grunt-markdownlint'); grunt.registerTask('default', ['cssmin', 'potomo']); - grunt.registerTask('lint', ['csslint', 'fixpack', 'jsonlint', 'phpcs']); + grunt.registerTask('lint', ['csslint', 'fixpack', 'jsonlint', 'markdownlint', 'phpcs']); grunt.registerTask('test', ['phpunit']); grunt.registerTask('doc', ['phpdocumentor']); grunt.registerTask('release', ['default', 'githash', 'compress']); diff --git a/README.md b/README.md index f956f1b..7b68aa3 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,8 @@ You just have to unzip it on your server and it should be ready to use. ### From Git -In order to get AllTube working, you need to use [Yarn](https://yarnpkg.com/) and [Composer](https://getcomposer.org/): +In order to get AllTube working, +you need to use [Yarn](https://yarnpkg.com/) and [Composer](https://getcomposer.org/): ```bash yarn install @@ -23,7 +24,9 @@ composer install This will download all the required dependencies. -(Note that it will download the ffmpeg binary for 64-bits Linux. If you are on another platform, you might want to specify the path to avconv/ffmpeg in your config file.) +(Note that it will download the ffmpeg binary for 64-bits Linux. +If you are on another platform, +you might want to specify the path to avconv/ffmpeg in your config file.) You should also ensure that the *templates_c* folder has the right permissions: @@ -31,7 +34,8 @@ You should also ensure that the *templates_c* folder has the right permissions: chmod 777 templates_c/ ``` -If your web server is Apache, you need to set the `AllowOverride` setting to `All` or `FileInfo`. +If your web server is Apache, +you need to set the `AllowOverride` setting to `All` or `FileInfo`. #### Update @@ -126,7 +130,8 @@ server { ## Other dependencies -You need [avconv](https://libav.org/avconv.html) and [rtmpdump](http://rtmpdump.mplayerhq.hu/) in order to enable conversions. +You need [avconv](https://libav.org/avconv.html) and [rtmpdump](http://rtmpdump.mplayerhq.hu/) +in order to enable conversions. If you don't want to enable conversions, you can disable it in `config.yml`. On Debian-based systems: @@ -135,7 +140,8 @@ On Debian-based systems: sudo apt-get install libav-tools rtmpdump ``` -You also probably need to edit the `avconv` variable in `config.yml` so that it points to your ffmpeg/avconv binary (`/usr/bin/avconv` on Debian/Ubuntu). +You also probably need to edit the `avconv` variable in `config.yml` +so that it points to your ffmpeg/avconv binary (`/usr/bin/avconv` on Debian/Ubuntu). ## Use as library diff --git a/package.json b/package.json index cbca146..0d9aebe 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "grunt-githash": "~0.1.3", "grunt-jslint": "~1.1.15", "grunt-jsonlint": "~1.1.0", + "grunt-markdownlint": "~1.0.43", "grunt-phpcs": "~0.4.0", "grunt-phpdocumentor": "~0.4.1", "grunt-phpunit": "~0.3.6" diff --git a/resources/FAQ.md b/resources/FAQ.md index d09652b..3877d08 100644 --- a/resources/FAQ.md +++ b/resources/FAQ.md @@ -4,7 +4,8 @@ ## My browser plays the video. How do I download it? -Most recent browsers automatically play a video if it is a format they know how to play. +Most recent browsers automatically play a video +if it is a format they know how to play. You can ususally download the video by doing *File > Save to* or *ctrl + S*. ## How do I change config parameters? @@ -56,13 +57,16 @@ Then push the code to Heroku and it should work out of the box. ## Why can't I download videos from some websites (e.g. Dailymotion) -Some websites generate an unique video URL for each IP address. When using Alltube, the URL is generated for our server's IP address and your computer is not allowed to use it. +Some websites generate an unique video URL for each IP address. +When using Alltube, the URL is generated for our server's IP address +and your computer is not allowed to use it. There are two known workarounds: * You can run Alltube locally on your computer. * You can enable streaming videos through the server (see below). - Please note that this can use a lot of resources on the server (which is why we won't enable it on alltubedownload.net). + Please note that this can use a lot of resources on the server + (which is why we won't enable it on alltubedownload.net). ## CSS and JavaScript files are missing @@ -74,7 +78,8 @@ You need to either: ## I get a 404 error on every page except the index -This is probably because your server does not have mod_rewrite or AllowOverride is disabled. +This is probably because your server does not have mod_rewrite +or AllowOverride is disabled. You can work around this by adding this to your `config.yml` file: ```yaml @@ -101,7 +106,8 @@ Alltube can rename videos automatically if you enable streaming (see above). ## I want to download a video that isn't available in my country -If the video is available in the server's country, you can download it if you enable streaming (see above). +If the video is available in the server's country, +you can download it if you enable streaming (see above). ## How do I run the Docker image? @@ -114,7 +120,9 @@ docker run -p 8080:80 rudloff/alltube You should be able to use `heroku local` like this: ```bash -sudo APACHE_LOCK_DIR=. APACHE_PID_FILE=./pid APACHE_RUN_USER=www-data APACHE_RUN_GROUP=www-data APACHE_LOG_DIR=. heroku local +sudo APACHE_LOCK_DIR=. APACHE_PID_FILE=./pid APACHE_RUN_USER=www-data \ + APACHE_RUN_GROUP=www-data APACHE_LOG_DIR=. \ + heroku local ``` You might need to create some symlinks before that: @@ -124,7 +132,8 @@ ln -s /usr/sbin/apache2 /usr/sbin/httpd ln -s /usr/sbin/php-fpm7.0 /usr/sbin/php-fpm ``` -And you probably need to run this in another terminal after `heroku local` has finished launching `php-fpm`: +And you probably need to run this in another terminal +after `heroku local` has finished launching `php-fpm`: ```bash chmod 0667 /tmp/heroku.fcgi.5000.sock @@ -137,4 +146,5 @@ So Alltube will offer you video-only and audio-only formats in the format list. You then need to merge them together with a tool like ffmpeg. -You can also enable the experimental remux mode that will merge the best video and the best audio format on the fly. +You can also enable the experimental remux mode +that will merge the best video and the best audio format on the fly. diff --git a/yarn.lock b/yarn.lock index 699eb1b..b71c9f8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -74,7 +74,7 @@ are-we-there-yet@~1.1.2: delegates "^1.0.0" readable-stream "^2.0.6" -argparse@^1.0.2: +argparse@^1.0.2, argparse@^1.0.7: version "1.0.9" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" dependencies: @@ -403,6 +403,10 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0: dependencies: once "^1.4.0" +entities@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0" + error-ex@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" @@ -717,6 +721,12 @@ grunt-legacy-util@~1.0.0: underscore.string "~3.2.3" which "~1.2.1" +grunt-markdownlint@~1.0.43: + version "1.0.43" + resolved "https://registry.yarnpkg.com/grunt-markdownlint/-/grunt-markdownlint-1.0.43.tgz#afcd3bbab5a5a293bf0050010a7fa9fdea38eca6" + dependencies: + markdownlint "^0.6.1" + grunt-phpcs@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/grunt-phpcs/-/grunt-phpcs-0.4.0.tgz#a08d625fc64465e453b2bd93f810b2a81e94bdaa" @@ -972,6 +982,12 @@ lazystream@^1.0.0: dependencies: readable-stream "^2.0.5" +linkify-it@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-2.0.3.tgz#d94a4648f9b1c179d64fa97291268bdb6ce9434f" + dependencies: + uc.micro "^1.0.1" + livereload-js@^2.2.0: version "2.2.2" resolved "https://registry.yarnpkg.com/livereload-js/-/livereload-js-2.2.2.tgz#6c87257e648ab475bc24ea257457edcc1f8d0bc2" @@ -1009,6 +1025,22 @@ map-obj@^1.0.0, map-obj@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" +markdown-it@8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-8.3.2.tgz#df4b86530d17c3bc9beec3b68d770b92ea17ae96" + dependencies: + argparse "^1.0.7" + entities "~1.1.1" + linkify-it "^2.0.0" + mdurl "^1.0.1" + uc.micro "^1.0.3" + +markdownlint@^0.6.1: + version "0.6.4" + resolved "https://registry.yarnpkg.com/markdownlint/-/markdownlint-0.6.4.tgz#7fa77e0d8c1b1c3ed7978761ce664bd23e7328ef" + dependencies: + markdown-it "8.3.2" + maxmin@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/maxmin/-/maxmin-1.1.0.tgz#71365e84a99dd8f8b3f7d5fde2f00d1e7f73be61" @@ -1027,6 +1059,10 @@ maxmin@^2.1.0: gzip-size "^3.0.0" pretty-bytes "^3.0.0" +mdurl@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" + media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" @@ -1666,6 +1702,10 @@ typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" +uc.micro@^1.0.1, uc.micro@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.3.tgz#7ed50d5e0f9a9fb0a573379259f2a77458d50192" + uglify-js@~3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.2.2.tgz#870e4b34ed733d179284f9998efd3293f7fd73f6" From 2695c27e2738c4691f359b9e07ba44d1f5f6a7ed Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Wed, 20 Dec 2017 11:22:45 +0100 Subject: [PATCH 67/77] Update squizlabs/php_codesniffer to 3.2 --- composer.json | 2 +- composer.lock | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/composer.json b/composer.json index a46dcd9..5164521 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ }, "require-dev": { "symfony/var-dumper": "~3.4.1", - "squizlabs/php_codesniffer": "~3.1.0", + "squizlabs/php_codesniffer": "~3.2.2", "phpunit/phpunit": "~6.5.2", "doctrine/instantiator": "~1.0.0", "ffmpeg/ffmpeg": "dev-release", diff --git a/composer.lock b/composer.lock index 91008ca..c786409 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "b636ad920a7d0763b49838f8ee7a4804", + "content-hash": "81616b497a5848eeb2aafb7b7dcfbed3", "packages": [ { "name": "aura/session", @@ -2010,16 +2010,16 @@ }, { "name": "phpunit/phpunit", - "version": "6.5.4", + "version": "6.5.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "1b2f933d5775f9237369deaa2d2bfbf9d652be4c" + "reference": "83d27937a310f2984fd575686138597147bdc7df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1b2f933d5775f9237369deaa2d2bfbf9d652be4c", - "reference": "1b2f933d5775f9237369deaa2d2bfbf9d652be4c", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/83d27937a310f2984fd575686138597147bdc7df", + "reference": "83d27937a310f2984fd575686138597147bdc7df", "shasum": "" }, "require": { @@ -2090,7 +2090,7 @@ "testing", "xunit" ], - "time": "2017-12-10T08:06:19+00:00" + "time": "2017-12-17T06:31:19+00:00" }, { "name": "phpunit/phpunit-mock-objects", @@ -2751,16 +2751,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.1.1", + "version": "3.2.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "d667e245d5dcd4d7bf80f26f2c947d476b66213e" + "reference": "d7c00c3000ac0ce79c96fcbfef86b49a71158cd1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d667e245d5dcd4d7bf80f26f2c947d476b66213e", - "reference": "d667e245d5dcd4d7bf80f26f2c947d476b66213e", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/d7c00c3000ac0ce79c96fcbfef86b49a71158cd1", + "reference": "d7c00c3000ac0ce79c96fcbfef86b49a71158cd1", "shasum": "" }, "require": { @@ -2798,7 +2798,7 @@ "phpcs", "standards" ], - "time": "2017-10-16T22:40:25+00:00" + "time": "2017-12-19T21:44:46+00:00" }, { "name": "symfony/polyfill-mbstring", From 2e6fb8e7bdf26133c03af1139e266e469452b903 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 23 Dec 2017 13:22:11 +0100 Subject: [PATCH 68/77] Update rudloff/rtmpdump-bin to 2.3.1 --- composer.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/composer.lock b/composer.lock index c786409..2dac004 100644 --- a/composer.lock +++ b/composer.lock @@ -2164,16 +2164,16 @@ }, { "name": "rudloff/rtmpdump-bin", - "version": "2.3", + "version": "2.3.1", "source": { "type": "git", "url": "https://github.com/Rudloff/rtmpdump-bin.git", - "reference": "133cdd80e3bab66593e88a5276158596383afd97" + "reference": "1042538e0a97940c6605c67c26ff48932ba5e61f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Rudloff/rtmpdump-bin/zipball/133cdd80e3bab66593e88a5276158596383afd97", - "reference": "133cdd80e3bab66593e88a5276158596383afd97", + "url": "https://api.github.com/repos/Rudloff/rtmpdump-bin/zipball/1042538e0a97940c6605c67c26ff48932ba5e61f", + "reference": "1042538e0a97940c6605c67c26ff48932ba5e61f", "shasum": "" }, "require-dev": { @@ -2188,7 +2188,7 @@ "GPL-2.0" ], "description": "rtmpdump binary for Linux 64 bit", - "time": "2016-04-12T19:17:32+00:00" + "time": "2017-12-23T12:11:49+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -2237,16 +2237,16 @@ }, { "name": "sebastian/comparator", - "version": "2.1.0", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "1174d9018191e93cb9d719edec01257fc05f8158" + "reference": "b11c729f95109b56a0fe9650c6a63a0fcd8c439f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1174d9018191e93cb9d719edec01257fc05f8158", - "reference": "1174d9018191e93cb9d719edec01257fc05f8158", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/b11c729f95109b56a0fe9650c6a63a0fcd8c439f", + "reference": "b11c729f95109b56a0fe9650c6a63a0fcd8c439f", "shasum": "" }, "require": { @@ -2297,7 +2297,7 @@ "compare", "equality" ], - "time": "2017-11-03T07:16:52+00:00" + "time": "2017-12-22T14:50:35+00:00" }, { "name": "sebastian/diff", From 4c33c309a013ef7a0edb084dc679717fcdd7488c Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 23 Dec 2017 14:17:29 +0100 Subject: [PATCH 69/77] ProcessBuilder is deprecated (fixes #144) --- classes/LocaleManager.php | 5 +-- classes/VideoDownload.php | 95 +++++++++++++++++++-------------------- 2 files changed, 47 insertions(+), 53 deletions(-) diff --git a/classes/LocaleManager.php b/classes/LocaleManager.php index e220674..a841079 100644 --- a/classes/LocaleManager.php +++ b/classes/LocaleManager.php @@ -5,7 +5,7 @@ namespace Alltube; -use Symfony\Component\Process\ProcessBuilder; +use Symfony\Component\Process\Process; /** * Class used to manage locales. @@ -57,8 +57,7 @@ class LocaleManager public function getSupportedLocales() { $return = []; - $builder = new ProcessBuilder(['locale', '-a']); - $process = $builder->getProcess(); + $process = new Process(['locale', '-a']); $process->run(); $installedLocales = explode(PHP_EOL, trim($process->getOutput())); foreach ($this->supportedLocales as $supportedLocale) { diff --git a/classes/VideoDownload.php b/classes/VideoDownload.php index bd0c9e7..f9e1efe 100644 --- a/classes/VideoDownload.php +++ b/classes/VideoDownload.php @@ -6,7 +6,7 @@ namespace Alltube; use Chain\Chain; -use Symfony\Component\Process\ProcessBuilder; +use Symfony\Component\Process\Process; /** * Extract info about videos. @@ -20,13 +20,6 @@ class VideoDownload */ private $config; - /** - * ProcessBuilder instance used to call Python. - * - * @var ProcessBuilder - */ - private $procBuilder; - /** * VideoDownload constructor. * @@ -40,16 +33,27 @@ class VideoDownload } else { $this->config = Config::getInstance(); } - $this->procBuilder = new ProcessBuilder(); if (!is_file($this->config->youtubedl)) { throw new \Exception("Can't find youtube-dl at ".$this->config->youtubedl); } elseif (!$this->checkCommand([$this->config->python, '--version'])) { throw new \Exception("Can't find Python at ".$this->config->python); } - $this->procBuilder->setPrefix( + } + + /** + * Return a youtube-dl process with the specified arguments + * + * @param string[] $arguments Arguments + * + * @return Process + */ + private function getProcess(array $arguments) + { + return new Process( array_merge( [$this->config->python, $this->config->youtubedl], - $this->config->params + $this->config->params, + $arguments ) ); } @@ -80,24 +84,21 @@ class VideoDownload */ private function getProp($url, $format = null, $prop = 'dump-json', $password = null) { - $this->procBuilder->setArguments( - [ - '--'.$prop, - $url, - ] - ); + $arguments = [ + '--'.$prop, + $url + ]; if (isset($format)) { - $this->procBuilder->add('-f '.$format); + $arguments[] = '-f '.$format; } if (isset($password)) { - $this->procBuilder->add('--video-password'); - $this->procBuilder->add($password); + $arguments[] = '--video-password'; + $arguments[] = $password; } + $process = $this->getProcess($arguments); //This is needed by the openload extractor because it runs PhantomJS - $this->procBuilder->setEnv('QT_QPA_PLATFORM', 'offscreen'); - - $process = $this->procBuilder->getProcess(); + $process->setEnv(['QT_QPA_PLATFORM'=>'offscreen']); $process->run(); if (!$process->isSuccessful()) { $errorOutput = trim($process->getErrorOutput()); @@ -196,15 +197,18 @@ class VideoDownload } /** - * Add options to a process builder running rtmp. + * Return arguments used to run rtmp for a specific video. * - * @param ProcessBuilder $builder Process builder - * @param object $video Video object returned by youtube-dl + * @param object $video Video object returned by youtube-dl * - * @return ProcessBuilder + * @return array */ - private function addOptionsToRtmpProcess(ProcessBuilder $builder, $video) + private function getRtmpProcessArguments(\stdClass $video) { + $arguments = [ + $this->config->rtmpdump, + '-q', + ]; foreach ([ 'url' => 'rtmp', 'webpage_url' => 'pageUrl', @@ -214,12 +218,12 @@ class VideoDownload 'app' => 'app', ] as $property => $option) { if (isset($video->{$property})) { - $builder->add('--'.$option); - $builder->add($video->{$property}); + $arguments[] = '--'.$option; + $arguments[] = $video->{$property}; } } - return $builder; + return $arguments; } /** @@ -236,21 +240,15 @@ class VideoDownload if (!$this->checkCommand([$this->config->rtmpdump, '--help'])) { throw(new \Exception('Can\'t find rtmpdump')); } - $builder = new ProcessBuilder( - [ - $this->config->rtmpdump, - '-q', - ] - ); - $builder = $this->addOptionsToRtmpProcess($builder, $video); + $arguments = $this->getRtmpProcessArguments($video); if (isset($video->rtmp_conn)) { foreach ($video->rtmp_conn as $conn) { - $builder->add('--conn'); - $builder->add($conn); + $arguments[] = '--conn'; + $arguments[] = $conn; } } - return $builder->getProcess(); + return new Process($arguments); } /** @@ -262,8 +260,7 @@ class VideoDownload */ private function checkCommand(array $command) { - $builder = ProcessBuilder::create($command); - $process = $builder->getProcess(); + $process = new Process($command); $process->run(); return $process->isSuccessful(); @@ -299,9 +296,7 @@ class VideoDownload $arguments[] = $this->getProp(null, null, 'dump-user-agent'); } - $builder = ProcessBuilder::create($arguments); - - return $builder->getProcess(); + return new Process($arguments); } /** @@ -358,7 +353,7 @@ class VideoDownload throw(new \Exception('Can\'t find avconv or ffmpeg')); } - $procBuilder = ProcessBuilder::create( + $process = new Process( [ $this->config->avconv, '-v', 'quiet', @@ -371,7 +366,7 @@ class VideoDownload ] ); - $stream = popen($procBuilder->getProcess()->getCommandLine(), 'r'); + $stream = popen($process->getCommandLine(), 'r'); if (!is_resource($stream)) { throw new \Exception('Could not open popen stream.'); } @@ -390,7 +385,7 @@ class VideoDownload */ public function getRemuxStream(array $urls) { - $procBuilder = ProcessBuilder::create( + $process = new Process( [ $this->config->avconv, '-v', 'quiet', @@ -404,7 +399,7 @@ class VideoDownload ] ); - $stream = popen($procBuilder->getProcess()->getCommandLine(), 'r'); + $stream = popen($process->getCommandLine(), 'r'); if (!is_resource($stream)) { throw new \Exception('Could not open popen stream.'); } From 7940446af3740b43ef6e8e2fceb7f0a69e019add Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 23 Dec 2017 14:37:29 +0100 Subject: [PATCH 70/77] Lint --- classes/VideoDownload.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/VideoDownload.php b/classes/VideoDownload.php index f9e1efe..8be0d2c 100644 --- a/classes/VideoDownload.php +++ b/classes/VideoDownload.php @@ -41,7 +41,7 @@ class VideoDownload } /** - * Return a youtube-dl process with the specified arguments + * Return a youtube-dl process with the specified arguments. * * @param string[] $arguments Arguments * @@ -86,7 +86,7 @@ class VideoDownload { $arguments = [ '--'.$prop, - $url + $url, ]; if (isset($format)) { $arguments[] = '-f '.$format; @@ -219,7 +219,7 @@ class VideoDownload ] as $property => $option) { if (isset($video->{$property})) { $arguments[] = '--'.$option; - $arguments[] = $video->{$property}; + $arguments[] = $video->{$property}; } } @@ -244,7 +244,7 @@ class VideoDownload if (isset($video->rtmp_conn)) { foreach ($video->rtmp_conn as $conn) { $arguments[] = '--conn'; - $arguments[] = $conn; + $arguments[] = $conn; } } From f8c8935b4c7812a258c6ae2bdc97137cb1c4af6a Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 23 Dec 2017 15:14:43 +0100 Subject: [PATCH 71/77] Use ffmpeg instead of rtmpdump --- .appveyor.yml | 2 +- README.md | 4 +- classes/Config.php | 8 --- classes/VideoDownload.php | 111 ++++++++++++++++----------------- composer.json | 1 - composer.lock | 30 +-------- config/config.example.yml | 3 - config/config_test_windows.yml | 1 - resources/FAQ.md | 1 - tests/ConfigTest.php | 1 - tests/VideoDownloadTest.php | 17 ----- 11 files changed, 57 insertions(+), 122 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index dbcdd30..5445fbd 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -2,7 +2,7 @@ install: - sc config wuauserv start= auto - net start wuauserv - - cinst php composer ffmpeg rtmpdump + - cinst php composer ffmpeg - refreshenv - copy C:\tools\php72\php.ini-development C:\tools\php72\php.ini - echo extension=C:\tools\php72\ext\php_gmp.dll >> C:\tools\php72\php.ini diff --git a/README.md b/README.md index 7b68aa3..1c9a929 100644 --- a/README.md +++ b/README.md @@ -130,14 +130,14 @@ server { ## Other dependencies -You need [avconv](https://libav.org/avconv.html) and [rtmpdump](http://rtmpdump.mplayerhq.hu/) +You need [avconv](https://libav.org/avconv.html) in order to enable conversions. If you don't want to enable conversions, you can disable it in `config.yml`. On Debian-based systems: ```bash -sudo apt-get install libav-tools rtmpdump +sudo apt-get install libav-tools ``` You also probably need to edit the `avconv` variable in `config.yml` diff --git a/classes/Config.php b/classes/Config.php index cc2abf3..e66a77d 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -54,13 +54,6 @@ class Config */ public $avconv = 'vendor/bin/ffmpeg'; - /** - * rtmpdump binary path. - * - * @var string - */ - public $rtmpdump = 'vendor/bin/rtmpdump'; - /** * Disable URL rewriting. * @@ -111,7 +104,6 @@ class Config * * youtubedl: youtube-dl binary path * * python: Python binary path * * avconv: avconv or ffmpeg binary path - * * rtmpdump: rtmpdump binary path * * params: Array of youtube-dl parameters * * convert: Enable conversion? * diff --git a/classes/VideoDownload.php b/classes/VideoDownload.php index 8be0d2c..d9b83a2 100644 --- a/classes/VideoDownload.php +++ b/classes/VideoDownload.php @@ -201,54 +201,32 @@ class VideoDownload * * @param object $video Video object returned by youtube-dl * - * @return array + * @return array Arguments */ - private function getRtmpProcessArguments(\stdClass $video) + private function getRtmpArguments(\stdClass $video) { - $arguments = [ - $this->config->rtmpdump, - '-q', - ]; foreach ([ - 'url' => 'rtmp', - 'webpage_url' => 'pageUrl', - 'player_url' => 'swfVfy', - 'flash_version' => 'flashVer', - 'play_path' => 'playpath', - 'app' => 'app', + 'url' => '-rtmp_tcurl', + 'webpage_url' => '-rtmp_pageurl', + 'player_url' => '-rtmp_swfverify', + 'flash_version' => '-rtmp_flashver', + 'play_path' => '-rtmp_playpath', + 'app' => '-rtmp_app', ] as $property => $option) { if (isset($video->{$property})) { - $arguments[] = '--'.$option; + $arguments[] = $option; $arguments[] = $video->{$property}; } } - return $arguments; - } - - /** - * Get a process that runs rtmp in order to download a video. - * - * @param object $video Video object returned by youtube-dl - * - * @throws \Exception If rtmpdump is missing - * - * @return \Symfony\Component\Process\Process Process - */ - private function getRtmpProcess(\stdClass $video) - { - if (!$this->checkCommand([$this->config->rtmpdump, '--help'])) { - throw(new \Exception('Can\'t find rtmpdump')); - } - $arguments = $this->getRtmpProcessArguments($video); if (isset($video->rtmp_conn)) { foreach ($video->rtmp_conn as $conn) { - $arguments[] = '--conn'; + $arguments[] = '-rtmp_conn'; $arguments[] = $conn; } } - return new Process($arguments); + return $arguments; } /** @@ -269,28 +247,39 @@ class VideoDownload /** * Get a process that runs avconv in order to convert a video to MP3. * - * @param string $url URL of the video file + * @param object $url Video object returned by youtube-dl * * @throws \Exception If avconv/ffmpeg is missing * * @return \Symfony\Component\Process\Process Process */ - private function getAvconvMp3Process($url) + private function getAvconvMp3Process(\stdClass $video) { if (!$this->checkCommand([$this->config->avconv, '-version'])) { throw(new \Exception('Can\'t find avconv or ffmpeg')); } - $arguments = [ - $this->config->avconv, - '-v', $this->config->avconvVerbosity, - '-i', $url, - '-f', 'mp3', - '-b:a', $this->config->audioBitrate.'k', - '-vn', - 'pipe:1', - ]; - if ($url != '-') { + if ($video->protocol == 'rtmp') { + $rtmpArguments = $this->getRtmpArguments($video); + } else { + $rtmpArguments = []; + } + + $arguments = array_merge( + [ + $this->config->avconv, + '-v', $this->config->avconvVerbosity, + ], + $rtmpArguments, + [ + '-i', $video->url, + '-f', 'mp3', + '-b:a', $this->config->audioBitrate.'k', + '-vn', + 'pipe:1', + ] + ); + if ($video->url != '-') { //Vimeo needs a correct user-agent $arguments[] = '-user_agent'; $arguments[] = $this->getProp(null, null, 'dump-user-agent'); @@ -318,17 +307,9 @@ class VideoDownload throw(new \Exception('Conversion of M3U8 files is not supported.')); } - if (parse_url($video->url, PHP_URL_SCHEME) == 'rtmp') { - $process = $this->getRtmpProcess($video); - $chain = new Chain($process); - $chain->pipe($this->getAvconvMp3Process('-')); + $avconvProc = $this->getAvconvMp3Process($video); - $stream = popen($chain->getProcess()->getCommandLine(), 'r'); - } else { - $avconvProc = $this->getAvconvMp3Process($video->url); - - $stream = popen($avconvProc->getCommandLine(), 'r'); - } + $stream = popen($avconvProc->getCommandLine(), 'r'); if (!is_resource($stream)) { throw new \Exception('Could not open popen stream.'); @@ -356,7 +337,7 @@ class VideoDownload $process = new Process( [ $this->config->avconv, - '-v', 'quiet', + '-v', $this->config->avconvVerbosity, '-i', $video->url, '-f', $video->ext, '-c', 'copy', @@ -388,7 +369,7 @@ class VideoDownload $process = new Process( [ $this->config->avconv, - '-v', 'quiet', + '-v', $this->config->avconvVerbosity, '-i', $urls[0], '-i', $urls[1], '-c', 'copy', @@ -418,7 +399,21 @@ class VideoDownload */ public function getRtmpStream(\stdClass $video) { - $stream = popen($this->getRtmpProcess($video)->getCommandLine(), 'r'); + $process = new Process( + array_merge( + [ + $this->config->avconv, + '-v', $this->config->avconvVerbosity, + ], + $this->getRtmpArguments($video), + [ + '-i', $video->url, + '-f', $video->ext, + 'pipe:1', + ] + ) + ); + $stream = popen($process->getCommandLine(), 'r'); if (!is_resource($stream)) { throw new \Exception('Could not open popen stream.'); } diff --git a/composer.json b/composer.json index 5164521..6ac079b 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,6 @@ "doctrine/instantiator": "~1.0.0", "ffmpeg/ffmpeg": "dev-release", "rg3/youtube-dl": "2017.12.10", - "rudloff/rtmpdump-bin": "~2.3.0", "heroku/heroku-buildpack-php": "*" }, "extra": { diff --git a/composer.lock b/composer.lock index 2dac004..a413892 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "81616b497a5848eeb2aafb7b7dcfbed3", + "content-hash": "96a0790e383a8870104483939363bcc0", "packages": [ { "name": "aura/session", @@ -2162,34 +2162,6 @@ }, "type": "library" }, - { - "name": "rudloff/rtmpdump-bin", - "version": "2.3.1", - "source": { - "type": "git", - "url": "https://github.com/Rudloff/rtmpdump-bin.git", - "reference": "1042538e0a97940c6605c67c26ff48932ba5e61f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Rudloff/rtmpdump-bin/zipball/1042538e0a97940c6605c67c26ff48932ba5e61f", - "reference": "1042538e0a97940c6605c67c26ff48932ba5e61f", - "shasum": "" - }, - "require-dev": { - "rtmpdump/rtmpdump": "2.3" - }, - "bin": [ - "rtmpdump" - ], - "type": "library", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0" - ], - "description": "rtmpdump binary for Linux 64 bit", - "time": "2017-12-23T12:11:49+00:00" - }, { "name": "sebastian/code-unit-reverse-lookup", "version": "1.0.1", diff --git a/config/config.example.yml b/config/config.example.yml index 4b25bcd..25d0469 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -21,9 +21,6 @@ avconv: vendor/bin/ffmpeg # avconv/ffmpeg logging level. avconvVerbosity: error -# Path to your rtmpdump binary -rtmpdump: vendor/bin/rtmpdump - # True to disable URL rewriting uglyUrls: false diff --git a/config/config_test_windows.yml b/config/config_test_windows.yml index 78f24df..1098072 100644 --- a/config/config_test_windows.yml +++ b/config/config_test_windows.yml @@ -3,7 +3,6 @@ convert: false python: C:\Python36\python.exe avconv: C:\ProgramData\chocolatey\bin\ffmpeg.exe avconvVerbosity: fatal -rtmpdump: C:\ProgramData\chocolatey\bin\rtmpdump youtubedl: C:\Python36\Lib\site-packages\youtube_dl\__main__.py params: - --no-warnings diff --git a/resources/FAQ.md b/resources/FAQ.md index 3877d08..4aa3a35 100644 --- a/resources/FAQ.md +++ b/resources/FAQ.md @@ -18,7 +18,6 @@ Here are the parameters that you can set: * `params`: an array of parameters to pass to youtube-dl * `convert`: true to enable audio conversion * `avconv`: path to your avconv or ffmpeg binary -* `rtmpdump`: path to your rtmpdump binary * `remux`: enable remux mode (experimental) See [`config.example.yml`](../config/config.example.yml) for default values. diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index 5535109..b9223f6 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -62,7 +62,6 @@ class ConfigTest extends TestCase $this->assertInternalType('string', $config->youtubedl); $this->assertInternalType('string', $config->python); $this->assertInternalType('string', $config->avconv); - $this->assertInternalType('string', $config->rtmpdump); $this->assertInternalType('bool', $config->convert); $this->assertInternalType('bool', $config->uglyUrls); $this->assertInternalType('bool', $config->stream); diff --git a/tests/VideoDownloadTest.php b/tests/VideoDownloadTest.php index 436b41d..b4e6767 100644 --- a/tests/VideoDownloadTest.php +++ b/tests/VideoDownloadTest.php @@ -385,23 +385,6 @@ class VideoDownloadTest extends TestCase $download->getAudioStream($url, $format); } - /** - * Test getAudioStream function without curl or rtmpdump. - * - * @param string $url URL - * @param string $format Format - * - * @return void - * @expectedException Exception - * @dataProvider rtmpUrlProvider - */ - public function testGetAudioStreamRtmpError($url, $format) - { - $this->config->rtmpdump = 'foobar'; - $download = new VideoDownload($this->config); - $download->getAudioStream($url, $format); - } - /** * Test getAudioStream function with a M3U8 file. * From 3b7cc9e64b3b0aef934d6d1afd30927c8ff03dbe Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 23 Dec 2017 15:17:47 +0100 Subject: [PATCH 72/77] We don't need process-builder-chain anymore --- classes/VideoDownload.php | 1 - composer.json | 1 - composer.lock | 41 +-------------------------------------- 3 files changed, 1 insertion(+), 42 deletions(-) diff --git a/classes/VideoDownload.php b/classes/VideoDownload.php index d9b83a2..bc2d4be 100644 --- a/classes/VideoDownload.php +++ b/classes/VideoDownload.php @@ -5,7 +5,6 @@ namespace Alltube; -use Chain\Chain; use Symfony\Component\Process\Process; /** diff --git a/composer.json b/composer.json index 6ac079b..14a4b70 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,6 @@ "mathmarques/smarty-view": "~1.1.0", "symfony/yaml": "~3.4.1", "symfony/process": "~3.4.1", - "ptachoire/process-builder-chain": "~1.3.0", "guzzlehttp/guzzle": "~6.3.0", "aura/session": "~2.1.0", "barracudanetworks/archivestream-php": "~1.0.5", diff --git a/composer.lock b/composer.lock index a413892..62a8662 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "96a0790e383a8870104483939363bcc0", + "content-hash": "c67fcb771d11b4f276bd6d5f24660509", "packages": [ { "name": "aura/session", @@ -885,45 +885,6 @@ ], "time": "2016-08-06T14:39:51+00:00" }, - { - "name": "ptachoire/process-builder-chain", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/krichprollsch/process-builder-chain.git", - "reference": "67e94493dac63429683e43936cee9d36eca28105" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/krichprollsch/process-builder-chain/zipball/67e94493dac63429683e43936cee9d36eca28105", - "reference": "67e94493dac63429683e43936cee9d36eca28105", - "shasum": "" - }, - "require": { - "symfony/process": "~2.5 || ~3.0 || ~4.0" - }, - "require-dev": { - "phpunit/phpunit": "~5.0" - }, - "type": "library", - "autoload": { - "psr-0": { - "Chain": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Pierre Tachoire", - "email": "pierre.tachoire@gmail.com" - } - ], - "description": "Add ability to chain symfony processes", - "time": "2017-12-06T12:24:36+00:00" - }, { "name": "rinvex/country", "version": "v3.1.0", From 0c53a95d302ac26d9b6fe3f4832d2120a2ab49fb Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 23 Dec 2017 16:04:55 +0100 Subject: [PATCH 73/77] Undefined variable --- classes/VideoDownload.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/classes/VideoDownload.php b/classes/VideoDownload.php index bc2d4be..0379eaa 100644 --- a/classes/VideoDownload.php +++ b/classes/VideoDownload.php @@ -204,6 +204,8 @@ class VideoDownload */ private function getRtmpArguments(\stdClass $video) { + $arguments = []; + foreach ([ 'url' => '-rtmp_tcurl', 'webpage_url' => '-rtmp_pageurl', From 6c202e50d429c79b0f22589242673e9433e9201b Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 23 Dec 2017 16:05:14 +0100 Subject: [PATCH 74/77] Force HLS format in testRedirectWithM3uStream --- tests/FrontControllerTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/FrontControllerTest.php b/tests/FrontControllerTest.php index 4962c7f..2390798 100644 --- a/tests/FrontControllerTest.php +++ b/tests/FrontControllerTest.php @@ -410,7 +410,10 @@ class FrontControllerTest extends TestCase $this->config->stream = true; $this->assertRequestIsOk( 'redirect', - ['url' => 'https://twitter.com/verge/status/813055465324056576/video/1'], + [ + 'url' => 'https://twitter.com/verge/status/813055465324056576/video/1', + 'format' => 'hls-2176', + ], $this->config ); } From c53f5c0b31c2315315b371bf35b6fb8531b60511 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 23 Dec 2017 17:41:39 +0100 Subject: [PATCH 75/77] youtube-dl process needs to inherit environment variables (fixes #145) --- classes/VideoDownload.php | 1 + 1 file changed, 1 insertion(+) diff --git a/classes/VideoDownload.php b/classes/VideoDownload.php index 0379eaa..e72789c 100644 --- a/classes/VideoDownload.php +++ b/classes/VideoDownload.php @@ -98,6 +98,7 @@ class VideoDownload $process = $this->getProcess($arguments); //This is needed by the openload extractor because it runs PhantomJS $process->setEnv(['QT_QPA_PLATFORM'=>'offscreen']); + $process->inheritEnvironmentVariables(); $process->run(); if (!$process->isSuccessful()) { $errorOutput = trim($process->getErrorOutput()); From a72266a19d4977810d014c17cc4fff2b0f9141e7 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 23 Dec 2017 19:22:50 +0100 Subject: [PATCH 76/77] Use a specific ffmpeg version --- composer.json | 6 +++--- composer.lock | 10 ++++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 14a4b70..a0cefd0 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "squizlabs/php_codesniffer": "~3.2.2", "phpunit/phpunit": "~6.5.2", "doctrine/instantiator": "~1.0.0", - "ffmpeg/ffmpeg": "dev-release", + "ffmpeg/ffmpeg": "3.4.1", "rg3/youtube-dl": "2017.12.10", "heroku/heroku-buildpack-php": "*" }, @@ -49,9 +49,9 @@ "type": "package", "package": { "name": "ffmpeg/ffmpeg", - "version": "dev-release", + "version": "3.4.1", "dist": { - "url": "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz", + "url": "https://johnvansickle.com/ffmpeg/releases/ffmpeg-3.4.1-64bit-static.tar.xz", "type": "xz" }, "bin": [ diff --git a/composer.lock b/composer.lock index 62a8662..a59306b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "c67fcb771d11b4f276bd6d5f24660509", + "content-hash": "f9b0a5cf05f0e39a11f132701b9a95b4", "packages": [ { "name": "aura/session", @@ -1343,10 +1343,10 @@ }, { "name": "ffmpeg/ffmpeg", - "version": "dev-release", + "version": "3.4.1", "dist": { "type": "xz", - "url": "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz", + "url": "https://johnvansickle.com/ffmpeg/releases/ffmpeg-3.4.1-64bit-static.tar.xz", "reference": null, "shasum": null }, @@ -2954,9 +2954,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "ffmpeg/ffmpeg": 20 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": [], From 49b139d5eb7f65066acdef01642f0de276338115 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 23 Dec 2017 19:30:21 +0100 Subject: [PATCH 77/77] 0.11.0 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0d9aebe..a5491a6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "alltube", "description": "HTML GUI for youtube-dl", - "version": "0.10.2", + "version": "0.11.0", "author": "Pierre Rudloff", "bugs": "https://github.com/Rudloff/alltube/issues", "dependencies": {