From d127964eff5b78b2374aed25ef15651dbdbff466 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Wed, 1 Jul 2020 22:52:22 +0200 Subject: [PATCH 01/43] Simplify PSR-4 autoload --- .../Controller}/BaseController.php | 0 .../Controller}/DownloadController.php | 0 .../Controller}/FrontController.php | 0 .../Controller}/JsonController.php | 0 .../ConfigException.php | 0 .../ConvertedPlaylistArchiveStream.php | 0 .../PlaylistArchiveStream.php | 0 .../YoutubeChunkStream.php | 0 classes/{streams => Stream}/YoutubeStream.php | 0 composer.json | 5 +- i18n/template.pot | 159 +++++++++--------- phpunit.xml | 1 - 12 files changed, 81 insertions(+), 84 deletions(-) rename {controllers => classes/Controller}/BaseController.php (100%) rename {controllers => classes/Controller}/DownloadController.php (100%) rename {controllers => classes/Controller}/FrontController.php (100%) rename {controllers => classes/Controller}/JsonController.php (100%) rename classes/{exceptions => Exception}/ConfigException.php (100%) rename classes/{streams => Stream}/ConvertedPlaylistArchiveStream.php (100%) rename classes/{streams => Stream}/PlaylistArchiveStream.php (100%) rename classes/{streams => Stream}/YoutubeChunkStream.php (100%) rename classes/{streams => Stream}/YoutubeStream.php (100%) diff --git a/controllers/BaseController.php b/classes/Controller/BaseController.php similarity index 100% rename from controllers/BaseController.php rename to classes/Controller/BaseController.php diff --git a/controllers/DownloadController.php b/classes/Controller/DownloadController.php similarity index 100% rename from controllers/DownloadController.php rename to classes/Controller/DownloadController.php diff --git a/controllers/FrontController.php b/classes/Controller/FrontController.php similarity index 100% rename from controllers/FrontController.php rename to classes/Controller/FrontController.php diff --git a/controllers/JsonController.php b/classes/Controller/JsonController.php similarity index 100% rename from controllers/JsonController.php rename to classes/Controller/JsonController.php diff --git a/classes/exceptions/ConfigException.php b/classes/Exception/ConfigException.php similarity index 100% rename from classes/exceptions/ConfigException.php rename to classes/Exception/ConfigException.php diff --git a/classes/streams/ConvertedPlaylistArchiveStream.php b/classes/Stream/ConvertedPlaylistArchiveStream.php similarity index 100% rename from classes/streams/ConvertedPlaylistArchiveStream.php rename to classes/Stream/ConvertedPlaylistArchiveStream.php diff --git a/classes/streams/PlaylistArchiveStream.php b/classes/Stream/PlaylistArchiveStream.php similarity index 100% rename from classes/streams/PlaylistArchiveStream.php rename to classes/Stream/PlaylistArchiveStream.php diff --git a/classes/streams/YoutubeChunkStream.php b/classes/Stream/YoutubeChunkStream.php similarity index 100% rename from classes/streams/YoutubeChunkStream.php rename to classes/Stream/YoutubeChunkStream.php diff --git a/classes/streams/YoutubeStream.php b/classes/Stream/YoutubeStream.php similarity index 100% rename from classes/streams/YoutubeStream.php rename to classes/Stream/YoutubeStream.php diff --git a/composer.json b/composer.json index df69396..617dd1e 100644 --- a/composer.json +++ b/composer.json @@ -67,9 +67,6 @@ "autoload": { "psr-4": { "Alltube\\": "classes/", - "Alltube\\Stream\\": "classes/streams/", - "Alltube\\Exception\\": "classes/exceptions/", - "Alltube\\Controller\\": "controllers/", "Alltube\\Test\\": "tests/" } }, @@ -79,7 +76,7 @@ "release": "robo release --ansi", "update-locales": [ "tsmarty2c.php templates > i18n/template.pot", - "xgettext --omit-header -kt -j -o i18n/template.pot classes/*.php classes/*/*.php controllers/*" + "xgettext --omit-header -kt -j -o i18n/template.pot classes/*.php classes/*/*.php" ], "youtube-dl": "vendor/ytdl-org/youtube-dl/youtube_dl/__main__.py" }, diff --git a/i18n/template.pot b/i18n/template.pot index ce9d383..48bfa8c 100644 --- a/i18n/template.pot +++ b/i18n/template.pot @@ -1,6 +1,27 @@ msgid "" msgstr "Content-Type: text/plain; charset=UTF-8\n" +#: templates/playlist.tpl:12 +msgid "Videos extracted from @title:" +msgstr "" + +#: templates/playlist.tpl:38 templates/password.tpl:11 templates/index.tpl:19 +#: templates/info.tpl:101 +msgid "Download" +msgstr "" + +#: templates/playlist.tpl:39 +msgid "More options" +msgstr "" + +#: templates/inc/header.tpl:4 +msgid "Switch language" +msgstr "" + +#: templates/inc/header.tpl:8 +msgid "Set language" +msgstr "" + #: templates/inc/footer.tpl:8 msgid "Code by @dev" msgstr "" @@ -25,12 +46,44 @@ msgstr "" msgid "Donate" msgstr "" -#: templates/inc/header.tpl:4 -msgid "Switch language" +#: templates/password.tpl:5 +msgid "This video is protected" msgstr "" -#: templates/inc/header.tpl:8 -msgid "Set language" +#: templates/password.tpl:6 +msgid "You need a password in order to download this video." +msgstr "" + +#: templates/password.tpl:8 +msgid "Video password" +msgstr "" + +#: templates/index.tpl:8 +msgid "Copy here the URL of your video (Youtube, Dailymotion, etc.)" +msgstr "" + +#: templates/index.tpl:25 +msgid "Audio only (MP3)" +msgstr "" + +#: templates/index.tpl:28 +msgid "From" +msgstr "" + +#: templates/index.tpl:31 +msgid "to" +msgstr "" + +#: templates/index.tpl:39 +msgid "See all supported websites" +msgstr "" + +#: templates/index.tpl:41 +msgid "Drag this to your bookmarks bar:" +msgstr "" + +#: templates/index.tpl:43 +msgid "Bookmarklet" msgstr "" #: templates/info.tpl:11 @@ -81,23 +134,6 @@ msgstr "" msgid "kbit/s audio" msgstr "" -#: templates/info.tpl:101 templates/playlist.tpl:38 templates/password.tpl:11 -#: templates/index.tpl:19 -msgid "Download" -msgstr "" - -#: templates/playlist.tpl:12 -msgid "Videos extracted from @title:" -msgstr "" - -#: templates/playlist.tpl:39 -msgid "More options" -msgstr "" - -#: templates/extractors.tpl:4 controllers/FrontController.php:109 -msgid "Supported websites" -msgstr "" - #: templates/error.tpl:5 msgid "An error occurred" msgstr "" @@ -106,106 +142,71 @@ msgstr "" msgid "Please check the URL of your video." msgstr "" -#: templates/password.tpl:5 -msgid "This video is protected" -msgstr "" - -#: templates/password.tpl:6 -msgid "You need a password in order to download this video." -msgstr "" - -#: templates/password.tpl:8 -msgid "Video password" -msgstr "" - -#: templates/index.tpl:8 -msgid "Copy here the URL of your video (Youtube, Dailymotion, etc.)" -msgstr "" - -#: templates/index.tpl:25 -msgid "Audio only (MP3)" -msgstr "" - -#: templates/index.tpl:28 -msgid "From" -msgstr "" - -#: templates/index.tpl:31 -msgid "to" -msgstr "" - -#: templates/index.tpl:39 -msgid "See all supported websites" -msgstr "" - -#: templates/index.tpl:41 -msgid "Drag this to your bookmarks bar:" -msgstr "" - -#: templates/index.tpl:43 -msgid "Bookmarklet" -msgstr "" - -#: classes/Config.php:156 -msgid "Best" -msgstr "" - -#: classes/Config.php:157 -msgid "Remux best video with best audio" +#: templates/extractors.tpl:4 classes/Controller/FrontController.php:109 +msgid "Supported websites" msgstr "" #: classes/Config.php:158 +msgid "Best" +msgstr "" + +#: classes/Config.php:159 +msgid "Remux best video with best audio" +msgstr "" + +#: classes/Config.php:160 msgid "Worst" msgstr "" -#: controllers/DownloadController.php:63 controllers/FrontController.php:164 +#: classes/Controller/DownloadController.php:63 +#: classes/Controller/FrontController.php:164 msgid "Wrong password" msgstr "" -#: controllers/DownloadController.php:68 +#: classes/Controller/DownloadController.php:68 msgid "Conversion of playlists is not supported." msgstr "" -#: controllers/DownloadController.php:75 +#: classes/Controller/DownloadController.php:75 msgid "Conversion of M3U8 files is not supported." msgstr "" -#: controllers/DownloadController.php:81 +#: classes/Controller/DownloadController.php:81 msgid "Conversion of DASH segments is not supported." msgstr "" -#: controllers/FrontController.php:63 +#: classes/Controller/FrontController.php:63 msgid "" "Easily download videos from Youtube, Dailymotion, Vimeo and other websites." msgstr "" -#: controllers/FrontController.php:110 +#: classes/Controller/FrontController.php:110 msgid "" "List of all supported websites from which Alltube Download can extract video " "or audio files" msgstr "" -#: controllers/FrontController.php:136 +#: classes/Controller/FrontController.php:136 msgid "Password prompt" msgstr "" -#: controllers/FrontController.php:138 +#: classes/Controller/FrontController.php:138 msgid "" "You need a password in order to download this video with Alltube Download" msgstr "" -#: controllers/FrontController.php:172 +#: classes/Controller/FrontController.php:172 msgid "Video download" msgstr "" -#: controllers/FrontController.php:174 +#: classes/Controller/FrontController.php:174 msgid "Download video from @extractor" msgstr "" -#: controllers/FrontController.php:180 +#: classes/Controller/FrontController.php:180 msgid "Download @title from @extractor" msgstr "" -#: controllers/FrontController.php:253 +#: classes/Controller/FrontController.php:253 msgid "Error" msgstr "" diff --git a/phpunit.xml b/phpunit.xml index dfdb3ad..9080073 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -3,7 +3,6 @@ classes/ - controllers/ From 7ecfe8cb87defaa5e0ae3178a11271e79fa388db Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Wed, 1 Jul 2020 22:58:26 +0200 Subject: [PATCH 02/43] Use autoload-dev for test classes (fixes #293) --- composer.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 617dd1e..11973fe 100644 --- a/composer.json +++ b/composer.json @@ -66,7 +66,11 @@ ], "autoload": { "psr-4": { - "Alltube\\": "classes/", + "Alltube\\": "classes/" + } + }, + "autoload-dev": { + "psr-4": { "Alltube\\Test\\": "tests/" } }, From 281acf30686acb7ec17d66dac2b8d6c6fa7b7ef4 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Wed, 1 Jul 2020 23:21:13 +0200 Subject: [PATCH 03/43] Don't exclude RoboFile.php from grumphp scans (closes #294) --- RoboFile.php | 46 --------------- .../Robo/Plugin/Commands/ReleaseCommand.php | 59 +++++++++++++++++++ grumphp.yml | 4 -- 3 files changed, 59 insertions(+), 50 deletions(-) delete mode 100644 RoboFile.php create mode 100644 classes/Robo/Plugin/Commands/ReleaseCommand.php diff --git a/RoboFile.php b/RoboFile.php deleted file mode 100644 index 53f97fd..0000000 --- a/RoboFile.php +++ /dev/null @@ -1,46 +0,0 @@ -stopOnFail(); - - $result = $this->taskExec('git') - ->arg('describe') - ->run(); - $result->provideOutputdata(); - - $tmpDir = $this->_tmpDir(); - - $filename = 'alltube-' . trim($result->getOutputData()) . '.zip'; - - $this->taskFilesystemStack() - ->remove($filename) - ->run(); - - $this->taskGitStack() - ->cloneRepo(__DIR__, $tmpDir) - ->run(); - - $this->taskComposerInstall() - ->dir($tmpDir) - ->optimizeAutoloader() - ->noDev() - ->run(); - - $this->taskPack($filename) - ->addDir('alltube', $tmpDir) - ->run(); - } -} diff --git a/classes/Robo/Plugin/Commands/ReleaseCommand.php b/classes/Robo/Plugin/Commands/ReleaseCommand.php new file mode 100644 index 0000000..869b44a --- /dev/null +++ b/classes/Robo/Plugin/Commands/ReleaseCommand.php @@ -0,0 +1,59 @@ +stopOnFail(); + + /** @var Exec $gitTask */ + $gitTask = $this->taskExec('git'); + $result = $gitTask + ->arg('describe') + ->run(); + $result->provideOutputdata(); + + $tmpDir = $this->_tmpDir(); + + $filename = 'alltube-' . trim((string)$result->getOutputData()) . '.zip'; + + /** @var FilesystemStack $rmTask */ + $rmTask = $this->taskFilesystemStack(); + $rmTask->remove($filename) + ->run(); + + /** @var GitStack $gitTask */ + $gitTask = $this->taskGitStack(); + $gitTask->cloneRepo(__DIR__ . '/../../../../', $tmpDir) + ->run(); + + /** @var Install $composerTask */ + $composerTask = $this->taskComposerInstall(); + $composerTask->dir($tmpDir) + ->optimizeAutoloader() + ->noDev() + ->run(); + + /** @var Pack $packTask */ + $packTask = $this->taskPack($filename); + $packTask->addDir('alltube', $tmpDir) + ->run(); + } +} diff --git a/grumphp.yml b/grumphp.yml index 8454537..df983e1 100644 --- a/grumphp.yml +++ b/grumphp.yml @@ -8,9 +8,5 @@ parameters: composer: ~ phpcs: standard: PSR12 - ignore_patterns: - - RoboFile.php phpstan: level: max - ignore_patterns: - - RoboFile.php From 39f66d4e7ef0e56b1235ef61aa0da773209ddf3a Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 5 Jul 2020 02:19:09 +0200 Subject: [PATCH 04/43] security-advisories update --- composer.lock | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index 44749d8..426bf11 100644 --- a/composer.lock +++ b/composer.lock @@ -4301,12 +4301,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "6d2e5ab854782830911ddd33b7d4649b9f18c10f" + "reference": "57353ec1a34527a2dbbd3c0fb9418ffc008c6f60" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/6d2e5ab854782830911ddd33b7d4649b9f18c10f", - "reference": "6d2e5ab854782830911ddd33b7d4649b9f18c10f", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/57353ec1a34527a2dbbd3c0fb9418ffc008c6f60", + "reference": "57353ec1a34527a2dbbd3c0fb9418ffc008c6f60", "shasum": "" }, "conflict": { @@ -4400,8 +4400,9 @@ "magento/product-community-edition": ">=2,<2.2.10|>=2.3,<2.3.2-p.2", "monolog/monolog": ">=1.8,<1.12", "namshi/jose": "<2.2", + "nystudio107/craft-seomatic": "<3.3", "nzo/url-encryptor-bundle": ">=4,<4.3.2|>=5,<5.0.1", - "october/october": ">=1.0.319,<1.0.466", + "october/october": ">=1.0.319,<1.0.467", "onelogin/php-saml": "<2.10.4", "oneup/uploader-bundle": "<1.9.3|>=2,<2.1.5", "openid/php-openid": "<2.3", @@ -4568,7 +4569,7 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2020-06-19T13:23:43+00:00" + "time": "2020-07-03T16:50:03+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", From 9d6389b1a704a5ee4eca088932f5bf2db5b344bb Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 5 Jul 2020 03:17:45 +0200 Subject: [PATCH 05/43] Remove obsolete locked dependencies --- composer.lock | 96 --------------------------------------------------- 1 file changed, 96 deletions(-) diff --git a/composer.lock b/composer.lock index 426bf11..70b970e 100644 --- a/composer.lock +++ b/composer.lock @@ -3142,57 +3142,6 @@ ], "time": "2018-09-18T10:22:16+00:00" }, - { - "name": "nikic/php-parser", - "version": "v3.1.5", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", - "reference": "bb87e28e7d7b8d9a7fda231d37457c9210faf6ce", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.5" - }, - "require-dev": { - "phpunit/phpunit": "~4.0|~5.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "time": "2018-02-28T20:30:58+00:00" - }, { "name": "phar-io/manifest", "version": "1.0.3", @@ -3780,51 +3729,6 @@ ], "time": "2019-10-03T11:07:50+00:00" }, - { - "name": "phpstan/phpdoc-parser", - "version": "0.2", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "02f909f134fe06f0cd4790d8627ee24efbe84d6a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/02f909f134fe06f0cd4790d8627ee24efbe84d6a", - "reference": "02f909f134fe06f0cd4790d8627ee24efbe84d6a", - "shasum": "" - }, - "require": { - "php": "~7.0" - }, - "require-dev": { - "consistence/coding-standard": "^2.0.0", - "jakub-onderka/php-parallel-lint": "^0.9.2", - "phing/phing": "^2.16.0", - "phpstan/phpstan": "^0.9", - "phpunit/phpunit": "^6.3", - "slevomat/coding-standard": "^3.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.1-dev" - } - }, - "autoload": { - "psr-4": { - "PHPStan\\PhpDocParser\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHPDoc parser with support for nullable, intersection and generic types", - "time": "2018-01-13T18:19:41+00:00" - }, { "name": "phpstan/phpstan", "version": "0.12.25", From 32f0a5012ca9a112dd981b9aeec6195d667f1868 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 5 Jul 2020 03:23:14 +0200 Subject: [PATCH 06/43] Use security-checker instead of security-advisories So it can be checked with grumphp --- composer.json | 2 +- composer.lock | 588 ++++++++++++++++++++++++++------------------------ grumphp.yml | 1 + 3 files changed, 310 insertions(+), 281 deletions(-) diff --git a/composer.json b/composer.json index 11973fe..32d2988 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "phpro/grumphp": "^0.18.0", "phpstan/phpstan": "^0.12.25", "phpunit/phpunit": "^8.4", - "roave/security-advisories": "dev-master", + "sensiolabs/security-checker": "^6.0", "smarty-gettext/smarty-gettext": "^1.6", "squizlabs/php_codesniffer": "^3.5", "symfony/error-handler": "^5.0", diff --git a/composer.lock b/composer.lock index 70b970e..c10163e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3c17df3876a2c769f866f845e4491763", + "content-hash": "d9125c0cc7c3d9c1074b8b30445eaad5", "packages": [ { "name": "aura/session", @@ -4199,282 +4199,6 @@ ], "time": "2020-03-23T09:12:05+00:00" }, - { - "name": "roave/security-advisories", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "57353ec1a34527a2dbbd3c0fb9418ffc008c6f60" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/57353ec1a34527a2dbbd3c0fb9418ffc008c6f60", - "reference": "57353ec1a34527a2dbbd3c0fb9418ffc008c6f60", - "shasum": "" - }, - "conflict": { - "3f/pygmentize": "<1.2", - "adodb/adodb-php": "<5.20.12", - "alterphp/easyadmin-extension-bundle": ">=1.2,<1.2.11|>=1.3,<1.3.1", - "amphp/artax": "<1.0.6|>=2,<2.0.6", - "amphp/http": "<1.0.1", - "amphp/http-client": ">=4,<4.4", - "api-platform/core": ">=2.2,<2.2.10|>=2.3,<2.3.6", - "asymmetricrypt/asymmetricrypt": ">=0,<9.9.99", - "aws/aws-sdk-php": ">=3,<3.2.1", - "bagisto/bagisto": "<0.1.5", - "barrelstrength/sprout-base-email": "<1.2.7", - "barrelstrength/sprout-forms": "<3.9", - "bolt/bolt": "<3.7.1", - "brightlocal/phpwhois": "<=4.2.5", - "buddypress/buddypress": "<5.1.2", - "bugsnag/bugsnag-laravel": ">=2,<2.0.2", - "cakephp/cakephp": ">=1.3,<1.3.18|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=2.7,<2.7.6|>=3,<3.5.18|>=3.6,<3.6.15|>=3.7,<3.7.7", - "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4", - "cartalyst/sentry": "<=2.1.6", - "centreon/centreon": "<18.10.8|>=19,<19.4.5", - "cesnet/simplesamlphp-module-proxystatistics": "<3.1", - "codeigniter/framework": "<=3.0.6", - "composer/composer": "<=1-alpha.11", - "contao-components/mediaelement": ">=2.14.2,<2.21.1", - "contao/core": ">=2,<3.5.39", - "contao/core-bundle": ">=4,<4.4.46|>=4.5,<4.8.6", - "contao/listing-bundle": ">=4,<4.4.8", - "datadog/dd-trace": ">=0.30,<0.30.2", - "david-garcia/phpwhois": "<=4.3.1", - "doctrine/annotations": ">=1,<1.2.7", - "doctrine/cache": ">=1,<1.3.2|>=1.4,<1.4.2", - "doctrine/common": ">=2,<2.4.3|>=2.5,<2.5.1", - "doctrine/dbal": ">=2,<2.0.8|>=2.1,<2.1.2", - "doctrine/doctrine-bundle": "<1.5.2", - "doctrine/doctrine-module": "<=0.7.1", - "doctrine/mongodb-odm": ">=1,<1.0.2", - "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", - "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", - "dolibarr/dolibarr": "<11.0.4", - "dompdf/dompdf": ">=0.6,<0.6.2", - "drupal/core": ">=7,<7.72|>=8,<8.8.8|>=8.9,<8.9.1|>=9,<9.0.1", - "drupal/drupal": ">=7,<7.72|>=8,<8.8.8|>=8.9,<8.9.1|>=9,<9.0.1", - "endroid/qr-code-bundle": "<3.4.2", - "enshrined/svg-sanitize": "<0.13.1", - "erusev/parsedown": "<1.7.2", - "ezsystems/demobundle": ">=5.4,<5.4.6.1", - "ezsystems/ezdemo-ls-extension": ">=5.4,<5.4.2.1", - "ezsystems/ezfind-ls": ">=5.3,<5.3.6.1|>=5.4,<5.4.11.1|>=2017.12,<2017.12.0.1", - "ezsystems/ezplatform": ">=1.7,<1.7.9.1|>=1.13,<1.13.5.1|>=2.5,<2.5.4", - "ezsystems/ezplatform-admin-ui": ">=1.3,<1.3.5|>=1.4,<1.4.6", - "ezsystems/ezplatform-admin-ui-assets": ">=4,<4.2", - "ezsystems/ezplatform-kernel": ">=1,<1.0.2.1", - "ezsystems/ezplatform-user": ">=1,<1.0.1", - "ezsystems/ezpublish-kernel": ">=5.3,<5.3.12.1|>=5.4,<5.4.14.2|>=6,<6.7.9.1|>=6.8,<6.13.6.3|>=7,<7.2.4.1|>=7.3,<7.3.2.1|>=7.5,<7.5.7.1", - "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.6|>=5.4,<5.4.14.1|>=2011,<2017.12.7.2|>=2018.6,<2018.6.1.4|>=2018.9,<2018.9.1.3|>=2019.3,<2019.3.4.2", - "ezsystems/repository-forms": ">=2.3,<2.3.2.1", - "ezyang/htmlpurifier": "<4.1.1", - "firebase/php-jwt": "<2", - "fooman/tcpdf": "<6.2.22", - "fossar/tcpdf-parser": "<6.2.22", - "friendsofsymfony/oauth2-php": "<1.3", - "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2", - "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", - "fuel/core": "<1.8.1", - "getgrav/grav": "<1.7-beta.8", - "gree/jose": "<=2.2", - "gregwar/rst": "<1.0.3", - "guzzlehttp/guzzle": ">=4-rc.2,<4.2.4|>=5,<5.3.1|>=6,<6.2.1", - "illuminate/auth": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.10", - "illuminate/cookie": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30", - "illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29", - "illuminate/encryption": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", - "illuminate/view": ">=7,<7.1.2", - "ivankristianto/phpwhois": "<=4.3", - "james-heinrich/getid3": "<1.9.9", - "joomla/session": "<1.3.1", - "jsmitty12/phpwhois": "<5.1", - "kazist/phpwhois": "<=4.2.6", - "kreait/firebase-php": ">=3.2,<3.8.1", - "la-haute-societe/tcpdf": "<6.2.22", - "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30|>=7,<7.1.2", - "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", - "league/commonmark": "<0.18.3", - "librenms/librenms": "<1.53", - "magento/community-edition": ">=2,<2.2.10|>=2.3,<2.3.3", - "magento/magento1ce": "<1.9.4.3", - "magento/magento1ee": ">=1,<1.14.4.3", - "magento/product-community-edition": ">=2,<2.2.10|>=2.3,<2.3.2-p.2", - "monolog/monolog": ">=1.8,<1.12", - "namshi/jose": "<2.2", - "nystudio107/craft-seomatic": "<3.3", - "nzo/url-encryptor-bundle": ">=4,<4.3.2|>=5,<5.0.1", - "october/october": ">=1.0.319,<1.0.467", - "onelogin/php-saml": "<2.10.4", - "oneup/uploader-bundle": "<1.9.3|>=2,<2.1.5", - "openid/php-openid": "<2.3", - "oro/crm": ">=1.7,<1.7.4", - "oro/platform": ">=1.7,<1.7.4", - "padraic/humbug_get_contents": "<1.1.2", - "pagarme/pagarme-php": ">=0,<3", - "paragonie/random_compat": "<2", - "paypal/merchant-sdk-php": "<3.12", - "pear/archive_tar": "<1.4.4", - "phpfastcache/phpfastcache": ">=5,<5.0.13", - "phpmailer/phpmailer": "<6.1.6", - "phpmussel/phpmussel": ">=1,<1.6", - "phpmyadmin/phpmyadmin": "<4.9.2", - "phpoffice/phpexcel": "<1.8.2", - "phpoffice/phpspreadsheet": "<1.8", - "phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3", - "phpwhois/phpwhois": "<=4.2.5", - "phpxmlrpc/extras": "<0.6.1", - "pimcore/pimcore": "<6.3", - "prestashop/autoupgrade": ">=4,<4.10.1", - "prestashop/gamification": "<2.3.2", - "prestashop/ps_facetedsearch": "<3.4.1", - "privatebin/privatebin": "<1.2.2|>=1.3,<1.3.2", - "propel/propel": ">=2-alpha.1,<=2-alpha.7", - "propel/propel1": ">=1,<=1.7.1", - "pusher/pusher-php-server": "<2.2.1", - "rainlab/debugbar-plugin": "<3.1", - "robrichards/xmlseclibs": "<3.0.4", - "sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9", - "scheb/two-factor-bundle": ">=0,<3.26|>=4,<4.11", - "sensiolabs/connect": "<4.2.3", - "serluck/phpwhois": "<=4.2.6", - "shopware/shopware": "<5.3.7", - "silverstripe/admin": ">=1.0.3,<1.0.4|>=1.1,<1.1.1", - "silverstripe/assets": ">=1,<1.4.7|>=1.5,<1.5.2", - "silverstripe/cms": "<4.3.6|>=4.4,<4.4.4", - "silverstripe/comments": ">=1.3,<1.9.99|>=2,<2.9.99|>=3,<3.1.1", - "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", - "silverstripe/framework": "<4.4.5|>=4.5,<4.5.2", - "silverstripe/graphql": ">=2,<2.0.5|>=3,<3.1.2", - "silverstripe/registry": ">=2.1,<2.1.2|>=2.2,<2.2.1", - "silverstripe/restfulserver": ">=1,<1.0.9|>=2,<2.0.4", - "silverstripe/subsites": ">=2,<2.1.1", - "silverstripe/taxonomy": ">=1.3,<1.3.1|>=2,<2.0.1", - "silverstripe/userforms": "<3", - "simple-updates/phpwhois": "<=1", - "simplesamlphp/saml2": "<1.10.6|>=2,<2.3.8|>=3,<3.1.4", - "simplesamlphp/simplesamlphp": "<1.18.6", - "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1", - "simplito/elliptic-php": "<1.0.6", - "slim/slim": "<2.6", - "smarty/smarty": "<3.1.33", - "socalnick/scn-social-auth": "<1.15.2", - "spoonity/tcpdf": "<6.2.22", - "squizlabs/php_codesniffer": ">=1,<2.8.1|>=3,<3.0.1", - "ssddanbrown/bookstack": "<0.29.2", - "stormpath/sdk": ">=0,<9.9.99", - "studio-42/elfinder": "<2.1.49", - "swiftmailer/swiftmailer": ">=4,<5.4.5", - "sylius/admin-bundle": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2", - "sylius/grid": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1", - "sylius/grid-bundle": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1", - "sylius/resource-bundle": "<1.3.13|>=1.4,<1.4.6|>=1.5,<1.5.1|>=1.6,<1.6.3", - "sylius/sylius": "<1.3.16|>=1.4,<1.4.12|>=1.5,<1.5.9|>=1.6,<1.6.5", - "symbiote/silverstripe-multivaluefield": ">=3,<3.0.99", - "symbiote/silverstripe-versionedfiles": "<=2.0.3", - "symfony/cache": ">=3.1,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8", - "symfony/dependency-injection": ">=2,<2.0.17|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", - "symfony/error-handler": ">=4.4,<4.4.4|>=5,<5.0.4", - "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1", - "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", - "symfony/http-foundation": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7", - "symfony/http-kernel": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8", - "symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", - "symfony/mime": ">=4.3,<4.3.8", - "symfony/phpunit-bridge": ">=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", - "symfony/polyfill": ">=1,<1.10", - "symfony/polyfill-php55": ">=1,<1.10", - "symfony/proxy-manager-bridge": ">=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", - "symfony/routing": ">=2,<2.0.19", - "symfony/security": ">=2,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7|>=4.4,<4.4.7|>=5,<5.0.7", - "symfony/security-bundle": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", - "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<2.8.37|>=3,<3.3.17|>=3.4,<3.4.7|>=4,<4.0.7", - "symfony/security-csrf": ">=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", - "symfony/security-guard": ">=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", - "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7", - "symfony/serializer": ">=2,<2.0.11", - "symfony/symfony": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7", - "symfony/translation": ">=2,<2.0.17", - "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", - "symfony/var-exporter": ">=4.2,<4.2.12|>=4.3,<4.3.8", - "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", - "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7", - "t3g/svg-sanitizer": "<1.0.3", - "tecnickcom/tcpdf": "<6.2.22", - "thelia/backoffice-default-template": ">=2.1,<2.1.2", - "thelia/thelia": ">=2.1-beta.1,<2.1.3", - "theonedemon/phpwhois": "<=4.2.5", - "titon/framework": ">=0,<9.9.99", - "truckersmp/phpwhois": "<=4.3.1", - "twig/twig": "<1.38|>=2,<2.7", - "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.30|>=9,<9.5.17|>=10,<10.4.2", - "typo3/cms-core": ">=8,<8.7.30|>=9,<9.5.17|>=10,<10.4.2", - "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5", - "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4", - "typo3/phar-stream-wrapper": ">=1,<2.1.1|>=3,<3.1.1", - "ua-parser/uap-php": "<3.8", - "usmanhalalit/pixie": "<1.0.3|>=2,<2.0.2", - "verot/class.upload.php": "<=1.0.3|>=2,<=2.0.4", - "wallabag/tcpdf": "<6.2.22", - "willdurand/js-translation-bundle": "<2.1.1", - "yii2mod/yii2-cms": "<1.9.2", - "yiisoft/yii": ">=1.1.14,<1.1.15", - "yiisoft/yii2": "<2.0.15", - "yiisoft/yii2-bootstrap": "<2.0.4", - "yiisoft/yii2-dev": "<2.0.15", - "yiisoft/yii2-elasticsearch": "<2.0.5", - "yiisoft/yii2-gii": "<2.0.4", - "yiisoft/yii2-jui": "<2.0.4", - "yiisoft/yii2-redis": "<2.0.8", - "yourls/yourls": "<1.7.4", - "zendframework/zend-cache": ">=2.4,<2.4.8|>=2.5,<2.5.3", - "zendframework/zend-captcha": ">=2,<2.4.9|>=2.5,<2.5.2", - "zendframework/zend-crypt": ">=2,<2.4.9|>=2.5,<2.5.2", - "zendframework/zend-db": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.10|>=2.3,<2.3.5", - "zendframework/zend-developer-tools": ">=1.2.2,<1.2.3", - "zendframework/zend-diactoros": ">=1,<1.8.4", - "zendframework/zend-feed": ">=1,<2.10.3", - "zendframework/zend-form": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-http": ">=1,<2.8.1", - "zendframework/zend-json": ">=2.1,<2.1.6|>=2.2,<2.2.6", - "zendframework/zend-ldap": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.8|>=2.3,<2.3.3", - "zendframework/zend-mail": ">=2,<2.4.11|>=2.5,<2.7.2", - "zendframework/zend-navigation": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-session": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.9|>=2.3,<2.3.4", - "zendframework/zend-validator": ">=2.3,<2.3.6", - "zendframework/zend-view": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-xmlrpc": ">=2.1,<2.1.6|>=2.2,<2.2.6", - "zendframework/zendframework": "<2.5.1", - "zendframework/zendframework1": "<1.12.20", - "zendframework/zendopenid": ">=2,<2.0.2", - "zendframework/zendxml": ">=1,<1.0.1", - "zetacomponents/mail": "<1.8.2", - "zf-commons/zfc-user": "<1.2.2", - "zfcampus/zf-apigility-doctrine": ">=1,<1.0.3", - "zfr/zfr-oauth2-server-module": "<0.1.2" - }, - "type": "metapackage", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "role": "maintainer" - }, - { - "name": "Ilya Tribusean", - "email": "slash3b@gmail.com", - "role": "maintainer" - } - ], - "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2020-07-03T16:50:03+00:00" - }, { "name": "sebastian/code-unit-reverse-lookup", "version": "1.0.1", @@ -5139,6 +4863,54 @@ ], "time": "2019-10-24T14:27:39+00:00" }, + { + "name": "sensiolabs/security-checker", + "version": "v6.0.3", + "source": { + "type": "git", + "url": "https://github.com/sensiolabs/security-checker.git", + "reference": "a576c01520d9761901f269c4934ba55448be4a54" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sensiolabs/security-checker/zipball/a576c01520d9761901f269c4934ba55448be4a54", + "reference": "a576c01520d9761901f269c4934ba55448be4a54", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "symfony/console": "^2.8|^3.4|^4.2|^5.0", + "symfony/http-client": "^4.3|^5.0", + "symfony/mime": "^4.3|^5.0", + "symfony/polyfill-ctype": "^1.11" + }, + "bin": [ + "security-checker" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.0-dev" + } + }, + "autoload": { + "psr-4": { + "SensioLabs\\Security\\": "SensioLabs/Security" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien.potencier@gmail.com" + } + ], + "description": "A security checker for your composer.lock", + "time": "2019-11-01T13:20:14+00:00" + }, { "name": "smarty-gettext/smarty-gettext", "version": "1.6.1", @@ -5691,6 +5463,198 @@ "homepage": "https://symfony.com", "time": "2020-04-12T14:40:17+00:00" }, + { + "name": "symfony/http-client", + "version": "v5.1.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-client.git", + "reference": "aae28b613d7a88e529df46e617f046be0236ab54" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-client/zipball/aae28b613d7a88e529df46e617f046be0236ab54", + "reference": "aae28b613d7a88e529df46e617f046be0236ab54", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/log": "^1.0", + "symfony/http-client-contracts": "^2.1.1", + "symfony/polyfill-php73": "^1.11", + "symfony/polyfill-php80": "^1.15", + "symfony/service-contracts": "^1.0|^2" + }, + "provide": { + "php-http/async-client-implementation": "*", + "php-http/client-implementation": "*", + "psr/http-client-implementation": "1.0", + "symfony/http-client-implementation": "1.1" + }, + "require-dev": { + "amphp/http-client": "^4.2.1", + "amphp/http-tunnel": "^1.0", + "amphp/socket": "^1.1", + "guzzlehttp/promises": "^1.3.1", + "nyholm/psr7": "^1.0", + "php-http/httplug": "^1.0|^2.0", + "psr/http-client": "^1.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/http-kernel": "^4.4|^5.0", + "symfony/process": "^4.4|^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpClient\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony HttpClient component", + "homepage": "https://symfony.com", + "time": "2020-06-11T21:20:02+00:00" + }, + { + "name": "symfony/http-client-contracts", + "version": "v2.1.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-client-contracts.git", + "reference": "f8bed25edc964d015bcd87f1fec5734963931910" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/f8bed25edc964d015bcd87f1fec5734963931910", + "reference": "f8bed25edc964d015bcd87f1fec5734963931910", + "shasum": "" + }, + "require": { + "php": ">=7.2.5" + }, + "suggest": { + "symfony/http-client-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\HttpClient\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to HTTP clients", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2020-05-25T17:37:45+00:00" + }, + { + "name": "symfony/mime", + "version": "v5.1.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/mime.git", + "reference": "c0c418f05e727606e85b482a8591519c4712cf45" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/mime/zipball/c0c418f05e727606e85b482a8591519c4712cf45", + "reference": "c0c418f05e727606e85b482a8591519c4712cf45", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-intl-idn": "^1.10", + "symfony/polyfill-mbstring": "^1.0", + "symfony/polyfill-php80": "^1.15" + }, + "conflict": { + "symfony/mailer": "<4.4" + }, + "require-dev": { + "egulias/email-validator": "^2.1.10", + "symfony/dependency-injection": "^4.4|^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Mime\\": "" + }, + "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": "A library to manipulate MIME messages", + "homepage": "https://symfony.com", + "keywords": [ + "mime", + "mime-type" + ], + "time": "2020-06-09T15:07:35+00:00" + }, { "name": "symfony/options-resolver", "version": "v5.0.0", @@ -5803,6 +5767,72 @@ ], "time": "2020-05-12T16:47:27+00:00" }, + { + "name": "symfony/polyfill-php80", + "version": "v1.17.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "4a5b6bba3259902e386eb80dd1956181ee90b5b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4a5b6bba3259902e386eb80dd1956181ee90b5b2", + "reference": "4a5b6bba3259902e386eb80dd1956181ee90b5b2", + "shasum": "" + }, + "require": { + "php": ">=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.17-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2020-06-06T08:46:27+00:00" + }, { "name": "symfony/service-contracts", "version": "v2.0.1", @@ -6027,9 +6057,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "roave/security-advisories": 20 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/grumphp.yml b/grumphp.yml index df983e1..2a41a95 100644 --- a/grumphp.yml +++ b/grumphp.yml @@ -6,6 +6,7 @@ parameters: xmllint: ~ yamllint: ~ composer: ~ + securitychecker: ~ phpcs: standard: PSR12 phpstan: From b02e255cb419cf6afbe89e8a82cf4713f06a3aae Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 5 Jul 2020 11:22:55 +0200 Subject: [PATCH 07/43] Avoid magic numbers --- classes/Controller/DownloadController.php | 5 +++-- classes/Controller/FrontController.php | 5 +++-- classes/Controller/JsonController.php | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/classes/Controller/DownloadController.php b/classes/Controller/DownloadController.php index dd3e46f..834f48d 100644 --- a/classes/Controller/DownloadController.php +++ b/classes/Controller/DownloadController.php @@ -21,6 +21,7 @@ use Alltube\Stream\PlaylistArchiveStream; use Alltube\Stream\YoutubeStream; use Slim\Http\Request; use Slim\Http\Response; +use Slim\Http\StatusCode; use Slim\Http\Stream; /** @@ -203,8 +204,8 @@ class DownloadController extends BaseController $response = $response->withHeader('Content-Length', $stream->getHeader('Content-Length')); $response = $response->withHeader('Accept-Ranges', $stream->getHeader('Accept-Ranges')); $response = $response->withHeader('Content-Range', $stream->getHeader('Content-Range')); - if ($stream->getStatusCode() == 206) { - $response = $response->withStatus(206); + if ($stream->getStatusCode() == StatusCode::HTTP_PARTIAL_CONTENT) { + $response = $response->withStatus(StatusCode::HTTP_PARTIAL_CONTENT); } if (isset($this->video->downloader_options->http_chunk_size)) { diff --git a/classes/Controller/FrontController.php b/classes/Controller/FrontController.php index 2b6109a..9526c0c 100644 --- a/classes/Controller/FrontController.php +++ b/classes/Controller/FrontController.php @@ -11,6 +11,7 @@ use Alltube\Library\Exception\AlltubeLibraryException; use Alltube\Library\Exception\WrongPasswordException; use Alltube\Locale; use Exception; +use Slim\Http\StatusCode; use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer; use Throwable; use Psr\Container\ContainerInterface; @@ -142,7 +143,7 @@ class FrontController extends BaseController ] ); - return $response->withStatus(403); + return $response->withStatus(StatusCode::HTTP_FORBIDDEN); } /** @@ -256,7 +257,7 @@ class FrontController extends BaseController ] ); - return $response->withStatus(500); + return $response->withStatus(StatusCode::HTTP_INTERNAL_SERVER_ERROR); } /** diff --git a/classes/Controller/JsonController.php b/classes/Controller/JsonController.php index 9e37cc2..1247c6b 100644 --- a/classes/Controller/JsonController.php +++ b/classes/Controller/JsonController.php @@ -9,6 +9,7 @@ namespace Alltube\Controller; use Alltube\Library\Exception\AlltubeLibraryException; use Slim\Http\Request; use Slim\Http\Response; +use Slim\Http\StatusCode; /** * Controller that returns JSON. @@ -38,7 +39,7 @@ class JsonController extends BaseController return $response->withJson($this->video->getJson()); } else { return $response->withJson(['error' => 'You need to provide the url parameter']) - ->withStatus(400); + ->withStatus(StatusCode::HTTP_BAD_REQUEST); } } } From 7e575e1bb2ef535517266c7ebeeb10336cf7abab Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 5 Jul 2020 11:58:50 +0200 Subject: [PATCH 08/43] composer-normalize --- composer.json | 69 ++++++------ composer.lock | 303 +++++++++++++++++++++++++++++++++++++++++++++++++- grumphp.yml | 1 + 3 files changed, 338 insertions(+), 35 deletions(-) diff --git a/composer.json b/composer.json index 32d2988..d3c6d09 100644 --- a/composer.json +++ b/composer.json @@ -1,9 +1,23 @@ { "name": "rudloff/alltube", - "description": "HTML GUI for youtube-dl", - "license": "GPL-3.0-only", - "homepage": "http://alltubedownload.net/", "type": "project", + "description": "HTML GUI for youtube-dl", + "homepage": "http://alltubedownload.net/", + "license": "GPL-3.0-only", + "authors": [ + { + "name": "Pierre Rudloff", + "email": "contact@rudloff.pro", + "homepage": "https://rudloff.pro/", + "role": "Developer" + }, + { + "name": "Olivier Haquette", + "email": "contact@olivierhaquette.fr", + "homepage": "http://olivierhaquette.fr/", + "role": "Designer" + } + ], "require": { "ext-intl": "*", "ext-json": "*", @@ -23,6 +37,7 @@ }, "require-dev": { "consolidation/robo": "^2.1", + "ergebnis/composer-normalize": "^2.6", "php-mock/php-mock-mockery": "^1.3", "phpro/grumphp": "^0.18.0", "phpstan/phpstan": "^0.12.25", @@ -33,6 +48,22 @@ "symfony/error-handler": "^5.0", "symfony/var-dumper": "^5.0" }, + "config": { + "platform": { + "php": "7.3.11" + }, + "sort-packages": true + }, + "autoload": { + "psr-4": { + "Alltube\\": "classes/" + } + }, + "autoload-dev": { + "psr-4": { + "Alltube\\Test\\": "tests/" + } + }, "repositories": [ { "type": "composer", @@ -50,44 +81,14 @@ } } ], - "authors": [ - { - "name": "Pierre Rudloff", - "email": "contact@rudloff.pro", - "homepage": "https://rudloff.pro/", - "role": "Developer" - }, - { - "name": "Olivier Haquette", - "email": "contact@olivierhaquette.fr", - "homepage": "http://olivierhaquette.fr/", - "role": "Designer" - } - ], - "autoload": { - "psr-4": { - "Alltube\\": "classes/" - } - }, - "autoload-dev": { - "psr-4": { - "Alltube\\Test\\": "tests/" - } - }, "scripts": { "lint": "grumphp run --ansi", - "test": "phpunit", "release": "robo release --ansi", + "test": "phpunit", "update-locales": [ "tsmarty2c.php templates > i18n/template.pot", "xgettext --omit-header -kt -j -o i18n/template.pot classes/*.php classes/*/*.php" ], "youtube-dl": "vendor/ytdl-org/youtube-dl/youtube_dl/__main__.py" - }, - "config": { - "sort-packages": true, - "platform": { - "php": "7.3.11" - } } } diff --git a/composer.lock b/composer.lock index c10163e..d83a5b2 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d9125c0cc7c3d9c1074b8b30445eaad5", + "content-hash": "2ca44dcc718001c0bbcbd4e59c1136b8", "packages": [ { "name": "aura/session", @@ -2207,6 +2207,190 @@ ], "time": "2019-10-21T16:45:58+00:00" }, + { + "name": "ergebnis/composer-normalize", + "version": "2.6.0", + "source": { + "type": "git", + "url": "https://github.com/ergebnis/composer-normalize.git", + "reference": "ad7a07896aaf513bdcda7ef883c793a344c04aba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ergebnis/composer-normalize/zipball/ad7a07896aaf513bdcda7ef883c793a344c04aba", + "reference": "ad7a07896aaf513bdcda7ef883c793a344c04aba", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1.0 || ^2.0.0", + "ergebnis/json-normalizer": "~0.12.0", + "ergebnis/json-printer": "^3.0.2", + "justinrainbow/json-schema": "^5.2.10", + "localheinz/diff": "^1.0.1", + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "composer/composer": "^1.10.8 || ^2.0.0", + "composer/package-versions-deprecated": "^1.8.1", + "ergebnis/phpstan-rules": "~0.15.0", + "ergebnis/test-util": "~1.0.0", + "jangregor/phpstan-prophecy": "~0.8.0", + "phpstan/extension-installer": "^1.0.4", + "phpstan/phpstan": "~0.12.32", + "phpstan/phpstan-deprecation-rules": "~0.12.4", + "phpstan/phpstan-phpunit": "~0.12.11", + "phpstan/phpstan-strict-rules": "~0.12.2", + "phpunit/phpunit": "^7.5.20", + "symfony/filesystem": "^4.4.9" + }, + "type": "composer-plugin", + "extra": { + "class": "Ergebnis\\Composer\\Normalize\\NormalizePlugin" + }, + "autoload": { + "psr-4": { + "Ergebnis\\Composer\\Normalize\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andreas Möller", + "email": "am@localheinz.com" + } + ], + "description": "Provides a composer plugin for normalizing composer.json.", + "homepage": "https://github.com/ergebnis/composer-normalize", + "keywords": [ + "composer", + "normalize", + "normalizer", + "plugin" + ], + "time": "2020-07-03T18:09:23+00:00" + }, + { + "name": "ergebnis/json-normalizer", + "version": "0.12.0", + "source": { + "type": "git", + "url": "https://github.com/ergebnis/json-normalizer.git", + "reference": "0197447cd5d8f7e82116e904196a3e9f470655db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ergebnis/json-normalizer/zipball/0197447cd5d8f7e82116e904196a3e9f470655db", + "reference": "0197447cd5d8f7e82116e904196a3e9f470655db", + "shasum": "" + }, + "require": { + "ergebnis/json-printer": "^3.0.2", + "ext-json": "*", + "justinrainbow/json-schema": "^4.0.0 || ^5.0.0", + "php": "^7.1" + }, + "require-dev": { + "ergebnis/license": "~0.1.0", + "ergebnis/php-cs-fixer-config": "^2.1.2", + "ergebnis/phpstan-rules": "~0.14.4", + "ergebnis/test-util": "~1.0.0", + "infection/infection": "~0.13.6", + "jangregor/phpstan-prophecy": "~0.6.2", + "phpstan/extension-installer": "^1.0.4", + "phpstan/phpstan": "~0.12.18", + "phpstan/phpstan-deprecation-rules": "~0.12.2", + "phpstan/phpstan-phpunit": "~0.12.8", + "phpstan/phpstan-strict-rules": "~0.12.2", + "phpunit/phpunit": "^7.5.20", + "psalm/plugin-phpunit": "~0.10.0", + "vimeo/psalm": "^3.11.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Ergebnis\\Json\\Normalizer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andreas Möller", + "email": "am@localheinz.com" + } + ], + "description": "Provides generic and vendor-specific normalizers for normalizing JSON documents.", + "homepage": "https://github.com/ergebnis/json-normalizer", + "keywords": [ + "json", + "normalizer" + ], + "time": "2020-04-19T12:30:41+00:00" + }, + { + "name": "ergebnis/json-printer", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/ergebnis/json-printer.git", + "reference": "776a5c85ce3c67d97c6af08a67c917adbdb4758e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ergebnis/json-printer/zipball/776a5c85ce3c67d97c6af08a67c917adbdb4758e", + "reference": "776a5c85ce3c67d97c6af08a67c917adbdb4758e", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "ergebnis/license": "~1.0.0", + "ergebnis/php-cs-fixer-config": "^2.2.1", + "ergebnis/phpstan-rules": "~0.15.0", + "ergebnis/test-util": "~1.0.0", + "infection/infection": "~0.13.6", + "phpstan/extension-installer": "^1.0.4", + "phpstan/phpstan": "~0.12.32", + "phpstan/phpstan-deprecation-rules": "~0.12.4", + "phpstan/phpstan-phpunit": "~0.12.11", + "phpstan/phpstan-strict-rules": "~0.12.2", + "phpunit/phpunit": "^7.5.20", + "psalm/plugin-phpunit": "~0.10.1", + "vimeo/psalm": "^3.12.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Ergebnis\\Json\\Printer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andreas Möller", + "email": "am@localheinz.com" + } + ], + "description": "Provides a JSON printer, allowing for flexible indentation.", + "homepage": "https://github.com/ergebnis/json-printer", + "keywords": [ + "formatter", + "json", + "printer" + ], + "time": "2020-07-04T17:09:39+00:00" + }, { "name": "gitonomy/gitlib", "version": "v1.1.0", @@ -2406,6 +2590,72 @@ ], "time": "2016-01-20T08:20:44+00:00" }, + { + "name": "justinrainbow/json-schema", + "version": "5.2.10", + "source": { + "type": "git", + "url": "https://github.com/justinrainbow/json-schema.git", + "reference": "2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b", + "reference": "2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1", + "json-schema/json-schema-test-suite": "1.2.0", + "phpunit/phpunit": "^4.8.35" + }, + "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": "2020-05-27T16:41:55+00:00" + }, { "name": "league/container", "version": "2.4.1", @@ -2471,6 +2721,57 @@ ], "time": "2017-05-10T09:20:27+00:00" }, + { + "name": "localheinz/diff", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/localheinz/diff.git", + "reference": "bd5661db4bbed26c6f25df8851fd9f4b424a356e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/localheinz/diff/zipball/bd5661db4bbed26c6f25df8851fd9f4b424a356e", + "reference": "bd5661db4bbed26c6f25df8851fd9f4b424a356e", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.5 || ^8.0", + "symfony/process": "^2 || ^3.3 || ^4" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Fork of sebastian/diff for use with ergebnis/composer-normalize", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "time": "2019-12-17T07:42:37+00:00" + }, { "name": "mockery/mockery", "version": "1.2.2", diff --git a/grumphp.yml b/grumphp.yml index 2a41a95..30f207b 100644 --- a/grumphp.yml +++ b/grumphp.yml @@ -7,6 +7,7 @@ parameters: yamllint: ~ composer: ~ securitychecker: ~ + composer_normalize: ~ phpcs: standard: PSR12 phpstan: From 96a75cbf1416eeb3bc46da43b88533dbe9031b41 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Wed, 15 Jul 2020 22:39:46 +0200 Subject: [PATCH 09/43] =?UTF-8?q?Log=20youtube-dl=20and=20ffmpeg=20command?= =?UTF-8?q?s=20(fixes=C2=A0#297)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/Controller/BaseController.php | 7 + classes/LoggerFactory.php | 33 ++ composer.json | 3 +- composer.lock | 620 +++++++++++++------------- index.php | 4 + tests/ControllerTest.php | 2 + 6 files changed, 359 insertions(+), 310 deletions(-) create mode 100644 classes/LoggerFactory.php diff --git a/classes/Controller/BaseController.php b/classes/Controller/BaseController.php index 05d3eb2..30a157c 100644 --- a/classes/Controller/BaseController.php +++ b/classes/Controller/BaseController.php @@ -12,6 +12,7 @@ use Alltube\Library\Video; use Alltube\LocaleManager; use Alltube\SessionManager; use Aura\Session\Segment; +use Consolidation\Log\Logger; use Psr\Container\ContainerInterface; use Slim\Http\Request; use Slim\Http\Response; @@ -70,6 +71,11 @@ abstract class BaseController */ protected $downloader; + /** + * @var Logger + */ + protected $logger; + /** * BaseController constructor. * @@ -83,6 +89,7 @@ abstract class BaseController $this->sessionSegment = $session->getSegment(self::class); $this->localeManager = $this->container->get('locale'); $this->downloader = $this->config->getDownloader(); + $this->downloader->setLogger($this->container->get('logger')); if (!$this->config->stream) { // Force HTTP if stream is not enabled. diff --git a/classes/LoggerFactory.php b/classes/LoggerFactory.php new file mode 100644 index 0000000..f0c71f6 --- /dev/null +++ b/classes/LoggerFactory.php @@ -0,0 +1,33 @@ +debug) { + $verbosity = ConsoleOutput::VERBOSITY_DEBUG; + } else { + $verbosity = ConsoleOutput::VERBOSITY_NORMAL; + } + + $logger = new Logger(new ConsoleOutput($verbosity)); + $logger->setLogOutputStyler(new LogOutputStyler()); + + return $logger; + } +} diff --git a/composer.json b/composer.json index d3c6d09..09f755a 100644 --- a/composer.json +++ b/composer.json @@ -23,12 +23,13 @@ "ext-json": "*", "aura/session": "^2.1", "barracudanetworks/archivestream-php": "^1.0", + "consolidation/log": "^2.0", "jawira/case-converter": "^3.4", "jean85/pretty-package-versions": "^1.3", "mathmarques/smarty-view": "^1.1", "npm-asset/open-sans-fontface": "^1.4", "rinvex/countries": "^6.1", - "rudloff/alltube-library": "^0.1.0", + "rudloff/alltube-library": "dev-develop", "symfony/finder": "^5.0", "symfony/translation": "^4.0", "symfony/yaml": "^4.0", diff --git a/composer.lock b/composer.lock index d83a5b2..2261130 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2ca44dcc718001c0bbcbd4e59c1136b8", + "content-hash": "d0a5c7e93a6d08ce781d72a85dff85ab", "packages": [ { "name": "aura/session", @@ -163,6 +163,67 @@ "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", "time": "2020-06-19T07:59:31+00:00" }, + { + "name": "consolidation/log", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/consolidation/log.git", + "reference": "ba0bf6af1fbd09ed4dc18fc2f27b12ceff487cbf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/consolidation/log/zipball/ba0bf6af1fbd09ed4dc18fc2f27b12ceff487cbf", + "reference": "ba0bf6af1fbd09ed4dc18fc2f27b12ceff487cbf", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "psr/log": "^1.0", + "symfony/console": "^4|^5" + }, + "require-dev": { + "g1a/composer-test-scenarios": "^3", + "php-coveralls/php-coveralls": "^2.2", + "phpunit/phpunit": "^6", + "squizlabs/php_codesniffer": "^3" + }, + "type": "library", + "extra": { + "scenarios": { + "symfony4": { + "require-dev": { + "symfony/console": "^4" + }, + "config": { + "platform": { + "php": "7.1.3" + } + } + } + }, + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Consolidation\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Greg Anderson", + "email": "greg.1.anderson@greenknowe.org" + } + ], + "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.", + "time": "2020-05-27T17:06:13+00:00" + }, { "name": "guzzlehttp/guzzle", "version": "6.5.5", @@ -724,6 +785,53 @@ ], "time": "2016-08-06T14:39:51+00:00" }, + { + "name": "psr/log", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.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": "2020-03-23T09:12:05+00:00" + }, { "name": "ralouphie/getallheaders", "version": "3.0.3", @@ -844,21 +952,22 @@ }, { "name": "rudloff/alltube-library", - "version": "0.1.0", + "version": "dev-develop", "source": { "type": "git", "url": "https://github.com/Rudloff/alltube-library.git", - "reference": "09b47e0cf3157a79724177d6cadac8cee8cae588" + "reference": "0413427bbed7b02a2971b1716bf36c66924a205f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Rudloff/alltube-library/zipball/09b47e0cf3157a79724177d6cadac8cee8cae588", - "reference": "09b47e0cf3157a79724177d6cadac8cee8cae588", + "url": "https://api.github.com/repos/Rudloff/alltube-library/zipball/0413427bbed7b02a2971b1716bf36c66924a205f", + "reference": "0413427bbed7b02a2971b1716bf36c66924a205f", "shasum": "" }, "require": { "ext-json": "*", "guzzlehttp/guzzle": "^6.5", + "psr/log": "^1.1", "symfony/process": "^4.0|^5.0" }, "require-dev": { @@ -871,8 +980,7 @@ "type": "library", "autoload": { "psr-4": { - "Alltube\\Library\\": "classes/", - "Alltube\\Library\\Exception\\": "classes/exceptions/" + "Alltube\\Library\\": "classes/" } }, "notification-url": "https://packagist.org/downloads/", @@ -881,7 +989,7 @@ ], "description": "PHP wrapper for youtube-dl", "homepage": "http://alltubedownload.net/", - "time": "2020-06-21T12:25:10+00:00" + "time": "2020-07-15T20:34:36+00:00" }, { "name": "slim/slim", @@ -1009,6 +1117,82 @@ ], "time": "2018-09-12T20:54:16+00:00" }, + { + "name": "symfony/console", + "version": "v5.0.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "5fa1caadc8cdaa17bcfb25219f3b53fe294a9935" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/5fa1caadc8cdaa17bcfb25219f3b53fe294a9935", + "reference": "5fa1caadc8cdaa17bcfb25219f3b53fe294a9935", + "shasum": "" + }, + "require": { + "php": "^7.2.5", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.8", + "symfony/service-contracts": "^1.1|^2" + }, + "conflict": { + "symfony/dependency-injection": "<4.4", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/event-dispatcher": "^4.4|^5.0", + "symfony/lock": "^4.4|^5.0", + "symfony/process": "^4.4|^5.0", + "symfony/var-dumper": "^4.4|^5.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-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": "2020-03-30T11:42:42+00:00" + }, { "name": "symfony/finder", "version": "v5.0.8", @@ -1292,6 +1476,64 @@ ], "time": "2020-05-12T16:47:27+00:00" }, + { + "name": "symfony/polyfill-php73", + "version": "v1.17.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "a760d8964ff79ab9bf057613a5808284ec852ccc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a760d8964ff79ab9bf057613a5808284ec852ccc", + "reference": "a760d8964ff79ab9bf057613a5808284ec852ccc", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.17-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2020-05-12T16:47:27+00:00" + }, { "name": "symfony/process", "version": "v4.4.10", @@ -1341,6 +1583,64 @@ "homepage": "https://symfony.com", "time": "2020-05-30T20:06:45+00:00" }, + { + "name": "symfony/service-contracts", + "version": "v2.0.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "144c5e51266b281231e947b51223ba14acf1a749" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/144c5e51266b281231e947b51223ba14acf1a749", + "reference": "144c5e51266b281231e947b51223ba14acf1a749", + "shasum": "" + }, + "require": { + "php": "^7.2.5", + "psr/container": "^1.0" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2019-11-18T17:27:11+00:00" + }, { "name": "symfony/translation", "version": "v4.4.0", @@ -1716,67 +2016,6 @@ "description": "Provide configuration services for a commandline tool.", "time": "2020-05-27T17:11:23+00:00" }, - { - "name": "consolidation/log", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/consolidation/log.git", - "reference": "ba0bf6af1fbd09ed4dc18fc2f27b12ceff487cbf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/consolidation/log/zipball/ba0bf6af1fbd09ed4dc18fc2f27b12ceff487cbf", - "reference": "ba0bf6af1fbd09ed4dc18fc2f27b12ceff487cbf", - "shasum": "" - }, - "require": { - "php": ">=7.1.3", - "psr/log": "^1.0", - "symfony/console": "^4|^5" - }, - "require-dev": { - "g1a/composer-test-scenarios": "^3", - "php-coveralls/php-coveralls": "^2.2", - "phpunit/phpunit": "^6", - "squizlabs/php_codesniffer": "^3" - }, - "type": "library", - "extra": { - "scenarios": { - "symfony4": { - "require-dev": { - "symfony/console": "^4" - }, - "config": { - "platform": { - "php": "7.1.3" - } - } - } - }, - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Consolidation\\Log\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Greg Anderson", - "email": "greg.1.anderson@greenknowe.org" - } - ], - "description": "Improved Psr-3 / Psr\\Log logger based on Symfony Console components.", - "time": "2020-05-27T17:06:13+00:00" - }, { "name": "consolidation/output-formatters", "version": "4.1.1", @@ -4453,53 +4692,6 @@ ], "time": "2019-01-08T18:20:26+00:00" }, - { - "name": "psr/log", - "version": "1.1.3", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.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": "2020-03-23T09:12:05+00:00" - }, { "name": "sebastian/code-unit-reverse-lookup", "version": "1.0.1", @@ -5382,82 +5574,6 @@ "homepage": "https://symfony.com", "time": "2019-11-18T17:27:11+00:00" }, - { - "name": "symfony/console", - "version": "v5.0.8", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "5fa1caadc8cdaa17bcfb25219f3b53fe294a9935" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/5fa1caadc8cdaa17bcfb25219f3b53fe294a9935", - "reference": "5fa1caadc8cdaa17bcfb25219f3b53fe294a9935", - "shasum": "" - }, - "require": { - "php": "^7.2.5", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", - "symfony/service-contracts": "^1.1|^2" - }, - "conflict": { - "symfony/dependency-injection": "<4.4", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" - }, - "provide": { - "psr/log-implementation": "1.0" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "^4.4|^5.0", - "symfony/dependency-injection": "^4.4|^5.0", - "symfony/event-dispatcher": "^4.4|^5.0", - "symfony/lock": "^4.4|^5.0", - "symfony/process": "^4.4|^5.0", - "symfony/var-dumper": "^4.4|^5.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-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": "2020-03-30T11:42:42+00:00" - }, { "name": "symfony/dependency-injection", "version": "v5.0.0", @@ -6010,64 +6126,6 @@ ], "time": "2019-11-18T17:27:11+00:00" }, - { - "name": "symfony/polyfill-php73", - "version": "v1.17.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "a760d8964ff79ab9bf057613a5808284ec852ccc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a760d8964ff79ab9bf057613a5808284ec852ccc", - "reference": "a760d8964ff79ab9bf057613a5808284ec852ccc", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.17-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "time": "2020-05-12T16:47:27+00:00" - }, { "name": "symfony/polyfill-php80", "version": "v1.17.1", @@ -6134,64 +6192,6 @@ ], "time": "2020-06-06T08:46:27+00:00" }, - { - "name": "symfony/service-contracts", - "version": "v2.0.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "144c5e51266b281231e947b51223ba14acf1a749" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/144c5e51266b281231e947b51223ba14acf1a749", - "reference": "144c5e51266b281231e947b51223ba14acf1a749", - "shasum": "" - }, - "require": { - "php": "^7.2.5", - "psr/container": "^1.0" - }, - "suggest": { - "symfony/service-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "time": "2019-11-18T17:27:11+00:00" - }, { "name": "symfony/var-dumper", "version": "v5.0.8", @@ -6358,7 +6358,9 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "rudloff/alltube-library": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/index.php b/index.php index 4760670..ecbdea5 100644 --- a/index.php +++ b/index.php @@ -8,6 +8,7 @@ use Alltube\Controller\FrontController; use Alltube\Controller\JsonController; use Alltube\LocaleManager; use Alltube\LocaleMiddleware; +use Alltube\LoggerFactory; use Alltube\UglyRouter; use Alltube\ViewFactory; use Slim\App; @@ -61,6 +62,9 @@ try { die('Could not load Smarty: ' . $e->getMessage()); } +// Logger. +$container['logger'] = LoggerFactory::create(); + // Controllers. $frontController = new FrontController($container); $jsonController = new JsonController($container); diff --git a/tests/ControllerTest.php b/tests/ControllerTest.php index abb3756..9b2fc1b 100644 --- a/tests/ControllerTest.php +++ b/tests/ControllerTest.php @@ -11,6 +11,7 @@ use Alltube\Controller\DownloadController; use Alltube\Controller\FrontController; use Alltube\Exception\ConfigException; use Alltube\LocaleManager; +use Alltube\LoggerFactory; use Alltube\ViewFactory; use Slim\Container; use Slim\Http\Environment; @@ -63,6 +64,7 @@ abstract class ControllerTest extends BaseTest $this->response = new Response(); $this->container['locale'] = LocaleManager::getInstance(); $this->container['view'] = ViewFactory::create($this->container, $this->request); + $this->container['logger'] = LoggerFactory::create(); $frontController = new FrontController($this->container); $downloadController = new DownloadController($this->container); From 280618bb6b0b60d89c57a8960bcdf796ab8d2602 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Wed, 15 Jul 2020 23:05:41 +0200 Subject: [PATCH 10/43] Use a factory to Config and LocaleManager (see #298) --- classes/Config.php | 1 + classes/ConfigFactory.php | 40 +++++++ classes/Controller/BaseController.php | 2 +- classes/Exception/ConfigException.php | 4 + classes/Exception/DependencyException.php | 14 +++ classes/LocaleManager.php | 1 + classes/LocaleManagerFactory.php | 26 ++++ classes/LoggerFactory.php | 6 +- index.php | 138 +++++++++------------- 9 files changed, 145 insertions(+), 87 deletions(-) create mode 100644 classes/ConfigFactory.php create mode 100644 classes/Exception/DependencyException.php create mode 100644 classes/LocaleManagerFactory.php diff --git a/classes/Config.php b/classes/Config.php index 0460765..a37497e 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -261,6 +261,7 @@ class Config * Get Config singleton instance. * * @return Config + * @todo Stop using a singleton. */ public static function getInstance() { diff --git a/classes/ConfigFactory.php b/classes/ConfigFactory.php new file mode 100644 index 0000000..03cae73 --- /dev/null +++ b/classes/ConfigFactory.php @@ -0,0 +1,40 @@ +uglyUrls) { + $container['router'] = new UglyRouter(); + } + if ($config->debug) { + /* + We want to enable this as soon as possible, + in order to catch errors that are thrown + before the Slim error handler is ready. + */ + Debug::enable(); + } + + return $config; + } +} diff --git a/classes/Controller/BaseController.php b/classes/Controller/BaseController.php index 30a157c..a152f11 100644 --- a/classes/Controller/BaseController.php +++ b/classes/Controller/BaseController.php @@ -83,7 +83,7 @@ abstract class BaseController */ public function __construct(ContainerInterface $container) { - $this->config = Config::getInstance(); + $this->config = $container->get('config'); $this->container = $container; $session = SessionManager::getSession(); $this->sessionSegment = $session->getSegment(self::class); diff --git a/classes/Exception/ConfigException.php b/classes/Exception/ConfigException.php index f533b35..98c1207 100644 --- a/classes/Exception/ConfigException.php +++ b/classes/Exception/ConfigException.php @@ -4,6 +4,10 @@ namespace Alltube\Exception; use Exception; +/** + * Class ConfigException + * @package Alltube\Exception + */ class ConfigException extends Exception { diff --git a/classes/Exception/DependencyException.php b/classes/Exception/DependencyException.php new file mode 100644 index 0000000..e5f04e1 --- /dev/null +++ b/classes/Exception/DependencyException.php @@ -0,0 +1,14 @@ +get('config'); if ($config->debug) { $verbosity = ConsoleOutput::VERBOSITY_DEBUG; } else { diff --git a/index.php b/index.php index ecbdea5..9814f47 100644 --- a/index.php +++ b/index.php @@ -2,118 +2,88 @@ require_once __DIR__ . '/vendor/autoload.php'; -use Alltube\Config; +use Alltube\ConfigFactory; use Alltube\Controller\DownloadController; use Alltube\Controller\FrontController; use Alltube\Controller\JsonController; -use Alltube\LocaleManager; +use Alltube\LocaleManagerFactory; use Alltube\LocaleMiddleware; use Alltube\LoggerFactory; -use Alltube\UglyRouter; use Alltube\ViewFactory; use Slim\App; use Slim\Container; -use Symfony\Component\ErrorHandler\Debug; if (isset($_SERVER['REQUEST_URI']) && strpos($_SERVER['REQUEST_URI'], '/index.php') !== false) { header('Location: ' . str_ireplace('/index.php', '/', $_SERVER['REQUEST_URI'])); die; } -if (is_file(__DIR__ . '/config/config.yml')) { - try { - Config::setFile(__DIR__ . '/config/config.yml'); - } catch (Exception $e) { - die('Could not load config file: ' . $e->getMessage()); - } -} - -// Create app. -$app = new App(); - -/** @var Container $container */ -$container = $app->getContainer(); - -// Load config. -$config = Config::getInstance(); -if ($config->uglyUrls) { - $container['router'] = new UglyRouter(); -} -if ($config->debug) { - /* - We want to enable this as soon as possible, - in order to catch errors that are thrown - before the Slim error handler is ready. - */ - Debug::enable(); -} - -// Locales. -if (!class_exists('Locale')) { - die('You need to install the intl extension for PHP.'); -} -$container['locale'] = LocaleManager::getInstance(); -$app->add(new LocaleMiddleware($container)); - -// Smarty. try { + // Create app. + $app = new App(); + + /** @var Container $container */ + $container = $app->getContainer(); + + // Config. + $container['config'] = ConfigFactory::create(); + + // Locales. + $container['locale'] = LocaleManagerFactory::create(); + $app->add(new LocaleMiddleware($container)); + + // Smarty. $container['view'] = ViewFactory::create($container); -} catch (SmartyException $e) { - die('Could not load Smarty: ' . $e->getMessage()); -} -// Logger. -$container['logger'] = LoggerFactory::create(); + // Logger. + $container['logger'] = LoggerFactory::create($container); -// Controllers. -$frontController = new FrontController($container); -$jsonController = new JsonController($container); -$downloadController = new DownloadController($container); + // Controllers. + $frontController = new FrontController($container); + $jsonController = new JsonController($container); + $downloadController = new DownloadController($container); -// Error handling. -$container['errorHandler'] = [$frontController, 'error']; -$container['phpErrorHandler'] = [$frontController, 'error']; + // Error handling. + $container['errorHandler'] = [$frontController, 'error']; + $container['phpErrorHandler'] = [$frontController, 'error']; -// Routes. -$app->get( - '/', - [$frontController, 'index'] -)->setName('index'); + // Routes. + $app->get( + '/', + [$frontController, 'index'] + )->setName('index'); -$app->get( - '/extractors', - [$frontController, 'extractors'] -)->setName('extractors'); + $app->get( + '/extractors', + [$frontController, 'extractors'] + )->setName('extractors'); -$app->any( - '/info', - [$frontController, 'info'] -)->setName('info'); + $app->any( + '/info', + [$frontController, 'info'] + )->setName('info'); -$app->any( - '/watch', - [$frontController, 'info'] -); + $app->any( + '/watch', + [$frontController, 'info'] + ); -$app->any( - '/download', - [$downloadController, 'download'] -)->setName('download'); + $app->any( + '/download', + [$downloadController, 'download'] + )->setName('download'); -$app->get( - '/locale/{locale}', - [$frontController, 'locale'] -)->setName('locale'); + $app->get( + '/locale/{locale}', + [$frontController, 'locale'] + )->setName('locale'); -$app->get( - '/json', - [$jsonController, 'json'] -)->setName('json'); + $app->get( + '/json', + [$jsonController, 'json'] + )->setName('json'); -try { $app->run(); -} catch (SmartyException $e) { - die('Smarty could not compile the template file: ' . $e->getMessage()); } catch (Throwable $e) { // Last resort if the error has not been caught by the error handler for some reason. die('Error when starting the app: ' . htmlentities($e->getMessage())); From b6b4dad2ec73a1d8dbfb435ff5b9e0fb201637f4 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Wed, 15 Jul 2020 23:17:23 +0200 Subject: [PATCH 11/43] Custom 404 and 405 error pages --- classes/Controller/FrontController.php | 22 ++++++++++++++++++++++ index.php | 2 ++ templates/error.tpl | 1 - 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/classes/Controller/FrontController.php b/classes/Controller/FrontController.php index 9526c0c..b292e3b 100644 --- a/classes/Controller/FrontController.php +++ b/classes/Controller/FrontController.php @@ -260,6 +260,28 @@ class FrontController extends BaseController return $response->withStatus(StatusCode::HTTP_INTERNAL_SERVER_ERROR); } + /** + * @param Request $request + * @param Response $response + * @return Response + */ + public function notFound(Request $request, Response $response) + { + return $this->displayError($request, $response, $this->localeManager->t('Page not found')) + ->withStatus(StatusCode::HTTP_NOT_FOUND); + } + + /** + * @param Request $request + * @param Response $response + * @return Response + */ + public function notAllowed(Request $request, Response $response) + { + return $this->displayError($request, $response, $this->localeManager->t('Method not allowed')) + ->withStatus(StatusCode::HTTP_METHOD_NOT_ALLOWED); + } + /** * Display an error page. * diff --git a/index.php b/index.php index 9814f47..009d13f 100644 --- a/index.php +++ b/index.php @@ -46,6 +46,8 @@ try { // Error handling. $container['errorHandler'] = [$frontController, 'error']; $container['phpErrorHandler'] = [$frontController, 'error']; + $container['notFoundHandler'] = [$frontController, 'notFound']; + $container['notAllowedHandler'] = [$frontController, 'notAllowed']; // Routes. $app->get( diff --git a/templates/error.tpl b/templates/error.tpl index 98605b8..abc8897 100644 --- a/templates/error.tpl +++ b/templates/error.tpl @@ -3,7 +3,6 @@
{include file="inc/logo.tpl"}

{t}An error occurred{/t}

- {t}Please check the URL of your video.{/t}

{$error|escape|nl2br}

{include file='inc/footer.tpl'} From 2aac009a1edad5632543e6b7ff9810b21570d765 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Wed, 15 Jul 2020 23:23:14 +0200 Subject: [PATCH 12/43] Fix ControllerTest --- tests/ControllerTest.php | 13 +++++++++---- tests/DownloadControllerTest.php | 3 ++- tests/FrontControllerTest.php | 3 ++- tests/JsonControllerTest.php | 3 ++- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/tests/ControllerTest.php b/tests/ControllerTest.php index 9b2fc1b..9e9d5fa 100644 --- a/tests/ControllerTest.php +++ b/tests/ControllerTest.php @@ -6,13 +6,16 @@ namespace Alltube\Test; +use Alltube\Config; +use Alltube\ConfigFactory; use Alltube\Controller\BaseController; use Alltube\Controller\DownloadController; use Alltube\Controller\FrontController; use Alltube\Exception\ConfigException; -use Alltube\LocaleManager; -use Alltube\LoggerFactory; +use Alltube\Exception\DependencyException; +use Alltube\LocaleManagerFactory; use Alltube\ViewFactory; +use Psr\Log\NullLogger; use Slim\Container; use Slim\Http\Environment; use Slim\Http\Request; @@ -54,6 +57,7 @@ abstract class ControllerTest extends BaseTest /** * Prepare tests. * @throws ConfigException|SmartyException + * @throws DependencyException */ protected function setUp(): void { @@ -62,9 +66,10 @@ abstract class ControllerTest extends BaseTest $this->container = new Container(); $this->request = Request::createFromEnvironment(Environment::mock()); $this->response = new Response(); - $this->container['locale'] = LocaleManager::getInstance(); + $this->container['config'] = Config::getInstance(); + $this->container['locale'] = LocaleManagerFactory::create(); $this->container['view'] = ViewFactory::create($this->container, $this->request); - $this->container['logger'] = LoggerFactory::create(); + $this->container['logger'] = new NullLogger(); $frontController = new FrontController($this->container); $downloadController = new DownloadController($this->container); diff --git a/tests/DownloadControllerTest.php b/tests/DownloadControllerTest.php index 019122b..8830d0e 100644 --- a/tests/DownloadControllerTest.php +++ b/tests/DownloadControllerTest.php @@ -9,6 +9,7 @@ namespace Alltube\Test; use Alltube\Config; use Alltube\Controller\DownloadController; use Alltube\Exception\ConfigException; +use Alltube\Exception\DependencyException; use Alltube\Library\Exception\EmptyUrlException; use Alltube\Library\Exception\RemuxException; use Alltube\Library\Exception\YoutubedlException; @@ -22,7 +23,7 @@ class DownloadControllerTest extends ControllerTest { /** * Prepare tests. - * @throws ConfigException|SmartyException + * @throws ConfigException|SmartyException|DependencyException */ protected function setUp(): void { diff --git a/tests/FrontControllerTest.php b/tests/FrontControllerTest.php index 0e2ffe0..91c4d92 100644 --- a/tests/FrontControllerTest.php +++ b/tests/FrontControllerTest.php @@ -9,6 +9,7 @@ namespace Alltube\Test; use Alltube\Config; use Alltube\Controller\FrontController; use Alltube\Exception\ConfigException; +use Alltube\Exception\DependencyException; use Alltube\Library\Exception\AlltubeLibraryException; use Exception; use Slim\Http\Environment; @@ -28,7 +29,7 @@ class FrontControllerTest extends ControllerTest /** * Prepare tests. - * @throws ConfigException|SmartyException + * @throws ConfigException|SmartyException|DependencyException */ protected function setUp(): void { diff --git a/tests/JsonControllerTest.php b/tests/JsonControllerTest.php index 438b482..1c3d254 100644 --- a/tests/JsonControllerTest.php +++ b/tests/JsonControllerTest.php @@ -8,6 +8,7 @@ namespace Alltube\Test; use Alltube\Controller\JsonController; use Alltube\Exception\ConfigException; +use Alltube\Exception\DependencyException; use Alltube\Library\Exception\YoutubedlException; use SmartyException; @@ -18,7 +19,7 @@ class JsonControllerTest extends ControllerTest { /** * Prepare tests. - * @throws ConfigException|SmartyException + * @throws ConfigException|SmartyException|DependencyException */ protected function setUp(): void { From 2dcd1239a46522eb935ddbff151db38747a3f5e3 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Mon, 20 Jul 2020 22:33:53 +0200 Subject: [PATCH 13/43] Remove dangling dependencies --- composer.lock | 489 +------------------------------------------------- 1 file changed, 6 insertions(+), 483 deletions(-) diff --git a/composer.lock b/composer.lock index 2261130..d709377 100644 --- a/composer.lock +++ b/composer.lock @@ -110,16 +110,16 @@ }, { "name": "composer/package-versions-deprecated", - "version": "1.8.1", + "version": "1.10.99", "source": { "type": "git", "url": "https://github.com/composer/package-versions-deprecated.git", - "reference": "b9805885293f3957ee0dd42616ac6915c4ac9a4b" + "reference": "dd51b4443d58b34b6d9344cf4c288e621c9a826f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b9805885293f3957ee0dd42616ac6915c4ac9a4b", - "reference": "b9805885293f3957ee0dd42616ac6915c4ac9a4b", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/dd51b4443d58b34b6d9344cf4c288e621c9a826f", + "reference": "dd51b4443d58b34b6d9344cf4c288e621c9a826f", "shasum": "" }, "require": { @@ -127,7 +127,7 @@ "php": "^7" }, "replace": { - "ocramius/package-versions": "1.8.99" + "ocramius/package-versions": "1.10.99" }, "require-dev": { "composer/composer": "^1.9.3 || ^2.0@dev", @@ -161,7 +161,7 @@ } ], "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", - "time": "2020-06-19T07:59:31+00:00" + "time": "2020-07-15T08:39:18+00:00" }, { "name": "consolidation/log", @@ -3205,483 +3205,6 @@ ], "time": "2019-08-09T12:45:53+00:00" }, - { - "name": "nette/bootstrap", - "version": "v2.4.6", - "source": { - "type": "git", - "url": "https://github.com/nette/bootstrap.git", - "reference": "268816e3f1bb7426c3a4ceec2bd38a036b532543" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/bootstrap/zipball/268816e3f1bb7426c3a4ceec2bd38a036b532543", - "reference": "268816e3f1bb7426c3a4ceec2bd38a036b532543", - "shasum": "" - }, - "require": { - "nette/di": "~2.4.7", - "nette/utils": "~2.4", - "php": ">=5.6.0" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "latte/latte": "~2.2", - "nette/application": "~2.3", - "nette/caching": "~2.3", - "nette/database": "~2.3", - "nette/forms": "~2.3", - "nette/http": "~2.4.0", - "nette/mail": "~2.3", - "nette/robot-loader": "^2.4.2 || ^3.0", - "nette/safe-stream": "~2.2", - "nette/security": "~2.3", - "nette/tester": "~2.0", - "tracy/tracy": "^2.4.1" - }, - "suggest": { - "nette/robot-loader": "to use Configurator::createRobotLoader()", - "tracy/tracy": "to use Configurator::enableTracy()" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "? Nette Bootstrap: the simple way to configure and bootstrap your Nette application.", - "homepage": "https://nette.org", - "keywords": [ - "bootstrapping", - "configurator", - "nette" - ], - "time": "2018-05-17T12:52:20+00:00" - }, - { - "name": "nette/di", - "version": "v2.4.15", - "source": { - "type": "git", - "url": "https://github.com/nette/di.git", - "reference": "d0561b8f77e8ef2ed6d83328860e16c81a5a8649" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/di/zipball/d0561b8f77e8ef2ed6d83328860e16c81a5a8649", - "reference": "d0561b8f77e8ef2ed6d83328860e16c81a5a8649", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "nette/neon": "^2.3.3 || ~3.0.0", - "nette/php-generator": "^2.6.1 || ^3.0.0", - "nette/utils": "^2.5.0 || ~3.0.0", - "php": ">=5.6.0" - }, - "conflict": { - "nette/bootstrap": "<2.4", - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "^2.0", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "? Nette Dependency Injection Container: Flexible, compiled and full-featured DIC with perfectly usable autowiring and support for all new PHP 7.1 features.", - "homepage": "https://nette.org", - "keywords": [ - "compiled", - "di", - "dic", - "factory", - "ioc", - "nette", - "static" - ], - "time": "2019-01-30T13:26:05+00:00" - }, - { - "name": "nette/finder", - "version": "v2.4.2", - "source": { - "type": "git", - "url": "https://github.com/nette/finder.git", - "reference": "ee951a656cb8ac622e5dd33474a01fd2470505a0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/finder/zipball/ee951a656cb8ac622e5dd33474a01fd2470505a0", - "reference": "ee951a656cb8ac622e5dd33474a01fd2470505a0", - "shasum": "" - }, - "require": { - "nette/utils": "~2.4", - "php": ">=5.6.0" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "~2.0", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "? Nette Finder: find files and directories with an intuitive API.", - "homepage": "https://nette.org", - "keywords": [ - "filesystem", - "glob", - "iterator", - "nette" - ], - "time": "2018-06-28T11:49:23+00:00" - }, - { - "name": "nette/neon", - "version": "v3.0.0", - "source": { - "type": "git", - "url": "https://github.com/nette/neon.git", - "reference": "cbff32059cbdd8720deccf9e9eace6ee516f02eb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/neon/zipball/cbff32059cbdd8720deccf9e9eace6ee516f02eb", - "reference": "cbff32059cbdd8720deccf9e9eace6ee516f02eb", - "shasum": "" - }, - "require": { - "ext-iconv": "*", - "ext-json": "*", - "php": ">=7.0" - }, - "require-dev": { - "nette/tester": "^2.0", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "? Nette NEON: encodes and decodes NEON file format.", - "homepage": "http://ne-on.org", - "keywords": [ - "export", - "import", - "neon", - "nette", - "yaml" - ], - "time": "2019-02-05T21:30:40+00:00" - }, - { - "name": "nette/php-generator", - "version": "v3.0.5", - "source": { - "type": "git", - "url": "https://github.com/nette/php-generator.git", - "reference": "ea90209c2e8a7cd087b2742ca553c047a8df5eff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/php-generator/zipball/ea90209c2e8a7cd087b2742ca553c047a8df5eff", - "reference": "ea90209c2e8a7cd087b2742ca553c047a8df5eff", - "shasum": "" - }, - "require": { - "nette/utils": "^2.4.2 || ~3.0.0", - "php": ">=7.0" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "^2.0", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "? Nette PHP Generator: generates neat PHP code for you. Supports new PHP 7.2 features.", - "homepage": "https://nette.org", - "keywords": [ - "code", - "nette", - "php", - "scaffolding" - ], - "time": "2018-08-09T14:32:27+00:00" - }, - { - "name": "nette/robot-loader", - "version": "v3.1.1", - "source": { - "type": "git", - "url": "https://github.com/nette/robot-loader.git", - "reference": "3e8d75d6d976e191bdf46752ca40a286671219d2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/robot-loader/zipball/3e8d75d6d976e191bdf46752ca40a286671219d2", - "reference": "3e8d75d6d976e191bdf46752ca40a286671219d2", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "nette/finder": "^2.3 || ^3.0", - "nette/utils": "^2.4 || ^3.0", - "php": ">=5.6.0" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "^2.0", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "? Nette RobotLoader: high performance and comfortable autoloader that will search and autoload classes within your application.", - "homepage": "https://nette.org", - "keywords": [ - "autoload", - "class", - "interface", - "nette", - "trait" - ], - "time": "2019-03-01T20:23:02+00:00" - }, - { - "name": "nette/utils", - "version": "v2.5.3", - "source": { - "type": "git", - "url": "https://github.com/nette/utils.git", - "reference": "17b9f76f2abd0c943adfb556e56f2165460b15ce" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/17b9f76f2abd0c943adfb556e56f2165460b15ce", - "reference": "17b9f76f2abd0c943adfb556e56f2165460b15ce", - "shasum": "" - }, - "require": { - "php": ">=5.6.0" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "~2.0", - "tracy/tracy": "^2.3" - }, - "suggest": { - "ext-gd": "to use Image", - "ext-iconv": "to use Strings::webalize() and toAscii()", - "ext-intl": "for script transliteration in Strings::webalize() and toAscii()", - "ext-json": "to use Nette\\Utils\\Json", - "ext-mbstring": "to use Strings::lower() etc...", - "ext-xml": "to use Strings::length() etc. when mbstring is not available" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ], - "files": [ - "src/loader.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "? Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.", - "homepage": "https://nette.org", - "keywords": [ - "array", - "core", - "datetime", - "images", - "json", - "nette", - "paginator", - "password", - "slugify", - "string", - "unicode", - "utf-8", - "utility", - "validation" - ], - "time": "2018-09-18T10:22:16+00:00" - }, { "name": "phar-io/manifest", "version": "1.0.3", From 3ba720dce06a0e364a59be55d81841549e77e060 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Mon, 20 Jul 2020 23:03:28 +0200 Subject: [PATCH 14/43] Get open-sans from Packagist So we can stop requiring Asset Packagist --- composer.json | 6 +----- composer.lock | 43 +++++++++++++++++++++++------------------- css/fonts.css | 20 -------------------- css/style.css | 8 ++++++++ templates/inc/head.tpl | 2 +- 5 files changed, 34 insertions(+), 45 deletions(-) delete mode 100644 css/fonts.css diff --git a/composer.json b/composer.json index 09f755a..904bb0b 100644 --- a/composer.json +++ b/composer.json @@ -27,12 +27,12 @@ "jawira/case-converter": "^3.4", "jean85/pretty-package-versions": "^1.3", "mathmarques/smarty-view": "^1.1", - "npm-asset/open-sans-fontface": "^1.4", "rinvex/countries": "^6.1", "rudloff/alltube-library": "dev-develop", "symfony/finder": "^5.0", "symfony/translation": "^4.0", "symfony/yaml": "^4.0", + "webfontkit/open-sans": "^1.0", "ytdl-org/youtube-dl": "^2020.06", "zonuexe/http-accept-language": "^0.4.1" }, @@ -66,10 +66,6 @@ } }, "repositories": [ - { - "type": "composer", - "url": "https://asset-packagist.org" - }, { "type": "package", "package": { diff --git a/composer.lock b/composer.lock index d709377..37c4679 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d0a5c7e93a6d08ce781d72a85dff85ab", + "content-hash": "33751d511fe2a384c6fa74542d7defb1", "packages": [ { "name": "aura/session", @@ -618,24 +618,6 @@ ], "time": "2018-02-13T20:26:39+00:00" }, - { - "name": "npm-asset/open-sans-fontface", - "version": "1.4.2", - "source": { - "type": "git", - "url": "https://github.com/FontFaceKit/open-sans.git", - "reference": "2285c0300e6a4c8b102b98fb030fb38c26aa081c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/FontFaceKit/open-sans/zipball/2285c0300e6a4c8b102b98fb030fb38c26aa081c", - "reference": "2285c0300e6a4c8b102b98fb030fb38c26aa081c" - }, - "type": "npm-asset", - "license": [ - "Apache License version 2.0" - ] - }, { "name": "pimple/pimple", "version": "v3.3.0", @@ -1833,6 +1815,29 @@ "homepage": "https://symfony.com", "time": "2019-11-12T14:51:11+00:00" }, + { + "name": "webfontkit/open-sans", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/webfontkit/open-sans.git", + "reference": "00ab31e690edfd0d88f9ffbcd998cf298b9687e9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webfontkit/open-sans/zipball/00ab31e690edfd0d88f9ffbcd998cf298b9687e9", + "reference": "00ab31e690edfd0d88f9ffbcd998cf298b9687e9", + "shasum": "" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Open Sans is a humanist sans serif typeface designed by Steve Matteson, Type Director of Ascender Corp. This version contains the complete 897 character set, which includes the standard ISO Latin 1, Latin CE, Greek and Cyrillic character sets. Open Sans was designed with an upright stress, open forms and a neutral, yet friendly appearance. It was optimized for print, web, and mobile interfaces, and has excellent legibility characteristics in its letterforms.", + "homepage": "http://www.google.com/fonts/specimen/Open+Sans", + "time": "2014-08-20T20:43:34+00:00" + }, { "name": "ytdl-org/youtube-dl", "version": "2020.06.16.1", diff --git a/css/fonts.css b/css/fonts.css deleted file mode 100644 index 0bda134..0000000 --- a/css/fonts.css +++ /dev/null @@ -1,20 +0,0 @@ -@font-face { - font-family: 'Open Sans'; - font-style: normal; - font-weight: 300; - src: local('Open Sans Light'), local('OpenSans-Light'), url(../vendor/npm-asset/open-sans-fontface/fonts/Light/OpenSans-Regular.ttf); -} -@font-face { - font-family: 'Open Sans'; - font-style: normal; - font-weight: 400; - src: local('Open Sans'), local('OpenSans'), url(../vendor/npm-asset/open-sans-fontface/fonts/Regular/OpenSans-Regular.ttf); -} - -.small-font { - font-size: 13px; -} - -.large-font { - font-size:24px; -} diff --git a/css/style.css b/css/style.css index 482ff25..8e6c098 100644 --- a/css/style.css +++ b/css/style.css @@ -6,6 +6,14 @@ body { text-align: center; } +.small-font { + font-size: 13px; +} + +.large-font { + font-size:24px; +} + /* Header */ header { diff --git a/templates/inc/head.tpl b/templates/inc/head.tpl index 7b2f3d4..db940f5 100644 --- a/templates/inc/head.tpl +++ b/templates/inc/head.tpl @@ -8,7 +8,7 @@ {/if} - + {$config->appName}{if isset($title)} - {$title|escape}{/if} From d38b1cd9aa3243053c8f1fa068ed504defc1d510 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Tue, 1 Sep 2020 12:47:06 +0200 Subject: [PATCH 15/43] composer-dangling-locked-deps --- composer.json | 1 + composer.lock | 42 +++++++++++++++++++++++++++++++++++++++++- grumphp.yml | 8 ++++++++ 3 files changed, 50 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 904bb0b..609eba2 100644 --- a/composer.json +++ b/composer.json @@ -39,6 +39,7 @@ "require-dev": { "consolidation/robo": "^2.1", "ergebnis/composer-normalize": "^2.6", + "insite/composer-dangling-locked-deps": "^0.1.2", "php-mock/php-mock-mockery": "^1.3", "phpro/grumphp": "^0.18.0", "phpstan/phpstan": "^0.12.25", diff --git a/composer.lock b/composer.lock index 37c4679..5d9ea74 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "33751d511fe2a384c6fa74542d7defb1", + "content-hash": "0e2a7ead8c864965d75c0ed7f3868c51", "packages": [ { "name": "aura/session", @@ -2834,6 +2834,45 @@ ], "time": "2016-01-20T08:20:44+00:00" }, + { + "name": "insite/composer-dangling-locked-deps", + "version": "0.1.2", + "source": { + "type": "git", + "url": "https://github.com/prudloff-insite/composer-dangling-locked-deps.git", + "reference": "3e5b6bef90eeb0ed0203533b4daa78bffa7a74ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/prudloff-insite/composer-dangling-locked-deps/zipball/3e5b6bef90eeb0ed0203533b4daa78bffa7a74ad", + "reference": "3e5b6bef90eeb0ed0203533b4daa78bffa7a74ad", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1|^2.0", + "ocramius/package-versions": "^1.4" + }, + "require-dev": { + "composer/composer": "^1.10", + "phpro/grumphp": "^0.16.2" + }, + "type": "composer-plugin", + "extra": { + "class": "ComposerDanglingLockedDeps\\DanglingLockedDepsPlugin" + }, + "autoload": { + "psr-4": { + "ComposerDanglingLockedDeps\\": "src/", + "ComposerDanglingLockedDeps\\GrumPHP\\": "src/grumphp/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "description": "Detect dangling Composer locked dependencies", + "time": "2020-09-01T08:16:17+00:00" + }, { "name": "justinrainbow/json-schema", "version": "5.2.10", @@ -4089,6 +4128,7 @@ "keywords": [ "tokenizer" ], + "abandoned": true, "time": "2019-09-17T06:23:10+00:00" }, { diff --git a/grumphp.yml b/grumphp.yml index 30f207b..0b1d394 100644 --- a/grumphp.yml +++ b/grumphp.yml @@ -1,4 +1,11 @@ --- +services: + ComposerDanglingLockedDeps\GrumPHP\ComposerDanglingLockedDeps: + arguments: + - '@process_builder' + - '@formatter.raw_process' + tags: + - {name: grumphp.task, task: composer_dangling_locked_deps} parameters: ascii: ~ tasks: @@ -8,6 +15,7 @@ parameters: composer: ~ securitychecker: ~ composer_normalize: ~ + composer_dangling_locked_deps: ~ phpcs: standard: PSR12 phpstan: From 8d15fbdda298c4f34574f91eec5ceab7f17c309c Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 27 Sep 2020 15:53:53 +0200 Subject: [PATCH 16/43] Lint --- classes/Config.php | 4 ++-- classes/Controller/BaseController.php | 2 +- classes/Controller/FrontController.php | 2 +- classes/Locale.php | 2 +- classes/LocaleManager.php | 14 +++++++++----- classes/Stream/PlaylistArchiveStream.php | 10 +++++----- classes/Stream/YoutubeChunkStream.php | 8 ++++---- classes/UglyRouter.php | 2 +- classes/ViewFactory.php | 2 +- 9 files changed, 25 insertions(+), 21 deletions(-) diff --git a/classes/Config.php b/classes/Config.php index a37497e..c2fd010 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -185,7 +185,7 @@ class Config * * @return string */ - public static function addHttpToFormat($format) + public static function addHttpToFormat(string $format) { $newFormat = []; foreach (explode('/', $format) as $subformat) { @@ -279,7 +279,7 @@ class Config * @return void * @throws ConfigException */ - public static function setFile($file) + public static function setFile(string $file) { if (is_file($file)) { $options = Yaml::parse(strval(file_get_contents($file))); diff --git a/classes/Controller/BaseController.php b/classes/Controller/BaseController.php index a152f11..0a3bced 100644 --- a/classes/Controller/BaseController.php +++ b/classes/Controller/BaseController.php @@ -144,7 +144,7 @@ abstract class BaseController * * @return Response HTTP response */ - protected function displayError(Request $request, Response $response, $message) + protected function displayError(Request $request, Response $response, string $message) { $controller = new FrontController($this->container); diff --git a/classes/Controller/FrontController.php b/classes/Controller/FrontController.php index b292e3b..5f06568 100644 --- a/classes/Controller/FrontController.php +++ b/classes/Controller/FrontController.php @@ -242,7 +242,7 @@ class FrontController extends BaseController * * @return Response HTTP response */ - protected function displayError(Request $request, Response $response, $message) + protected function displayError(Request $request, Response $response, string $message) { $this->view->render( $response, diff --git a/classes/Locale.php b/classes/Locale.php index f8ebf2f..9e81180 100644 --- a/classes/Locale.php +++ b/classes/Locale.php @@ -34,7 +34,7 @@ class Locale * * @param string $locale ISO 15897 code */ - public function __construct($locale) + public function __construct(string $locale) { $parse = AcceptLanguage::parse($locale); $this->language = $parse[1]['language']; diff --git a/classes/LocaleManager.php b/classes/LocaleManager.php index 861ddf2..b008d8a 100644 --- a/classes/LocaleManager.php +++ b/classes/LocaleManager.php @@ -142,11 +142,11 @@ class LocaleManager * Smarty "t" block. * * @param mixed[] $params Block parameters - * @param string $text Block content + * @param string|null $text Block content * * @return string Translated string */ - public function smartyTranslate(array $params, $text) + public function smartyTranslate(array $params, string $text = null) { if (isset($params['params'])) { return $this->t($text, $params['params']); @@ -158,14 +158,18 @@ class LocaleManager /** * Translate a string. * - * @param string $string String to translate + * @param string|null $string $string String to translate * * @param mixed[] $params * @return string Translated string */ - public function t($string, array $params = []) + public function t(string $string = null, array $params = []) { - return $this->translator->trans($string, $params); + if (isset($string)) { + return $this->translator->trans($string, $params); + } + + return ''; } /** diff --git a/classes/Stream/PlaylistArchiveStream.php b/classes/Stream/PlaylistArchiveStream.php index d55e554..1bf08ff 100644 --- a/classes/Stream/PlaylistArchiveStream.php +++ b/classes/Stream/PlaylistArchiveStream.php @@ -79,7 +79,7 @@ class PlaylistArchiveStream extends ZipArchive implements StreamInterface /** * Add data to the archive. * - * @param string $data Data + * @param mixed $data Data * * @return void */ @@ -99,7 +99,7 @@ class PlaylistArchiveStream extends ZipArchive implements StreamInterface /** * Write data to the stream. * - * @param string $string The string that is to be written + * @param mixed $string The string that is to be written * * @return int|false */ @@ -171,7 +171,7 @@ class PlaylistArchiveStream extends ZipArchive implements StreamInterface /** * Get stream metadata as an associative array or retrieve a specific key. * - * @param string $key string $key Specific metadata to retrieve. + * @param string|null $key string $key Specific metadata to retrieve. * * @return array|mixed|null */ @@ -228,7 +228,7 @@ class PlaylistArchiveStream extends ZipArchive implements StreamInterface /** * Seek to a position in the stream. * - * @param int $offset Offset + * @param mixed $offset Offset * @param int $whence Specifies how the cursor position will be calculated * * @return void @@ -272,7 +272,7 @@ class PlaylistArchiveStream extends ZipArchive implements StreamInterface /** * Read data from the stream. * - * @param int $count Number of bytes to read + * @param mixed $count Number of bytes to read * * @return string|false * @throws AlltubeLibraryException diff --git a/classes/Stream/YoutubeChunkStream.php b/classes/Stream/YoutubeChunkStream.php index c99f422..bf64c0a 100644 --- a/classes/Stream/YoutubeChunkStream.php +++ b/classes/Stream/YoutubeChunkStream.php @@ -35,7 +35,7 @@ class YoutubeChunkStream implements StreamInterface /** * Read data from the stream. * - * @param int $length Read up to $length bytes from the object and return + * @param mixed $length Read up to $length bytes from the object and return * * @return string */ @@ -121,7 +121,7 @@ class YoutubeChunkStream implements StreamInterface /** * Seek to a position in the stream. * - * @param int $offset Stream offset + * @param mixed $offset Stream offset * @param int $whence Specifies how the cursor position will be calculated * * @return void @@ -154,7 +154,7 @@ class YoutubeChunkStream implements StreamInterface /** * Write data to the stream. * - * @param string $string The string that is to be written + * @param mixed $string The string that is to be written * * @return mixed */ @@ -186,7 +186,7 @@ class YoutubeChunkStream implements StreamInterface /** * Get stream metadata as an associative array or retrieve a specific key. * - * @param string $key Specific metadata to retrieve. + * @param string|null $key Specific metadata to retrieve. * * @return array|mixed|null */ diff --git a/classes/UglyRouter.php b/classes/UglyRouter.php index a5b1020..235ece0 100644 --- a/classes/UglyRouter.php +++ b/classes/UglyRouter.php @@ -42,7 +42,7 @@ class UglyRouter extends Router /** * Build the path for a named route including the base path. * - * @param string $name Route name + * @param mixed $name Route name * @param string[] $data Named argument replacement data * @param string[] $queryParams Optional query string parameters * diff --git a/classes/ViewFactory.php b/classes/ViewFactory.php index e5c0bb7..b082798 100644 --- a/classes/ViewFactory.php +++ b/classes/ViewFactory.php @@ -21,7 +21,7 @@ class ViewFactory * Create Smarty view object. * * @param ContainerInterface $container Slim dependency container - * @param Request $request PSR-7 request + * @param Request|null $request PSR-7 request * * @return Smarty * @throws SmartyException From 4bd121cda2f05cc4efdc0958a9c936a24e8406cb Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 27 Sep 2020 19:50:12 +0200 Subject: [PATCH 17/43] Disable timeout for "composer test" --- composer.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 609eba2..8cc4311 100644 --- a/composer.json +++ b/composer.json @@ -82,7 +82,10 @@ "scripts": { "lint": "grumphp run --ansi", "release": "robo release --ansi", - "test": "phpunit", + "test": [ + "Composer\\Config::disableProcessTimeout", + "phpunit" + ], "update-locales": [ "tsmarty2c.php templates > i18n/template.pot", "xgettext --omit-header -kt -j -o i18n/template.pot classes/*.php classes/*/*.php" From f9aab3c404ef63cd7f741e490ff3661b3a2b2bd8 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 27 Sep 2020 19:56:19 +0200 Subject: [PATCH 18/43] Lint --- tests/ControllerTest.php | 11 +++++----- tests/VideoTest.php | 44 +++++++++++++++++++++------------------- 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/tests/ControllerTest.php b/tests/ControllerTest.php index 9e9d5fa..cf9a7b7 100644 --- a/tests/ControllerTest.php +++ b/tests/ControllerTest.php @@ -7,7 +7,6 @@ namespace Alltube\Test; use Alltube\Config; -use Alltube\ConfigFactory; use Alltube\Controller\BaseController; use Alltube\Controller\DownloadController; use Alltube\Controller\FrontController; @@ -94,7 +93,7 @@ abstract class ControllerTest extends BaseTest * * @return Response HTTP response */ - protected function getRequestResult($request, array $params) + protected function getRequestResult(string $request, array $params) { return $this->controller->$request( $this->request->withQueryParams($params), @@ -110,7 +109,7 @@ abstract class ControllerTest extends BaseTest * * @return void */ - protected function assertRequestIsOk($request, array $params = []) + protected function assertRequestIsOk(string $request, array $params = []) { $this->assertTrue($this->getRequestResult($request, $params)->isOk()); } @@ -123,7 +122,7 @@ abstract class ControllerTest extends BaseTest * * @return void */ - protected function assertRequestIsRedirect($request, array $params = []) + protected function assertRequestIsRedirect(string $request, array $params = []) { $this->assertTrue($this->getRequestResult($request, $params)->isRedirect()); } @@ -136,7 +135,7 @@ abstract class ControllerTest extends BaseTest * * @return void */ - protected function assertRequestIsServerError($request, array $params = []) + protected function assertRequestIsServerError(string $request, array $params = []) { $this->assertTrue($this->getRequestResult($request, $params)->isServerError()); } @@ -149,7 +148,7 @@ abstract class ControllerTest extends BaseTest * * @return void */ - protected function assertRequestIsClientError($request, array $params = []) + protected function assertRequestIsClientError(string $request, array $params = []) { $this->assertTrue($this->getRequestResult($request, $params)->isClientError()); } diff --git a/tests/VideoTest.php b/tests/VideoTest.php index 7f58516..75aeeca 100644 --- a/tests/VideoTest.php +++ b/tests/VideoTest.php @@ -141,7 +141,7 @@ class VideoTest extends BaseTest * @throws AlltubeLibraryException * @dataProvider ErrorUrlProvider */ - public function testgetUrlError($url) + public function testgetUrlError(string $url) { $this->expectException(YoutubedlException::class); $video = new Video($this->downloader, $url, $this->format); @@ -258,7 +258,7 @@ class VideoTest extends BaseTest * @dataProvider urlProvider * @dataProvider m3uUrlProvider */ - public function testGetJson($url, $format) + public function testGetJson(string $url, string $format) { $video = new Video($this->downloader, $url, $format); $info = $video->getJson(); @@ -279,7 +279,7 @@ class VideoTest extends BaseTest * @throws AlltubeLibraryException * @dataProvider ErrorURLProvider */ - public function testGetJsonError($url) + public function testGetJsonError(string $url) { $this->expectException(YoutubedlException::class); $video = new Video($this->downloader, $url, $this->format); @@ -300,7 +300,7 @@ class VideoTest extends BaseTest * @dataProvider m3uUrlProvider * @dataProvider remuxUrlProvider */ - public function testGetFilename($url, $format, $filename, $extension) + public function testGetFilename(string $url, string $format, string $filename, string $extension) { $video = new Video($this->downloader, $url, $format); $this->assertEquals($video->getFilename(), $filename . '.' . $extension); @@ -315,7 +315,7 @@ class VideoTest extends BaseTest * @throws AlltubeLibraryException * @dataProvider ErrorUrlProvider */ - public function testGetFilenameError($url) + public function testGetFilenameError(string $url) { $this->expectException(YoutubedlException::class); $video = new Video($this->downloader, $url, $this->format); @@ -329,10 +329,10 @@ class VideoTest extends BaseTest * @param string $format Format * * @return void - * @dataProvider urlProvider * @throws AlltubeLibraryException + * @dataProvider urlProvider */ - public function testGetAudioStream($url, $format) + public function testGetAudioStream(string $url, string $format) { $video = new Video($this->downloader, $url, $format); $this->assertStream($this->downloader->getAudioStream($video)); @@ -345,10 +345,11 @@ class VideoTest extends BaseTest * @param string $format Format * * @return void - * @throws AlltubeLibraryException|ConfigException + * @throws AlltubeLibraryException + * @throws ConfigException * @dataProvider urlProvider */ - public function testGetAudioStreamFfmpegError($url, $format) + public function testGetAudioStreamFfmpegError(string $url, string $format) { $this->expectException(AvconvException::class); Config::setOptions(['ffmpeg' => 'foobar']); @@ -369,7 +370,7 @@ class VideoTest extends BaseTest * @throws AlltubeLibraryException * @dataProvider m3uUrlProvider */ - public function testGetAudioStreamM3uError($url, $format) + public function testGetAudioStreamM3uError(string $url, string $format) { $this->expectException(InvalidProtocolConversionException::class); $video = new Video($this->downloader, $url, $format); @@ -426,10 +427,10 @@ class VideoTest extends BaseTest * @param string $format Format * * @return void - * @dataProvider m3uUrlProvider * @throws AlltubeLibraryException + * @dataProvider m3uUrlProvider */ - public function testGetM3uStream($url, $format) + public function testGetM3uStream(string $url, string $format) { $video = new Video($this->downloader, $url, $format); $this->assertStream($this->downloader->getM3uStream($video)); @@ -442,10 +443,10 @@ class VideoTest extends BaseTest * @param string $format Format * * @return void - * @dataProvider remuxUrlProvider * @throws AlltubeLibraryException + * @dataProvider remuxUrlProvider */ - public function testGetRemuxStream($url, $format) + public function testGetRemuxStream(string $url, string $format) { $video = new Video($this->downloader, $url, $format); $this->assertStream($this->downloader->getRemuxStream($video)); @@ -461,7 +462,7 @@ class VideoTest extends BaseTest * @throws AlltubeLibraryException * @dataProvider urlProvider */ - public function testGetRemuxStreamWithWrongVideo($url, $format) + public function testGetRemuxStreamWithWrongVideo(string $url, string $format) { $this->expectException(RemuxException::class); $video = new Video($this->downloader, $url, $format); @@ -478,7 +479,7 @@ class VideoTest extends BaseTest * @throws AlltubeLibraryException * @dataProvider rtmpUrlProvider */ - public function testGetRtmpStream($url, $format) + public function testGetRtmpStream(string $url, string $format) { $this->markTestIncomplete('We need to find another RTMP video.'); @@ -494,10 +495,11 @@ class VideoTest extends BaseTest * @param string $format Format * * @return void - * @throws AlltubeLibraryException|ConfigException + * @throws AlltubeLibraryException + * @throws ConfigException * @dataProvider m3uUrlProvider */ - public function testGetM3uStreamFfmpegError($url, $format) + public function testGetM3uStreamFfmpegError(string $url, string $format) { $this->expectException(AvconvException::class); Config::setOptions(['ffmpeg' => 'foobar']); @@ -515,10 +517,10 @@ class VideoTest extends BaseTest * @param string $format Format * * @return void - * @dataProvider urlProvider * @throws AlltubeLibraryException + * @dataProvider urlProvider */ - public function testGetConvertedStream($url, $format) + public function testGetConvertedStream(string $url, string $format) { $video = new Video($this->downloader, $url, $format); $this->assertStream($this->downloader->getConvertedStream($video, 32, 'flv')); @@ -534,7 +536,7 @@ class VideoTest extends BaseTest * @throws AlltubeLibraryException * @dataProvider m3uUrlProvider */ - public function testGetConvertedStreamM3uError($url, $format) + public function testGetConvertedStreamM3uError(string $url, string $format) { $this->expectException(InvalidProtocolConversionException::class); $video = new Video($this->downloader, $url, $format); From 2e8350ce1a8326866ea020597a89fd93c72a9193 Mon Sep 17 00:00:00 2001 From: bellington3 <71927099+bellington3@users.noreply.github.com> Date: Tue, 29 Sep 2020 22:07:20 +0000 Subject: [PATCH 19/43] Provide config toggle to set 'audio' conversion on as default (#310) * Provide config toggle to set 'audio' conversion on as default * Fix git cherry pick mistake * Update templates/index.tpl Co-authored-by: Pierre Rudloff * Add default audio config option to config.example Co-authored-by: Pierre Rudloff --- classes/Config.php | 7 +++++++ config/config.example.yml | 3 +++ templates/index.tpl | 2 +- tests/ConfigTest.php | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/classes/Config.php b/classes/Config.php index c2fd010..56a0fe4 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -140,6 +140,13 @@ class Config */ public $debug = false; + /** + * Default to audio. + * + * @var bool + */ + public $defaultAudio = false; + /** * Config constructor. * diff --git a/config/config.example.yml b/config/config.example.yml index 8aeb99a..29511a2 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -55,3 +55,6 @@ genericFormats: # Enable debug mode. debug: false + +# True to enable audio conversion mode by default +defaultAudio: false diff --git a/templates/index.tpl b/templates/index.tpl index 21e11d4..c606933 100644 --- a/templates/index.tpl +++ b/templates/index.tpl @@ -20,7 +20,7 @@ {if $config->convert}
- + defaultAudio) ? 'checked' : ''}> diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index e0fe7d8..5677e5c 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -75,6 +75,7 @@ class ConfigTest extends BaseTest $this->assertIsBool($config->uglyUrls); $this->assertIsBool($config->stream); $this->assertIsBool($config->remux); + $this->assertIsBool($config->defaultAudio); $this->assertIsInt($config->audioBitrate); } From 8ab2ed838b71c5696e5972ddafe9151a68cbe1a3 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Fri, 9 Oct 2020 23:37:12 +0200 Subject: [PATCH 20/43] Upgrade composer-dangling-locked-deps to 0.2 --- composer.json | 2 +- composer.lock | 14 +++++++------- grumphp.yml | 9 ++------- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/composer.json b/composer.json index 8cc4311..045dd36 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,7 @@ "require-dev": { "consolidation/robo": "^2.1", "ergebnis/composer-normalize": "^2.6", - "insite/composer-dangling-locked-deps": "^0.1.2", + "insite/composer-dangling-locked-deps": "^0.2.0", "php-mock/php-mock-mockery": "^1.3", "phpro/grumphp": "^0.18.0", "phpstan/phpstan": "^0.12.25", diff --git a/composer.lock b/composer.lock index 5d9ea74..ea09cc8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0e2a7ead8c864965d75c0ed7f3868c51", + "content-hash": "b4620291428c1396460522b3b5c0eebe", "packages": [ { "name": "aura/session", @@ -2836,16 +2836,16 @@ }, { "name": "insite/composer-dangling-locked-deps", - "version": "0.1.2", + "version": "0.2.0", "source": { "type": "git", "url": "https://github.com/prudloff-insite/composer-dangling-locked-deps.git", - "reference": "3e5b6bef90eeb0ed0203533b4daa78bffa7a74ad" + "reference": "373820e7680f2e98e1fe8259f04474cea5745806" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/prudloff-insite/composer-dangling-locked-deps/zipball/3e5b6bef90eeb0ed0203533b4daa78bffa7a74ad", - "reference": "3e5b6bef90eeb0ed0203533b4daa78bffa7a74ad", + "url": "https://api.github.com/repos/prudloff-insite/composer-dangling-locked-deps/zipball/373820e7680f2e98e1fe8259f04474cea5745806", + "reference": "373820e7680f2e98e1fe8259f04474cea5745806", "shasum": "" }, "require": { @@ -2854,7 +2854,7 @@ }, "require-dev": { "composer/composer": "^1.10", - "phpro/grumphp": "^0.16.2" + "phpro/grumphp": "^0.21.0" }, "type": "composer-plugin", "extra": { @@ -2871,7 +2871,7 @@ "GPL-2.0-or-later" ], "description": "Detect dangling Composer locked dependencies", - "time": "2020-09-01T08:16:17+00:00" + "time": "2020-10-05T10:24:52+00:00" }, { "name": "justinrainbow/json-schema", diff --git a/grumphp.yml b/grumphp.yml index 0b1d394..f04c254 100644 --- a/grumphp.yml +++ b/grumphp.yml @@ -1,12 +1,7 @@ --- -services: - ComposerDanglingLockedDeps\GrumPHP\ComposerDanglingLockedDeps: - arguments: - - '@process_builder' - - '@formatter.raw_process' - tags: - - {name: grumphp.task, task: composer_dangling_locked_deps} parameters: + extensions: + - ComposerDanglingLockedDeps\GrumPHP\Loader ascii: ~ tasks: jsonlint: ~ From 79ec6aee099a5b1f99ab32ef23fcb477cddea1b3 Mon Sep 17 00:00:00 2001 From: NOOB BOTS Date: Sat, 10 Oct 2020 17:04:01 +0530 Subject: [PATCH 21/43] migrating to python 3 (#312) * migrating to python 3 python2 is going obsolete soon.so a small change to use python3 in heroku * changed python version --- runtime.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime.txt b/runtime.txt index b334cca..0fd6938 100644 --- a/runtime.txt +++ b/runtime.txt @@ -1 +1 @@ -python-2.7.17 +python-3.8.6 From 5ee9d457b24fb17949312a23fdb2c030753a1e44 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 10 Oct 2020 23:03:40 +0200 Subject: [PATCH 22/43] Upgrade youtube-dl to 2020.09 (fixes #300) --- composer.json | 6 +++--- composer.lock | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 045dd36..ec460d2 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ "symfony/translation": "^4.0", "symfony/yaml": "^4.0", "webfontkit/open-sans": "^1.0", - "ytdl-org/youtube-dl": "^2020.06", + "ytdl-org/youtube-dl": "^2020.09", "zonuexe/http-accept-language": "^0.4.1" }, "require-dev": { @@ -71,10 +71,10 @@ "type": "package", "package": { "name": "ytdl-org/youtube-dl", - "version": "2020.06.16.1", + "version": "2020.09.20", "dist": { "type": "zip", - "url": "https://github.com/ytdl-org/youtube-dl/archive/2020.06.16.1.zip" + "url": "https://github.com/ytdl-org/youtube-dl/archive/2020.09.20.zip" } } } diff --git a/composer.lock b/composer.lock index ea09cc8..96f5372 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b4620291428c1396460522b3b5c0eebe", + "content-hash": "7e756e8b0f372bd5a914c54310933ecb", "packages": [ { "name": "aura/session", @@ -1840,10 +1840,10 @@ }, { "name": "ytdl-org/youtube-dl", - "version": "2020.06.16.1", + "version": "2020.09.20", "dist": { "type": "zip", - "url": "https://github.com/ytdl-org/youtube-dl/archive/2020.06.16.1.zip" + "url": "https://github.com/ytdl-org/youtube-dl/archive/2020.09.20.zip" }, "type": "library" }, From bfdb349a2bb4fb26f3b3fd36c59954624083226b Mon Sep 17 00:00:00 2001 From: NOOB BOTS Date: Wed, 14 Oct 2020 00:07:31 +0530 Subject: [PATCH 23/43] heroku-docker-fix (#318) * Fixed heroku docker startup moved to resources folder for clean environment * added heroku.yml for Docker deployment to heroku * Update heroku.yml fixed correct executing path * Update heroku-docker-start.sh * Update heroku.yml Co-authored-by: Pierre Rudloff Co-authored-by: Pierre Rudloff --- heroku.yml | 5 +++++ resources/heroku-docker-start.sh | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 heroku.yml create mode 100644 resources/heroku-docker-start.sh diff --git a/heroku.yml b/heroku.yml new file mode 100644 index 0000000..03e1ca2 --- /dev/null +++ b/heroku.yml @@ -0,0 +1,5 @@ +build: + docker: + web: Dockerfile +run: + web: bash /var/www/html/resources/heroku-docker-start.sh diff --git a/resources/heroku-docker-start.sh b/resources/heroku-docker-start.sh new file mode 100644 index 0000000..aed1dbd --- /dev/null +++ b/resources/heroku-docker-start.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +a2dismod mpm_event +sed -i "s/Listen 80/Listen ${PORT:-80}/g" /etc/apache2/ports.conf +apache2-foreground "$@" From 83863bd66c2aab86f4a99f84521e49cc2bc0b8a7 Mon Sep 17 00:00:00 2001 From: bellington3 <71927099+bellington3@users.noreply.github.com> Date: Sat, 17 Oct 2020 12:14:36 +0000 Subject: [PATCH 24/43] Provide config toggle to disable the 'convert seek' function (#311) * Provide config toggle to disable the 'convert seek' function in the frontend * Add convertSeek config option to config.example * Only send from/to if convertSeek is activated --- classes/Config.php | 7 +++++++ classes/Controller/DownloadController.php | 8 ++++++-- config/config.example.yml | 3 +++ templates/index.tpl | 2 ++ tests/ConfigTest.php | 1 + 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/classes/Config.php b/classes/Config.php index 56a0fe4..48625a1 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -147,6 +147,13 @@ class Config */ public $defaultAudio = false; + /** + * Disable audio conversion from/to seeker. + * + * @var bool + */ + public $convertSeek = true; + /** * Config constructor. * diff --git a/classes/Controller/DownloadController.php b/classes/Controller/DownloadController.php index 834f48d..e3c547c 100644 --- a/classes/Controller/DownloadController.php +++ b/classes/Controller/DownloadController.php @@ -101,8 +101,12 @@ class DownloadController extends BaseController */ private function getConvertedAudioResponse(Request $request, Response $response) { - $from = $request->getQueryParam('from'); - $to = $request->getQueryParam('to'); + $from = null; + $to = null; + if ($this->config->convertSeek) { + $from = $request->getQueryParam('from'); + $to = $request->getQueryParam('to'); + } $response = $response->withHeader( 'Content-Disposition', diff --git a/config/config.example.yml b/config/config.example.yml index 29511a2..3ce5614 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -58,3 +58,6 @@ debug: false # True to enable audio conversion mode by default defaultAudio: false + +# False to disable convert seek functionality +convertSeek: true diff --git a/templates/index.tpl b/templates/index.tpl index c606933..b26eb64 100644 --- a/templates/index.tpl +++ b/templates/index.tpl @@ -24,6 +24,7 @@ + {if $config->convertSeek}
{t}to{/t}
+ {/if}
{/if} diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index 5677e5c..d4c8359 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -76,6 +76,7 @@ class ConfigTest extends BaseTest $this->assertIsBool($config->stream); $this->assertIsBool($config->remux); $this->assertIsBool($config->defaultAudio); + $this->assertIsBool($config->convertSeek); $this->assertIsInt($config->audioBitrate); } From 6fc294afbeb60b913a463f0be79647c0330adf54 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 17 Oct 2020 15:09:34 +0200 Subject: [PATCH 25/43] Use array_merge() instead of += To avoid overriding items --- tests/BaseTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/BaseTest.php b/tests/BaseTest.php index a377617..e49f397 100644 --- a/tests/BaseTest.php +++ b/tests/BaseTest.php @@ -53,10 +53,10 @@ abstract class BaseTest extends TestCase $requires = []; if (isset($annotations['class']['requires'])) { - $requires += $annotations['class']['requires']; + $requires = array_merge($requires, $annotations['class']['requires']); } if (isset($annotations['method']['requires'])) { - $requires += $annotations['method']['requires']; + $requires = array_merge($requires, $annotations['method']['requires']); } foreach ($requires as $require) { From 7e2afd82210bd1debe78d5464789ff04ea2ea272 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 17 Oct 2020 22:07:07 +0200 Subject: [PATCH 26/43] Stop using a singleton for Config (#298) --- classes/Config.php | 54 +++------------- classes/ConfigFactory.php | 6 +- tests/BaseTest.php | 10 --- tests/ConfigTest.php | 66 ++++---------------- tests/ControllerTest.php | 2 +- tests/ConvertedPlaylistArchiveStreamTest.php | 9 ++- tests/DownloadControllerTest.php | 25 ++++---- tests/FrontControllerTest.php | 21 +++---- tests/PlaylistArchiveStreamTest.php | 9 ++- tests/StreamTest.php | 22 +++++++ tests/VideoStubsTest.php | 4 +- tests/VideoTest.php | 9 ++- tests/YoutubeChunkStreamTest.php | 9 +-- tests/YoutubeStreamTest.php | 10 ++- 14 files changed, 87 insertions(+), 169 deletions(-) diff --git a/classes/Config.php b/classes/Config.php index 48625a1..8c7bb19 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -20,12 +20,6 @@ use Jawira\CaseConverter\Convert; */ class Config { - /** - * Singleton instance. - * - * @var Config|null - */ - private static $instance; /** * youtube-dl binary path. @@ -160,10 +154,11 @@ class Config * @param mixed[] $options Options * @throws ConfigException */ - private function __construct(array $options = []) + public function __construct(array $options = []) { $this->applyOptions($options); $this->getEnv(); + $this->validateOptions(); $localeManager = LocaleManager::getInstance(); if (empty($this->genericFormats)) { @@ -271,34 +266,17 @@ class Config } } - /** - * Get Config singleton instance. - * - * @return Config - * @todo Stop using a singleton. - */ - public static function getInstance() - { - if (!isset(self::$instance)) { - self::$instance = new self(); - } - - return self::$instance; - } - /** * Set options from a YAML file. * * @param string $file Path to the YAML file - * @return void + * @return Config * @throws ConfigException */ - public static function setFile(string $file) + public static function fromFile(string $file) { if (is_file($file)) { - $options = Yaml::parse(strval(file_get_contents($file))); - self::$instance = new self($options); - self::$instance->validateOptions(); + return new self(Yaml::parse(strval(file_get_contents($file)))); } else { throw new ConfigException("Can't find config file at " . $file); } @@ -308,29 +286,13 @@ class Config * Manually set some options. * * @param mixed[] $options Options (see `config/config.example.yml` for available options) - * @param bool $update True to update an existing instance * @return void * @throws ConfigException */ - public static function setOptions(array $options, $update = true) + public function setOptions(array $options) { - if ($update) { - $config = self::getInstance(); - $config->applyOptions($options); - $config->validateOptions(); - } else { - self::$instance = new self($options); - } - } - - /** - * Destroy singleton instance. - * - * @return void - */ - public static function destroyInstance() - { - self::$instance = null; + $this->applyOptions($options); + $this->validateOptions(); } /** diff --git a/classes/ConfigFactory.php b/classes/ConfigFactory.php index 03cae73..5770d31 100644 --- a/classes/ConfigFactory.php +++ b/classes/ConfigFactory.php @@ -19,10 +19,10 @@ class ConfigFactory { $configPath = __DIR__ . '/../config/config.yml'; if (is_file($configPath)) { - Config::setFile($configPath); + $config = Config::fromFile($configPath); + } else { + $config = new Config(); } - - $config = Config::getInstance(); if ($config->uglyUrls) { $container['router'] = new UglyRouter(); } diff --git a/tests/BaseTest.php b/tests/BaseTest.php index e49f397..4d70e8e 100644 --- a/tests/BaseTest.php +++ b/tests/BaseTest.php @@ -27,22 +27,12 @@ abstract class BaseTest extends TestCase /** * Prepare tests. - * @throws ConfigException */ protected function setUp(): void { - Config::setFile($this->getConfigFile()); $this->checkRequirements(); } - /** - * Destroy properties after test. - */ - protected function tearDown(): void - { - Config::destroyInstance(); - } - /** * Check tests requirements. * @return void diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index d4c8359..17c1725 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -14,23 +14,6 @@ use Alltube\Exception\ConfigException; */ class ConfigTest extends BaseTest { - /** - * Config class instance. - * - * @var Config - */ - private $config; - - /** - * Prepare tests. - * @throws ConfigException - */ - protected function setUp(): void - { - parent::setUp(); - - $this->config = Config::getInstance(); - } /** * Test the getInstance function. @@ -39,21 +22,7 @@ class ConfigTest extends BaseTest */ public function testGetInstance() { - $config = Config::getInstance(); - $this->assertEquals(false, $config->convert); - $this->assertConfig($config); - } - - /** - * Test the getInstance function. - * - * @return void - */ - public function testGetInstanceFromScratch() - { - Config::destroyInstance(); - - $config = Config::getInstance(); + $config = new Config(); $this->assertEquals(false, $config->convert); $this->assertConfig($config); } @@ -88,8 +57,8 @@ class ConfigTest extends BaseTest */ public function testSetFile() { - Config::setFile($this->getConfigFile()); - $this->assertConfig($this->config); + $config = Config::fromFile($this->getConfigFile()); + $this->assertConfig($config); } /** @@ -100,7 +69,7 @@ class ConfigTest extends BaseTest public function testSetFileWithMissingFile() { $this->expectException(ConfigException::class); - Config::setFile('foo'); + Config::fromFile('foo'); } /** @@ -111,21 +80,8 @@ class ConfigTest extends BaseTest */ public function testSetOptions() { - Config::setOptions(['appName' => 'foo']); - $config = Config::getInstance(); - $this->assertEquals('foo', $config->appName); - } - - /** - * Test the setOptions function. - * - * @return void - * @throws ConfigException - */ - public function testSetOptionsWithoutUpdate() - { - Config::setOptions(['appName' => 'foo'], false); - $config = Config::getInstance(); + $config = new Config(); + $config->setOptions(['appName' => 'foo']); $this->assertEquals('foo', $config->appName); } @@ -137,7 +93,8 @@ class ConfigTest extends BaseTest public function testSetOptionsWithBadYoutubedl() { $this->expectException(ConfigException::class); - Config::setOptions(['youtubedl' => 'foo']); + $config = new Config(); + $config->setOptions(['youtubedl' => 'foo']); } /** @@ -148,7 +105,8 @@ class ConfigTest extends BaseTest public function testSetOptionsWithBadPython() { $this->expectException(ConfigException::class); - Config::setOptions(['python' => 'foo']); + $config = new Config(); + $config->setOptions(['python' => 'foo']); } /** @@ -159,10 +117,8 @@ class ConfigTest extends BaseTest */ public function testGetInstanceWithEnv() { - Config::destroyInstance(); putenv('CONVERT=1'); - Config::setFile($this->getConfigFile()); - $config = Config::getInstance(); + $config = Config::fromFile($this->getConfigFile()); $this->assertEquals(true, $config->convert); putenv('CONVERT'); } diff --git a/tests/ControllerTest.php b/tests/ControllerTest.php index cf9a7b7..96b6a68 100644 --- a/tests/ControllerTest.php +++ b/tests/ControllerTest.php @@ -65,7 +65,7 @@ abstract class ControllerTest extends BaseTest $this->container = new Container(); $this->request = Request::createFromEnvironment(Environment::mock()); $this->response = new Response(); - $this->container['config'] = Config::getInstance(); + $this->container['config'] = Config::fromFile($this->getConfigFile()); $this->container['locale'] = LocaleManagerFactory::create(); $this->container['view'] = ViewFactory::create($this->container, $this->request); $this->container['logger'] = new NullLogger(); diff --git a/tests/ConvertedPlaylistArchiveStreamTest.php b/tests/ConvertedPlaylistArchiveStreamTest.php index 0ed373f..4301fa7 100644 --- a/tests/ConvertedPlaylistArchiveStreamTest.php +++ b/tests/ConvertedPlaylistArchiveStreamTest.php @@ -6,7 +6,6 @@ namespace Alltube\Test; -use Alltube\Config; use Alltube\Exception\ConfigException; use Alltube\Stream\ConvertedPlaylistArchiveStream; @@ -24,10 +23,10 @@ class ConvertedPlaylistArchiveStreamTest extends StreamTest { parent::setUp(); - $config = Config::getInstance(); - $downloader = $config->getDownloader(); - $video = $downloader->getVideo('https://www.youtube.com/playlist?list=PL1j4Ff8cAqPu5iowaeUAY8lRgkfT4RybJ'); + $video = $this->downloader->getVideo( + 'https://www.youtube.com/playlist?list=PL1j4Ff8cAqPu5iowaeUAY8lRgkfT4RybJ' + ); - $this->stream = new ConvertedPlaylistArchiveStream($downloader, $video); + $this->stream = new ConvertedPlaylistArchiveStream($this->downloader, $video); } } diff --git a/tests/DownloadControllerTest.php b/tests/DownloadControllerTest.php index 8830d0e..76e6544 100644 --- a/tests/DownloadControllerTest.php +++ b/tests/DownloadControllerTest.php @@ -6,7 +6,6 @@ namespace Alltube\Test; -use Alltube\Config; use Alltube\Controller\DownloadController; use Alltube\Exception\ConfigException; use Alltube\Exception\DependencyException; @@ -69,11 +68,11 @@ class DownloadControllerTest extends ControllerTest * Test the download() function with streams enabled. * * @return void - * @throws ConfigException */ public function testDownloadWithStream() { - Config::setOptions(['stream' => true]); + $config = $this->container->get('config'); + $config->setOptions(['stream' => true]); $this->assertRequestIsOk( 'download', @@ -85,11 +84,11 @@ class DownloadControllerTest extends ControllerTest * Test the download() function with an M3U stream. * * @return void - * @throws ConfigException */ public function testDownloadWithM3uStream() { - Config::setOptions(['stream' => true]); + $config = $this->container->get('config'); + $config->setOptions(['stream' => true]); $this->assertRequestIsOk( 'download', @@ -105,13 +104,13 @@ class DownloadControllerTest extends ControllerTest * Test the download() function with an RTMP stream. * * @return void - * @throws ConfigException */ public function testDownloadWithRtmpStream() { $this->markTestIncomplete('We need to find another RTMP video.'); - Config::setOptions(['stream' => true]); + $config = $this->container->get('config'); + $config->setOptions(['stream' => true]); $this->assertRequestIsOk( 'download', @@ -123,11 +122,11 @@ class DownloadControllerTest extends ControllerTest * Test the download() function with a remuxed video. * * @return void - * @throws ConfigException */ public function testDownloadWithRemux() { - Config::setOptions(['remux' => true]); + $config = $this->container->get('config'); + $config->setOptions(['remux' => true]); $this->assertRequestIsOk( 'download', @@ -196,11 +195,11 @@ class DownloadControllerTest extends ControllerTest * * @return void * @requires OS Linux - * @throws ConfigException */ public function testDownloadWithPlaylist() { - Config::setOptions(['stream' => true]); + $config = $this->container->get('config'); + $config->setOptions(['stream' => true]); $this->assertRequestIsOk( 'download', @@ -212,11 +211,11 @@ class DownloadControllerTest extends ControllerTest * Test the download() function with an advanced conversion. * * @return void - * @throws ConfigException */ public function testDownloadWithAdvancedConversion() { - Config::setOptions(['convertAdvanced' => true]); + $config = $this->container->get('config'); + $config->setOptions(['convertAdvanced' => true]); $this->assertRequestIsOk( 'download', diff --git a/tests/FrontControllerTest.php b/tests/FrontControllerTest.php index 91c4d92..dbff46b 100644 --- a/tests/FrontControllerTest.php +++ b/tests/FrontControllerTest.php @@ -6,7 +6,6 @@ namespace Alltube\Test; -use Alltube\Config; use Alltube\Controller\FrontController; use Alltube\Exception\ConfigException; use Alltube\Exception\DependencyException; @@ -52,11 +51,11 @@ class FrontControllerTest extends ControllerTest * Test the constructor with streams enabled. * * @return void - * @throws ConfigException */ public function testConstructorWithStream() { - Config::setOptions(['stream' => true]); + $config = $this->container->get('config'); + $config->setOptions(['stream' => true]); $this->assertInstanceOf(FrontController::class, new FrontController($this->container)); } @@ -132,11 +131,11 @@ class FrontControllerTest extends ControllerTest * * @return void * @requires download - * @throws ConfigException */ public function testInfoWithAudio() { - Config::setOptions(['convert' => true]); + $config = $this->container->get('config'); + $config->setOptions(['convert' => true]); $this->assertRequestIsRedirect( 'info', @@ -149,11 +148,11 @@ class FrontControllerTest extends ControllerTest * * @return void * @requires download - * @throws ConfigException */ public function testInfoWithVimeoAudio() { - Config::setOptions(['convert' => true]); + $config = $this->container->get('config'); + $config->setOptions(['convert' => true]); // So we can test the fallback to default format $this->assertRequestIsRedirect('info', ['url' => 'https://vimeo.com/251997032', 'audio' => true]); @@ -164,11 +163,11 @@ class FrontControllerTest extends ControllerTest * * @return void * @requires download - * @throws ConfigException */ public function testInfoWithUnconvertedAudio() { - Config::setOptions(['convert' => true]); + $config = $this->container->get('config'); + $config->setOptions(['convert' => true]); $this->assertRequestIsRedirect( 'info', @@ -213,11 +212,11 @@ class FrontControllerTest extends ControllerTest * * @return void * @requires download - * @throws ConfigException */ public function testInfoWithStream() { - Config::setOptions(['stream' => true]); + $config = $this->container->get('config'); + $config->setOptions(['stream' => true]); $this->assertRequestIsOk('info', ['url' => 'https://www.youtube.com/watch?v=M7IpKCZ47pU']); $this->assertRequestIsOk( diff --git a/tests/PlaylistArchiveStreamTest.php b/tests/PlaylistArchiveStreamTest.php index 29b103f..ffae5ee 100644 --- a/tests/PlaylistArchiveStreamTest.php +++ b/tests/PlaylistArchiveStreamTest.php @@ -6,7 +6,6 @@ namespace Alltube\Test; -use Alltube\Config; use Alltube\Exception\ConfigException; use Alltube\Stream\PlaylistArchiveStream; @@ -24,10 +23,10 @@ class PlaylistArchiveStreamTest extends StreamTest { parent::setUp(); - $config = Config::getInstance(); - $downloader = $config->getDownloader(); - $video = $downloader->getVideo('https://www.youtube.com/playlist?list=PL1j4Ff8cAqPu5iowaeUAY8lRgkfT4RybJ'); + $video = $this->downloader->getVideo( + 'https://www.youtube.com/playlist?list=PL1j4Ff8cAqPu5iowaeUAY8lRgkfT4RybJ' + ); - $this->stream = new PlaylistArchiveStream($downloader, $video); + $this->stream = new PlaylistArchiveStream($this->downloader, $video); } } diff --git a/tests/StreamTest.php b/tests/StreamTest.php index f634838..5b3c92a 100644 --- a/tests/StreamTest.php +++ b/tests/StreamTest.php @@ -6,6 +6,9 @@ namespace Alltube\Test; +use Alltube\Config; +use Alltube\Exception\ConfigException; +use Alltube\Library\Downloader; use Psr\Http\Message\StreamInterface; use RuntimeException; @@ -20,6 +23,25 @@ abstract class StreamTest extends BaseTest */ protected $stream; + /** + * Downloader class instance. + * @var Downloader + */ + protected $downloader; + + /** + * Prepare tests. + * @throws ConfigException + */ + protected function setUp(): void + { + parent::setUp(); + + // So ffmpeg does not spam the output with broken pipe errors. + $config = new Config(['ffmpegVerbosity' => 'fatal']); + $this->downloader = $config->getDownloader(); + } + /** * Clean variables used in tests. * diff --git a/tests/VideoStubsTest.php b/tests/VideoStubsTest.php index 789e839..ae6f55a 100644 --- a/tests/VideoStubsTest.php +++ b/tests/VideoStubsTest.php @@ -7,7 +7,6 @@ namespace Alltube\Test; use Alltube\Config; -use Alltube\Exception\ConfigException; use Alltube\Library\Downloader; use Alltube\Library\Exception\AlltubeLibraryException; use Alltube\Library\Exception\PopenStreamException; @@ -39,7 +38,6 @@ class VideoStubsTest extends BaseTest /** * Initialize properties used by test. - * @throws ConfigException */ protected function setUp(): void { @@ -48,7 +46,7 @@ class VideoStubsTest extends BaseTest PHPMockery::mock('Alltube\Library', 'popen'); PHPMockery::mock('Alltube\Library', 'fopen'); - $config = Config::getInstance(); + $config = new Config(); $this->downloader = $config->getDownloader(); $this->video = $this->downloader->getVideo('https://www.youtube.com/watch?v=XJC9_JkzugE'); } diff --git a/tests/VideoTest.php b/tests/VideoTest.php index 75aeeca..6bef5d3 100644 --- a/tests/VideoTest.php +++ b/tests/VideoTest.php @@ -48,7 +48,8 @@ class VideoTest extends BaseTest { parent::setUp(); - $config = Config::getInstance(); + // So ffmpeg does not spam the output with broken pipe errors. + $config = new Config(['ffmpegVerbosity' => 'fatal']); $this->downloader = $config->getDownloader(); $this->format = 'best'; } @@ -352,8 +353,7 @@ class VideoTest extends BaseTest public function testGetAudioStreamFfmpegError(string $url, string $format) { $this->expectException(AvconvException::class); - Config::setOptions(['ffmpeg' => 'foobar']); - $config = Config::getInstance(); + $config = new Config(['ffmpeg' => 'foobar']); $downloader = $config->getDownloader(); $video = new Video($this->downloader, $url, $format, $this->format); @@ -502,8 +502,7 @@ class VideoTest extends BaseTest public function testGetM3uStreamFfmpegError(string $url, string $format) { $this->expectException(AvconvException::class); - Config::setOptions(['ffmpeg' => 'foobar']); - $config = Config::getInstance(); + $config = new Config(['ffmpeg' => 'foobar']); $downloader = $config->getDownloader(); $video = new Video($downloader, $url, $format); diff --git a/tests/YoutubeChunkStreamTest.php b/tests/YoutubeChunkStreamTest.php index aec785d..8064f60 100644 --- a/tests/YoutubeChunkStreamTest.php +++ b/tests/YoutubeChunkStreamTest.php @@ -6,7 +6,6 @@ namespace Alltube\Test; -use Alltube\Config; use Alltube\Exception\ConfigException; use Alltube\Library\Exception\AlltubeLibraryException; use Alltube\Stream\YoutubeChunkStream; @@ -19,17 +18,15 @@ class YoutubeChunkStreamTest extends StreamTest { /** * Prepare tests. - * @throws ConfigException * @throws AlltubeLibraryException + * @throws ConfigException */ protected function setUp(): void { parent::setUp(); - $config = Config::getInstance(); - $downloader = $config->getDownloader(); - $video = $downloader->getVideo('https://www.youtube.com/watch?v=dQw4w9WgXcQ'); + $video = $this->downloader->getVideo('https://www.youtube.com/watch?v=dQw4w9WgXcQ'); - $this->stream = new YoutubeChunkStream($downloader->getHttpResponse($video)); + $this->stream = new YoutubeChunkStream($this->downloader->getHttpResponse($video)); } } diff --git a/tests/YoutubeStreamTest.php b/tests/YoutubeStreamTest.php index d551e0c..838a270 100644 --- a/tests/YoutubeStreamTest.php +++ b/tests/YoutubeStreamTest.php @@ -6,7 +6,6 @@ namespace Alltube\Test; -use Alltube\Config; use Alltube\Exception\ConfigException; use Alltube\Library\Exception\AlltubeLibraryException; use Alltube\Stream\YoutubeStream; @@ -19,17 +18,16 @@ class YoutubeStreamTest extends StreamTest { /** * Prepare tests. - * @throws ConfigException|AlltubeLibraryException + * @throws AlltubeLibraryException + * @throws ConfigException */ protected function setUp(): void { parent::setUp(); - $config = Config::getInstance(); - $downloader = $config->getDownloader(); - $video = $downloader->getVideo('https://www.youtube.com/watch?v=dQw4w9WgXcQ', '135'); + $video = $this->downloader->getVideo('https://www.youtube.com/watch?v=dQw4w9WgXcQ', '135'); - $this->stream = new YoutubeStream($downloader, $video); + $this->stream = new YoutubeStream($this->downloader, $video); } /** From 50ea02cf04f893db93802c8ffbbb99ac3736f61c Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 17 Oct 2020 22:09:01 +0200 Subject: [PATCH 27/43] Format should be a string --- tests/VideoTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/VideoTest.php b/tests/VideoTest.php index 6bef5d3..fe451c0 100644 --- a/tests/VideoTest.php +++ b/tests/VideoTest.php @@ -164,7 +164,7 @@ class VideoTest extends BaseTest 'googlevideo.com', ], [ - 'https://www.youtube.com/watch?v=RJJ6FCAXvKg', 18, + 'https://www.youtube.com/watch?v=RJJ6FCAXvKg', '18', 'Heart_Attack_-_Demi_Lovato_' . 'Sam_Tsui_Against_The_Current-RJJ6FCAXvKg', 'mp4', From 651c5c3d903fbbee7f3f3c009ad81e87d50dd3bd Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 17 Oct 2020 22:13:28 +0200 Subject: [PATCH 28/43] Fix test We now return a 403 status code when a password is needed --- tests/DownloadControllerTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/DownloadControllerTest.php b/tests/DownloadControllerTest.php index 76e6544..35ca8a1 100644 --- a/tests/DownloadControllerTest.php +++ b/tests/DownloadControllerTest.php @@ -161,7 +161,7 @@ class DownloadControllerTest extends ControllerTest */ public function testDownloadWithMissingPassword() { - $this->assertRequestIsRedirect('download', ['url' => 'http://vimeo.com/68375962']); + $this->assertRequestIsClientError('download', ['url' => 'http://vimeo.com/68375962']); } /** From fc6bf472b2e14712f548698a4f9be076e6622b3b Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 17 Oct 2020 22:18:58 +0200 Subject: [PATCH 29/43] Stop using deprecated constant --- classes/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/Config.php b/classes/Config.php index 8c7bb19..9aaf695 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -317,7 +317,7 @@ class Config */ public function getAppVersion() { - $version = PrettyVersions::getVersion(Versions::ROOT_PACKAGE_NAME); + $version = PrettyVersions::getVersion('rudloff/alltube'); return $version->getPrettyVersion(); } From f5045b3ae7771abbe8f3a8527a3572aa5db85690 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 17 Oct 2020 22:22:17 +0200 Subject: [PATCH 30/43] Lint --- tests/BaseTest.php | 2 -- tests/VideoTest.php | 10 +++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/BaseTest.php b/tests/BaseTest.php index 4d70e8e..7aa5351 100644 --- a/tests/BaseTest.php +++ b/tests/BaseTest.php @@ -6,8 +6,6 @@ namespace Alltube\Test; -use Alltube\Config; -use Alltube\Exception\ConfigException; use PHPUnit\Framework\TestCase; /** diff --git a/tests/VideoTest.php b/tests/VideoTest.php index fe451c0..05b9856 100644 --- a/tests/VideoTest.php +++ b/tests/VideoTest.php @@ -81,11 +81,11 @@ class VideoTest extends BaseTest * @dataProvider remuxUrlProvider */ public function testgetUrl( - $url, - $format, - /* @scrutinizer ignore-unused */ $filename, - /* @scrutinizer ignore-unused */ $extension, - $domain + string $url, + string $format, + string $filename, + string $extension, + string $domain ) { $video = new Video($this->downloader, $url, $format); foreach ($video->getUrl() as $videoURL) { From 15636aa435dc2798627586c574455b3f604b0373 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 17 Oct 2020 22:36:03 +0200 Subject: [PATCH 31/43] Stop using a singleton for LocaleManager (#298) --- classes/Config.php | 3 +-- classes/LocaleManager.php | 34 +------------------------------- classes/LocaleManagerFactory.php | 2 +- tests/ControllerTest.php | 6 ++---- tests/LocaleManagerTest.php | 3 +-- tests/LocaleMiddlewareTest.php | 3 +-- tests/ViewFactoryTest.php | 4 ++-- 7 files changed, 9 insertions(+), 46 deletions(-) diff --git a/classes/Config.php b/classes/Config.php index 9aaf695..7fadf7f 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -10,7 +10,6 @@ use Alltube\Exception\ConfigException; use Alltube\Library\Downloader; use Jawira\CaseConverter\CaseConverterException; use Jean85\PrettyVersions; -use PackageVersions\Versions; use Symfony\Component\ErrorHandler\Debug; use Symfony\Component\Yaml\Yaml; use Jawira\CaseConverter\Convert; @@ -159,7 +158,7 @@ class Config $this->applyOptions($options); $this->getEnv(); $this->validateOptions(); - $localeManager = LocaleManager::getInstance(); + $localeManager = new LocaleManager(); if (empty($this->genericFormats)) { // We don't put this in the class definition so it can be detected by xgettext. diff --git a/classes/LocaleManager.php b/classes/LocaleManager.php index b008d8a..01a92a8 100644 --- a/classes/LocaleManager.php +++ b/classes/LocaleManager.php @@ -50,17 +50,10 @@ class LocaleManager */ private $translator; - /** - * Singleton instance. - * - * @var LocaleManager|null - */ - private static $instance; - /** * LocaleManager constructor. */ - private function __construct() + public function __construct() { $session = SessionManager::getSession(); $this->sessionSegment = $session->getSegment(self::class); @@ -171,29 +164,4 @@ class LocaleManager return ''; } - - /** - * Get LocaleManager singleton instance. - * - * @return LocaleManager - * @todo Stop using a singleton. - */ - public static function getInstance() - { - if (!isset(self::$instance)) { - self::$instance = new self(); - } - - return self::$instance; - } - - /** - * Destroy singleton instance. - * - * @return void - */ - public static function destroyInstance() - { - self::$instance = null; - } } diff --git a/classes/LocaleManagerFactory.php b/classes/LocaleManagerFactory.php index 068e512..782eb49 100644 --- a/classes/LocaleManagerFactory.php +++ b/classes/LocaleManagerFactory.php @@ -21,6 +21,6 @@ class LocaleManagerFactory throw new DependencyException('You need to install the intl extension for PHP.'); } - return LocaleManager::getInstance(); + return new LocaleManager(); } } diff --git a/tests/ControllerTest.php b/tests/ControllerTest.php index 96b6a68..600345c 100644 --- a/tests/ControllerTest.php +++ b/tests/ControllerTest.php @@ -11,8 +11,7 @@ use Alltube\Controller\BaseController; use Alltube\Controller\DownloadController; use Alltube\Controller\FrontController; use Alltube\Exception\ConfigException; -use Alltube\Exception\DependencyException; -use Alltube\LocaleManagerFactory; +use Alltube\LocaleManager; use Alltube\ViewFactory; use Psr\Log\NullLogger; use Slim\Container; @@ -56,7 +55,6 @@ abstract class ControllerTest extends BaseTest /** * Prepare tests. * @throws ConfigException|SmartyException - * @throws DependencyException */ protected function setUp(): void { @@ -66,7 +64,7 @@ abstract class ControllerTest extends BaseTest $this->request = Request::createFromEnvironment(Environment::mock()); $this->response = new Response(); $this->container['config'] = Config::fromFile($this->getConfigFile()); - $this->container['locale'] = LocaleManagerFactory::create(); + $this->container['locale'] = new LocaleManager(); $this->container['view'] = ViewFactory::create($this->container, $this->request); $this->container['logger'] = new NullLogger(); diff --git a/tests/LocaleManagerTest.php b/tests/LocaleManagerTest.php index 7732880..15b1fcf 100644 --- a/tests/LocaleManagerTest.php +++ b/tests/LocaleManagerTest.php @@ -27,7 +27,7 @@ class LocaleManagerTest extends BaseTest protected function setUp(): void { $_SESSION[LocaleManager::class]['locale'] = 'foo_BAR'; - $this->localeManager = LocaleManager::getInstance(); + $this->localeManager = new LocaleManager(); } /** @@ -38,7 +38,6 @@ class LocaleManagerTest extends BaseTest protected function tearDown(): void { $this->localeManager->unsetLocale(); - LocaleManager::destroyInstance(); } /** diff --git a/tests/LocaleMiddlewareTest.php b/tests/LocaleMiddlewareTest.php index feb05c2..1df6f09 100644 --- a/tests/LocaleMiddlewareTest.php +++ b/tests/LocaleMiddlewareTest.php @@ -38,7 +38,7 @@ class LocaleMiddlewareTest extends BaseTest protected function setUp(): void { $this->container = new Container(); - $this->container['locale'] = LocaleManager::getInstance(); + $this->container['locale'] = new LocaleManager(); $this->middleware = new LocaleMiddleware($this->container); } @@ -50,7 +50,6 @@ class LocaleMiddlewareTest extends BaseTest protected function tearDown(): void { $this->container['locale']->unsetLocale(); - LocaleManager::destroyInstance(); } /** diff --git a/tests/ViewFactoryTest.php b/tests/ViewFactoryTest.php index 1bafff9..5f04a31 100644 --- a/tests/ViewFactoryTest.php +++ b/tests/ViewFactoryTest.php @@ -28,7 +28,7 @@ class ViewFactoryTest extends BaseTest public function testCreate() { $container = new Container(); - $container['locale'] = LocaleManager::getInstance(); + $container['locale'] = new LocaleManager(); $view = ViewFactory::create($container); $this->assertInstanceOf(Smarty::class, $view); } @@ -42,7 +42,7 @@ class ViewFactoryTest extends BaseTest public function testCreateWithXForwardedProto() { $container = new Container(); - $container['locale'] = LocaleManager::getInstance(); + $container['locale'] = new LocaleManager(); $request = Request::createFromEnvironment(Environment::mock()); $view = ViewFactory::create($container, $request->withHeader('X-Forwarded-Proto', 'https')); $this->assertInstanceOf(Smarty::class, $view); From fe80308610055646221a3803b2338a415b537a90 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 17 Oct 2020 22:51:39 +0200 Subject: [PATCH 32/43] Update alltube-library --- composer.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.lock b/composer.lock index 96f5372..769bab3 100644 --- a/composer.lock +++ b/composer.lock @@ -938,12 +938,12 @@ "source": { "type": "git", "url": "https://github.com/Rudloff/alltube-library.git", - "reference": "0413427bbed7b02a2971b1716bf36c66924a205f" + "reference": "69d09b780e01ec0f3e6e3d123be14fa3b981b64e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Rudloff/alltube-library/zipball/0413427bbed7b02a2971b1716bf36c66924a205f", - "reference": "0413427bbed7b02a2971b1716bf36c66924a205f", + "url": "https://api.github.com/repos/Rudloff/alltube-library/zipball/69d09b780e01ec0f3e6e3d123be14fa3b981b64e", + "reference": "69d09b780e01ec0f3e6e3d123be14fa3b981b64e", "shasum": "" }, "require": { @@ -971,7 +971,7 @@ ], "description": "PHP wrapper for youtube-dl", "homepage": "http://alltubedownload.net/", - "time": "2020-07-15T20:34:36+00:00" + "time": "2020-10-17T20:47:16+00:00" }, { "name": "slim/slim", From 9becaeaabe45fd1e9a1b0837142cb58b1f0a36e7 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 18 Oct 2020 00:59:19 +0200 Subject: [PATCH 33/43] Fix uglyUrls --- classes/ConfigFactory.php | 3 ++- index.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/classes/ConfigFactory.php b/classes/ConfigFactory.php index 5770d31..ff334e5 100644 --- a/classes/ConfigFactory.php +++ b/classes/ConfigFactory.php @@ -2,6 +2,7 @@ namespace Alltube; +use Slim\Container; use Symfony\Component\ErrorHandler\Debug; /** @@ -15,7 +16,7 @@ class ConfigFactory * @return Config * @throws Exception\ConfigException */ - public static function create() + public static function create(Container $container) { $configPath = __DIR__ . '/../config/config.yml'; if (is_file($configPath)) { diff --git a/index.php b/index.php index 009d13f..ed774bd 100644 --- a/index.php +++ b/index.php @@ -26,7 +26,7 @@ try { $container = $app->getContainer(); // Config. - $container['config'] = ConfigFactory::create(); + $container['config'] = ConfigFactory::create($container); // Locales. $container['locale'] = LocaleManagerFactory::create(); From 07f19a80f425ad77e03b9cc2a2e2b1a35ada1da3 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 18 Oct 2020 12:03:57 +0200 Subject: [PATCH 34/43] Improve fallback error handling --- classes/ErrorHandler.php | 36 ++++++++++++++++++++++++++++++++++++ index.php | 4 ++-- 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 classes/ErrorHandler.php diff --git a/classes/ErrorHandler.php b/classes/ErrorHandler.php new file mode 100644 index 0000000..4111da9 --- /dev/null +++ b/classes/ErrorHandler.php @@ -0,0 +1,36 @@ +render($e); + + http_response_code($exception->getStatusCode()); + die($exception->getAsString()); + } else { + http_response_code(500); + die('Error when starting the app: ' . htmlentities($e->getMessage())); + } + } +} diff --git a/index.php b/index.php index ed774bd..7368054 100644 --- a/index.php +++ b/index.php @@ -6,6 +6,7 @@ use Alltube\ConfigFactory; use Alltube\Controller\DownloadController; use Alltube\Controller\FrontController; use Alltube\Controller\JsonController; +use Alltube\ErrorHandler; use Alltube\LocaleManagerFactory; use Alltube\LocaleMiddleware; use Alltube\LoggerFactory; @@ -87,6 +88,5 @@ try { $app->run(); } catch (Throwable $e) { - // Last resort if the error has not been caught by the error handler for some reason. - die('Error when starting the app: ' . htmlentities($e->getMessage())); + ErrorHandler::handle($e); } From 234ecc2c6d9b717c14cc212966a44f15e7740bd8 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 18 Oct 2020 12:49:44 +0200 Subject: [PATCH 35/43] Log handled exceptions --- classes/Controller/BaseController.php | 3 ++- classes/Controller/FrontController.php | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/classes/Controller/BaseController.php b/classes/Controller/BaseController.php index 0a3bced..9f0ee94 100644 --- a/classes/Controller/BaseController.php +++ b/classes/Controller/BaseController.php @@ -89,7 +89,8 @@ abstract class BaseController $this->sessionSegment = $session->getSegment(self::class); $this->localeManager = $this->container->get('locale'); $this->downloader = $this->config->getDownloader(); - $this->downloader->setLogger($this->container->get('logger')); + $this->logger = $this->container->get('logger'); + $this->downloader->setLogger($this->logger); if (!$this->config->stream) { // Force HTTP if stream is not enabled. diff --git a/classes/Controller/FrontController.php b/classes/Controller/FrontController.php index 5f06568..5590860 100644 --- a/classes/Controller/FrontController.php +++ b/classes/Controller/FrontController.php @@ -293,6 +293,8 @@ class FrontController extends BaseController */ public function error(Request $request, Response $response, Throwable $error) { + $this->logger->error($error); + if ($this->config->debug) { $renderer = new HtmlErrorRenderer(true); $exception = $renderer->render($error); From c5298dd24bf18c07b3033687407ad95ea330b291 Mon Sep 17 00:00:00 2001 From: bellington3 <71927099+bellington3@users.noreply.github.com> Date: Mon, 19 Oct 2020 20:18:03 +0000 Subject: [PATCH 36/43] Provide basePath support (#309) * Provide basePath support To be able to serve the application via a reverse proxy in a subfolder smarty needs to be aware of the basepath if any. * Provide basepath support via X-Forwarded headers * Fix warnings * Review adjustments * Provide support X-Forwarded-Host header * Use $uri in view factory directly * Use middleware to set basepath from X-Forwarded-Path header * Fix invalid type hint in RouterPathMiddleware * Add "X-Forwarded-Host" to README --- README.md | 6 +++++ classes/RouterPathMiddleware.php | 42 ++++++++++++++++++++++++++++++++ classes/ViewFactory.php | 22 +++++++++++++++-- index.php | 3 +++ 4 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 classes/RouterPathMiddleware.php diff --git a/README.md b/README.md index 047c175..90cc05e 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,12 @@ You will need PHP 7.2 (or higher) and the following PHP modules: ## Web server configuration +If you want to serve the application under a basepath and/or with a different internal than external port (scenario: nginx->docker setup) Alltube supports the following X-Forwarded headers: + +* X-Forwarded-Host (ex. `another.domain.com`) +* X-Forwarded-Path (ex: `/alltube`) +* X-Forwarded-Port (ex: `5555`) + ### Apache The following modules are recommended: diff --git a/classes/RouterPathMiddleware.php b/classes/RouterPathMiddleware.php new file mode 100644 index 0000000..71e2314 --- /dev/null +++ b/classes/RouterPathMiddleware.php @@ -0,0 +1,42 @@ +router = $container->get('router'); + } + + /** + * @param Request $request + * @param Response $response + * @param callable $next + * @return mixed + */ + public function __invoke(Request $request, Response $response, callable $next) + { + $this->router->setBasePath(current($request->getHeader('X-Forwarded-Path'))); + + return $next($request, $response); + } +} diff --git a/classes/ViewFactory.php b/classes/ViewFactory.php index b082798..23f3957 100644 --- a/classes/ViewFactory.php +++ b/classes/ViewFactory.php @@ -33,14 +33,32 @@ class ViewFactory } $view = new Smarty(__DIR__ . '/../templates/'); + + $uri = $request->getUri(); if (in_array('https', $request->getHeader('X-Forwarded-Proto'))) { - $request = $request->withUri($request->getUri()->withScheme('https')->withPort(443)); + $uri = $uri->withScheme('https')->withPort(443); + } + + // set values from X-Forwarded-* headers + $host = current($request->getHeader('X-Forwarded-Host')); + if ($host) { + $uri = $uri->withHost($host); + } + + $port = current($request->getHeader('X-Forwarded-Port')); + if ($port) { + $uri = $uri->withPort(intVal($port)); + } + + $path = current($request->getHeader('X-Forwarded-Path')); + if ($path) { + $uri = $uri->withBasePath($path); } /** @var LocaleManager $localeManager */ $localeManager = $container->get('locale'); - $smartyPlugins = new SmartyPlugins($container->get('router'), $request->getUri()->withUserInfo(null)); + $smartyPlugins = new SmartyPlugins($container->get('router'), $uri->withUserInfo(null)); $view->registerPlugin('function', 'path_for', [$smartyPlugins, 'pathFor']); $view->registerPlugin('function', 'base_url', [$smartyPlugins, 'baseUrl']); $view->registerPlugin('block', 't', [$localeManager, 'smartyTranslate']); diff --git a/index.php b/index.php index 7368054..137e1fd 100644 --- a/index.php +++ b/index.php @@ -10,6 +10,7 @@ use Alltube\ErrorHandler; use Alltube\LocaleManagerFactory; use Alltube\LocaleMiddleware; use Alltube\LoggerFactory; +use Alltube\RouterPathMiddleware; use Alltube\ViewFactory; use Slim\App; use Slim\Container; @@ -31,7 +32,9 @@ try { // Locales. $container['locale'] = LocaleManagerFactory::create(); + $app->add(new LocaleMiddleware($container)); + $app->add(new RouterPathMiddleware($container)); // Smarty. $container['view'] = ViewFactory::create($container); From da93835ea2c875a6dba26e07411e4e02e75a1e4a Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Mon, 19 Oct 2020 22:20:19 +0200 Subject: [PATCH 37/43] Fix error when X-Forwarded-Path is not defined --- classes/RouterPathMiddleware.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/classes/RouterPathMiddleware.php b/classes/RouterPathMiddleware.php index 71e2314..10672ce 100644 --- a/classes/RouterPathMiddleware.php +++ b/classes/RouterPathMiddleware.php @@ -35,7 +35,9 @@ class RouterPathMiddleware */ public function __invoke(Request $request, Response $response, callable $next) { - $this->router->setBasePath(current($request->getHeader('X-Forwarded-Path'))); + if ($path = current($request->getHeader('X-Forwarded-Path'))) { + $this->router->setBasePath($path); + } return $next($request, $response); } From e2560cd9cb6f34598d13fd663828205d9f0ba891 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Mon, 19 Oct 2020 22:24:59 +0200 Subject: [PATCH 38/43] Code cleanup --- classes/ViewFactory.php | 13 ++++++------- index.php | 7 ++++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/classes/ViewFactory.php b/classes/ViewFactory.php index 23f3957..253492f 100644 --- a/classes/ViewFactory.php +++ b/classes/ViewFactory.php @@ -8,6 +8,7 @@ namespace Alltube; use Psr\Container\ContainerInterface; use Slim\Http\Request; +use Slim\Http\Uri; use Slim\Views\Smarty; use Slim\Views\SmartyPlugins; use SmartyException; @@ -34,31 +35,29 @@ class ViewFactory $view = new Smarty(__DIR__ . '/../templates/'); + /** @var Uri $uri */ $uri = $request->getUri(); if (in_array('https', $request->getHeader('X-Forwarded-Proto'))) { $uri = $uri->withScheme('https')->withPort(443); } // set values from X-Forwarded-* headers - $host = current($request->getHeader('X-Forwarded-Host')); - if ($host) { + if ($host = current($request->getHeader('X-Forwarded-Host'))) { $uri = $uri->withHost($host); } - $port = current($request->getHeader('X-Forwarded-Port')); - if ($port) { + if ($port = current($request->getHeader('X-Forwarded-Port'))) { $uri = $uri->withPort(intVal($port)); } - $path = current($request->getHeader('X-Forwarded-Path')); - if ($path) { + if ($path = current($request->getHeader('X-Forwarded-Path'))) { $uri = $uri->withBasePath($path); } /** @var LocaleManager $localeManager */ $localeManager = $container->get('locale'); - $smartyPlugins = new SmartyPlugins($container->get('router'), $uri->withUserInfo(null)); + $smartyPlugins = new SmartyPlugins($container->get('router'), $uri->withUserInfo('')); $view->registerPlugin('function', 'path_for', [$smartyPlugins, 'pathFor']); $view->registerPlugin('function', 'base_url', [$smartyPlugins, 'baseUrl']); $view->registerPlugin('block', 't', [$localeManager, 'smartyTranslate']); diff --git a/index.php b/index.php index 137e1fd..02c8eb8 100644 --- a/index.php +++ b/index.php @@ -33,15 +33,16 @@ try { // Locales. $container['locale'] = LocaleManagerFactory::create(); - $app->add(new LocaleMiddleware($container)); - $app->add(new RouterPathMiddleware($container)); - // Smarty. $container['view'] = ViewFactory::create($container); // Logger. $container['logger'] = LoggerFactory::create($container); + // Middlewares. + $app->add(new LocaleMiddleware($container)); + $app->add(new RouterPathMiddleware($container)); + // Controllers. $frontController = new FrontController($container); $jsonController = new JsonController($container); From 561b6c8370308ca14050836151044185be69df45 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Mon, 19 Oct 2020 23:43:33 +0200 Subject: [PATCH 39/43] Make the CSP compatible with debug tools --- .htaccess | 1 - classes/Controller/FrontController.php | 7 ++ classes/CspMiddleware.php | 65 ++++++++++++++ composer.json | 1 + composer.lock | 120 ++++++++++++++++++++++++- index.php | 2 + 6 files changed, 194 insertions(+), 2 deletions(-) create mode 100644 classes/CspMiddleware.php diff --git a/.htaccess b/.htaccess index 4b254b0..7d28183 100644 --- a/.htaccess +++ b/.htaccess @@ -36,6 +36,5 @@ FileETag None Header set X-Content-Type-Options nosniff Header set X-XSS-Protection "1; mode=block" Header set Referrer-Policy no-referrer - Header set Content-Security-Policy "default-src 'self'; object-src 'none'; script-src 'none'; style-src 'self' 'unsafe-inline'; img-src http:" Header add Link "; rel=preload, ; rel=preload" "expr=%{CONTENT_TYPE} =~ m#text/html#" diff --git a/classes/Controller/FrontController.php b/classes/Controller/FrontController.php index 5590860..f46e326 100644 --- a/classes/Controller/FrontController.php +++ b/classes/Controller/FrontController.php @@ -6,6 +6,7 @@ namespace Alltube\Controller; +use Alltube\CspMiddleware; use Alltube\Library\Exception\PasswordException; use Alltube\Library\Exception\AlltubeLibraryException; use Alltube\Library\Exception\WrongPasswordException; @@ -295,6 +296,12 @@ class FrontController extends BaseController { $this->logger->error($error); + // We apply the CSP manually because middlewares are not called on error pages. + $cspMiddleware = new CspMiddleware($this->container); + + /** @var Response $response */ + $response = $cspMiddleware->applyHeader($response); + if ($this->config->debug) { $renderer = new HtmlErrorRenderer(true); $exception = $renderer->render($error); diff --git a/classes/CspMiddleware.php b/classes/CspMiddleware.php new file mode 100644 index 0000000..e80103a --- /dev/null +++ b/classes/CspMiddleware.php @@ -0,0 +1,65 @@ +config = $container->get('config'); + } + + /** + * @param Response $response + * @return MessageInterface + */ + public function applyHeader(Response $response) + { + $csp = new CSPBuilder(); + $csp->addDirective('default-src', []) + ->addDirective('font-src', ['self' => true]) + ->addDirective('style-src', ['self' => true]) + ->addSource('img-src', '*'); + + if ($this->config->debug) { + // So symfony/debug and symfony/error-handler can work. + $csp->setDirective('script-src', ['unsafe-inline' => true]) + ->setDirective('style-src', ['self' => true, 'unsafe-inline' => true]); + } + + return $csp->injectCSPHeader($response); + } + + /** + * @param Request $request + * @param Response $response + * @param callable $next + * @return mixed + */ + public function __invoke(Request $request, Response $response, callable $next) + { + $response = $this->applyHeader($response); + + return $next($request, $response); + } +} diff --git a/composer.json b/composer.json index ec460d2..1d9cc5e 100644 --- a/composer.json +++ b/composer.json @@ -27,6 +27,7 @@ "jawira/case-converter": "^3.4", "jean85/pretty-package-versions": "^1.3", "mathmarques/smarty-view": "^1.1", + "paragonie/csp-builder": "^2.5", "rinvex/countries": "^6.1", "rudloff/alltube-library": "dev-develop", "symfony/finder": "^5.0", diff --git a/composer.lock b/composer.lock index 769bab3..301cfb4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7e756e8b0f372bd5a914c54310933ecb", + "content-hash": "c0d33bde893f1ac7cbfcd26d26a92c9f", "packages": [ { "name": "aura/session", @@ -618,6 +618,124 @@ ], "time": "2018-02-13T20:26:39+00:00" }, + { + "name": "paragonie/constant_time_encoding", + "version": "v2.3.0", + "source": { + "type": "git", + "url": "https://github.com/paragonie/constant_time_encoding.git", + "reference": "47a1cedd2e4d52688eb8c96469c05ebc8fd28fa2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/47a1cedd2e4d52688eb8c96469c05ebc8fd28fa2", + "reference": "47a1cedd2e4d52688eb8c96469c05ebc8fd28fa2", + "shasum": "" + }, + "require": { + "php": "^7|^8" + }, + "require-dev": { + "phpunit/phpunit": "^6|^7", + "vimeo/psalm": "^1|^2|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "ParagonIE\\ConstantTime\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com", + "role": "Maintainer" + }, + { + "name": "Steve 'Sc00bz' Thomas", + "email": "steve@tobtu.com", + "homepage": "https://www.tobtu.com", + "role": "Original Developer" + } + ], + "description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)", + "keywords": [ + "base16", + "base32", + "base32_decode", + "base32_encode", + "base64", + "base64_decode", + "base64_encode", + "bin2hex", + "encoding", + "hex", + "hex2bin", + "rfc4648" + ], + "time": "2019-11-06T19:20:29+00:00" + }, + { + "name": "paragonie/csp-builder", + "version": "v2.5.0", + "source": { + "type": "git", + "url": "https://github.com/paragonie/csp-builder.git", + "reference": "73ebd90199eb6f3be6549d5390a7698c6deffa30" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/csp-builder/zipball/73ebd90199eb6f3be6549d5390a7698c6deffa30", + "reference": "73ebd90199eb6f3be6549d5390a7698c6deffa30", + "shasum": "" + }, + "require": { + "paragonie/constant_time_encoding": "^2", + "php": "^7.1|^8" + }, + "require-dev": { + "phpunit/phpunit": "^7|^8|^9", + "psr/http-message": "^1", + "squizlabs/php_codesniffer": "^3", + "vimeo/psalm": "^3" + }, + "suggest": { + "psr/http-message": "For CSPBuilder::injectCSPHeader()" + }, + "type": "library", + "autoload": { + "psr-4": { + "ParagonIE\\CSPBuilder\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com", + "role": "Owner" + } + ], + "description": "Easily add and update Content-Security-Policy headers for your project", + "keywords": [ + "content-security-policy", + "csp", + "headers", + "http", + "security", + "xss" + ], + "time": "2020-09-02T14:53:15+00:00" + }, { "name": "pimple/pimple", "version": "v3.3.0", diff --git a/index.php b/index.php index 02c8eb8..f40d7fd 100644 --- a/index.php +++ b/index.php @@ -6,6 +6,7 @@ use Alltube\ConfigFactory; use Alltube\Controller\DownloadController; use Alltube\Controller\FrontController; use Alltube\Controller\JsonController; +use Alltube\CspMiddleware; use Alltube\ErrorHandler; use Alltube\LocaleManagerFactory; use Alltube\LocaleMiddleware; @@ -42,6 +43,7 @@ try { // Middlewares. $app->add(new LocaleMiddleware($container)); $app->add(new RouterPathMiddleware($container)); + $app->add(new CspMiddleware($container)); // Controllers. $frontController = new FrontController($container); From 1da8bb55dcc8f8dae96f3513d6154945000d81fc Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Mon, 19 Oct 2020 23:46:59 +0200 Subject: [PATCH 40/43] Don't preload fonts.css, it does not exist anymore --- .htaccess | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.htaccess b/.htaccess index 7d28183..e627c94 100644 --- a/.htaccess +++ b/.htaccess @@ -36,5 +36,5 @@ FileETag None Header set X-Content-Type-Options nosniff Header set X-XSS-Protection "1; mode=block" Header set Referrer-Policy no-referrer - Header add Link "; rel=preload, ; rel=preload" "expr=%{CONTENT_TYPE} =~ m#text/html#" + Header add Link "; rel=preload" "expr=%{CONTENT_TYPE} =~ m#text/html#" From 1d5a81ad8c19cc86a066c1eda4f4e97710272144 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Tue, 20 Oct 2020 00:06:25 +0200 Subject: [PATCH 41/43] Don't override the VarDumper styles --- css/style.css | 3 +++ templates/inc/footer.tpl | 1 + templates/inc/head.tpl | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/css/style.css b/css/style.css index 8e6c098..82220a1 100644 --- a/css/style.css +++ b/css/style.css @@ -1,6 +1,9 @@ body { background-color: #ebebeb; background-image: url("../img/fond.jpg"); +} + +.page { font-family: "Open Sans", sans-serif; font-weight: 400; text-align: center; diff --git a/templates/inc/footer.tpl b/templates/inc/footer.tpl index dbf7c74..322e3e8 100644 --- a/templates/inc/footer.tpl +++ b/templates/inc/footer.tpl @@ -36,5 +36,6 @@ + diff --git a/templates/inc/head.tpl b/templates/inc/head.tpl index db940f5..e34d656 100644 --- a/templates/inc/head.tpl +++ b/templates/inc/head.tpl @@ -23,4 +23,5 @@ - + +
From 22bcbbb9aeb4aebec77f69b39beaf60203d6a9c4 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Tue, 20 Oct 2020 00:16:56 +0200 Subject: [PATCH 42/43] Upgrade grumphp to 1.0 So tests can be run in parallel --- composer.json | 2 +- composer.lock | 1334 ++++++++++++++++++++++++++++++++++++++++--------- grumphp.yml | 6 +- 3 files changed, 1113 insertions(+), 229 deletions(-) diff --git a/composer.json b/composer.json index 1d9cc5e..69670d7 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ "ergebnis/composer-normalize": "^2.6", "insite/composer-dangling-locked-deps": "^0.2.0", "php-mock/php-mock-mockery": "^1.3", - "phpro/grumphp": "^0.18.0", + "phpro/grumphp": "^1.0", "phpstan/phpstan": "^0.12.25", "phpunit/phpunit": "^8.4", "sensiolabs/security-checker": "^6.0", diff --git a/composer.lock b/composer.lock index 301cfb4..d6129aa 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c0d33bde893f1ac7cbfcd26d26a92c9f", + "content-hash": "779d7f64d1bd4a38943a0c10096cc330", "packages": [ { "name": "aura/session", @@ -1219,26 +1219,29 @@ }, { "name": "symfony/console", - "version": "v5.0.8", + "version": "v5.1.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "5fa1caadc8cdaa17bcfb25219f3b53fe294a9935" + "reference": "ae789a8a2ad189ce7e8216942cdb9b77319f5eb8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/5fa1caadc8cdaa17bcfb25219f3b53fe294a9935", - "reference": "5fa1caadc8cdaa17bcfb25219f3b53fe294a9935", + "url": "https://api.github.com/repos/symfony/console/zipball/ae789a8a2ad189ce7e8216942cdb9b77319f5eb8", + "reference": "ae789a8a2ad189ce7e8216942cdb9b77319f5eb8", "shasum": "" }, "require": { - "php": "^7.2.5", + "php": ">=7.2.5", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php73": "^1.8", - "symfony/service-contracts": "^1.1|^2" + "symfony/polyfill-php80": "^1.15", + "symfony/service-contracts": "^1.1|^2", + "symfony/string": "^5.1" }, "conflict": { "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", "symfony/event-dispatcher": "<4.4", "symfony/lock": "<4.4", "symfony/process": "<4.4" @@ -1264,7 +1267,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -1291,7 +1294,7 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2020-03-30T11:42:42+00:00" + "time": "2020-10-07T15:23:00+00:00" }, { "name": "symfony/finder", @@ -1344,16 +1347,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.17.0", + "version": "v1.18.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9" + "reference": "1c302646f6efc070cd46856e600e5e0684d6b454" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e94c8b1bbe2bc77507a1056cdb06451c75b427f9", - "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/1c302646f6efc070cd46856e600e5e0684d6b454", + "reference": "1c302646f6efc070cd46856e600e5e0684d6b454", "shasum": "" }, "require": { @@ -1365,7 +1368,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.17-dev" + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -1398,7 +1405,71 @@ "polyfill", "portable" ], - "time": "2020-05-12T16:14:59+00:00" + "time": "2020-07-14T12:35:20+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.18.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "b740103edbdcc39602239ee8860f0f45a8eb9aa5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b740103edbdcc39602239ee8860f0f45a8eb9aa5", + "reference": "b740103edbdcc39602239ee8860f0f45a8eb9aa5", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "time": "2020-07-14T12:35:20+00:00" }, { "name": "symfony/polyfill-intl-idn", @@ -1463,17 +1534,84 @@ "time": "2020-05-12T16:47:27+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.17.0", + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.18.1", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "fa79b11539418b02fc5e1897267673ba2c19419c" + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fa79b11539418b02fc5e1897267673ba2c19419c", - "reference": "fa79b11539418b02fc5e1897267673ba2c19419c", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e", + "reference": "37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "time": "2020-07-14T12:35:20+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.18.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a", + "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a", "shasum": "" }, "require": { @@ -1485,7 +1623,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.17-dev" + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -1519,7 +1661,7 @@ "portable", "shim" ], - "time": "2020-05-12T16:47:27+00:00" + "time": "2020-07-14T12:35:20+00:00" }, { "name": "symfony/polyfill-php72", @@ -1578,16 +1720,16 @@ }, { "name": "symfony/polyfill-php73", - "version": "v1.17.0", + "version": "v1.18.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "a760d8964ff79ab9bf057613a5808284ec852ccc" + "reference": "fffa1a52a023e782cdcc221d781fe1ec8f87fcca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a760d8964ff79ab9bf057613a5808284ec852ccc", - "reference": "a760d8964ff79ab9bf057613a5808284ec852ccc", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fffa1a52a023e782cdcc221d781fe1ec8f87fcca", + "reference": "fffa1a52a023e782cdcc221d781fe1ec8f87fcca", "shasum": "" }, "require": { @@ -1596,7 +1738,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.17-dev" + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -1632,29 +1778,96 @@ "portable", "shim" ], - "time": "2020-05-12T16:47:27+00:00" + "time": "2020-07-14T12:35:20+00:00" }, { - "name": "symfony/process", - "version": "v4.4.10", + "name": "symfony/polyfill-php80", + "version": "v1.17.1", "source": { "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "c714958428a85c86ab97e3a0c96db4c4f381b7f5" + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "4a5b6bba3259902e386eb80dd1956181ee90b5b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/c714958428a85c86ab97e3a0c96db4c4f381b7f5", - "reference": "c714958428a85c86ab97e3a0c96db4c4f381b7f5", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4a5b6bba3259902e386eb80dd1956181ee90b5b2", + "reference": "4a5b6bba3259902e386eb80dd1956181ee90b5b2", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": ">=7.0.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.4-dev" + "dev-master": "1.17-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2020-06-06T08:46:27+00:00" + }, + { + "name": "symfony/process", + "version": "v5.1.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "d3a2e64866169586502f0cd9cab69135ad12cee9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/d3a2e64866169586502f0cd9cab69135ad12cee9", + "reference": "d3a2e64866169586502f0cd9cab69135ad12cee9", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.15" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" } }, "autoload": { @@ -1681,24 +1894,24 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2020-05-30T20:06:45+00:00" + "time": "2020-09-02T16:23:27+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.0.1", + "version": "v2.2.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "144c5e51266b281231e947b51223ba14acf1a749" + "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/144c5e51266b281231e947b51223ba14acf1a749", - "reference": "144c5e51266b281231e947b51223ba14acf1a749", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d15da7ba4957ffb8f1747218be9e1a121fd298a1", + "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1", "shasum": "" }, "require": { - "php": "^7.2.5", + "php": ">=7.2.5", "psr/container": "^1.0" }, "suggest": { @@ -1707,7 +1920,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "2.2-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -1739,7 +1956,78 @@ "interoperability", "standards" ], - "time": "2019-11-18T17:27:11+00:00" + "time": "2020-09-07T11:33:47+00:00" + }, + { + "name": "symfony/string", + "version": "v5.1.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "4a9afe9d07bac506f75bcee8ed3ce76da5a9343e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/4a9afe9d07bac506f75bcee8ed3ce76da5a9343e", + "reference": "4a9afe9d07bac506f75bcee8ed3ce76da5a9343e", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" + }, + "require-dev": { + "symfony/error-handler": "^4.4|^5.0", + "symfony/http-client": "^4.4|^5.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "files": [ + "Resources/functions.php" + ], + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony String component", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "time": "2020-09-15T12:23:47+00:00" }, { "name": "symfony/translation", @@ -2008,6 +2296,479 @@ } ], "packages-dev": [ + { + "name": "amphp/amp", + "version": "v2.5.0", + "source": { + "type": "git", + "url": "https://github.com/amphp/amp.git", + "reference": "f220a51458bf4dd0dedebb171ac3457813c72bbc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/amp/zipball/f220a51458bf4dd0dedebb171ac3457813c72bbc", + "reference": "f220a51458bf4dd0dedebb171ac3457813c72bbc", + "shasum": "" + }, + "require": { + "php": ">=7" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "amphp/phpunit-util": "^1", + "ext-json": "*", + "jetbrains/phpstorm-stubs": "^2019.3", + "phpunit/phpunit": "^6.0.9 | ^7", + "psalm/phar": "^3.11@dev", + "react/promise": "^2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Amp\\": "lib" + }, + "files": [ + "lib/functions.php", + "lib/Internal/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Lowrey", + "email": "rdlowrey@php.net" + }, + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Bob Weinand", + "email": "bobwei9@hotmail.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "A non-blocking concurrency framework for PHP applications.", + "homepage": "http://amphp.org/amp", + "keywords": [ + "async", + "asynchronous", + "awaitable", + "concurrency", + "event", + "event-loop", + "future", + "non-blocking", + "promise" + ], + "time": "2020-07-14T21:47:18+00:00" + }, + { + "name": "amphp/byte-stream", + "version": "v1.8.0", + "source": { + "type": "git", + "url": "https://github.com/amphp/byte-stream.git", + "reference": "f0c20cf598a958ba2aa8c6e5a71c697d652c7088" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/byte-stream/zipball/f0c20cf598a958ba2aa8c6e5a71c697d652c7088", + "reference": "f0c20cf598a958ba2aa8c6e5a71c697d652c7088", + "shasum": "" + }, + "require": { + "amphp/amp": "^2", + "php": ">=7.1" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "amphp/phpunit-util": "^1.4", + "friendsofphp/php-cs-fixer": "^2.3", + "jetbrains/phpstorm-stubs": "^2019.3", + "phpunit/phpunit": "^6 || ^7 || ^8", + "psalm/phar": "^3.11.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Amp\\ByteStream\\": "lib" + }, + "files": [ + "lib/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "A stream abstraction to make working with non-blocking I/O simple.", + "homepage": "http://amphp.org/byte-stream", + "keywords": [ + "amp", + "amphp", + "async", + "io", + "non-blocking", + "stream" + ], + "time": "2020-06-29T18:35:05+00:00" + }, + { + "name": "amphp/parallel", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/amphp/parallel.git", + "reference": "2c1039bf7ca137eae4d954b14c09a7535d7d4e1c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/parallel/zipball/2c1039bf7ca137eae4d954b14c09a7535d7d4e1c", + "reference": "2c1039bf7ca137eae4d954b14c09a7535d7d4e1c", + "shasum": "" + }, + "require": { + "amphp/amp": "^2", + "amphp/byte-stream": "^1.6.1", + "amphp/parser": "^1", + "amphp/process": "^1", + "amphp/serialization": "^1", + "amphp/sync": "^1.0.1", + "php": ">=7.1" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "amphp/phpunit-util": "^1.1", + "phpunit/phpunit": "^8 || ^7" + }, + "type": "library", + "autoload": { + "psr-4": { + "Amp\\Parallel\\": "lib" + }, + "files": [ + "lib/Context/functions.php", + "lib/Sync/functions.php", + "lib/Worker/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Stephen Coakley", + "email": "me@stephencoakley.com" + } + ], + "description": "Parallel processing component for Amp.", + "homepage": "https://github.com/amphp/parallel", + "keywords": [ + "async", + "asynchronous", + "concurrent", + "multi-processing", + "multi-threading" + ], + "time": "2020-04-27T15:12:37+00:00" + }, + { + "name": "amphp/parallel-functions", + "version": "v0.1.3", + "source": { + "type": "git", + "url": "https://github.com/amphp/parallel-functions.git", + "reference": "12e6c602e067b02f78ddf5b720c17e9aa01ad4b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/parallel-functions/zipball/12e6c602e067b02f78ddf5b720c17e9aa01ad4b4", + "reference": "12e6c602e067b02f78ddf5b720c17e9aa01ad4b4", + "shasum": "" + }, + "require": { + "amphp/amp": "^2.0.3", + "amphp/parallel": "^0.1.8 || ^0.2 || ^1", + "opis/closure": "^3.0.7", + "php": ">=7" + }, + "require-dev": { + "amphp/phpunit-util": "^1.0", + "friendsofphp/php-cs-fixer": "^2.9", + "phpunit/phpunit": "^6.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Amp\\ParallelFunctions\\": "src" + }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "Parallel processing made simple.", + "time": "2018-10-28T15:29:02+00:00" + }, + { + "name": "amphp/parser", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/amphp/parser.git", + "reference": "f83e68f03d5b8e8e0365b8792985a7f341c57ae1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/parser/zipball/f83e68f03d5b8e8e0365b8792985a7f341c57ae1", + "reference": "f83e68f03d5b8e8e0365b8792985a7f341c57ae1", + "shasum": "" + }, + "require": { + "php": ">=7" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.3", + "phpunit/phpunit": "^6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Amp\\Parser\\": "lib" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + }, + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + } + ], + "description": "A generator parser to make streaming parsers simple.", + "homepage": "https://github.com/amphp/parser", + "keywords": [ + "async", + "non-blocking", + "parser", + "stream" + ], + "time": "2017-06-06T05:29:10+00:00" + }, + { + "name": "amphp/process", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/amphp/process.git", + "reference": "355b1e561b01c16ab3d78fada1ad47ccc96df70e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/process/zipball/355b1e561b01c16ab3d78fada1ad47ccc96df70e", + "reference": "355b1e561b01c16ab3d78fada1ad47ccc96df70e", + "shasum": "" + }, + "require": { + "amphp/amp": "^2", + "amphp/byte-stream": "^1.4", + "php": ">=7" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "amphp/phpunit-util": "^1", + "phpunit/phpunit": "^6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Amp\\Process\\": "lib" + }, + "files": [ + "lib/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bob Weinand", + "email": "bobwei9@hotmail.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + }, + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + } + ], + "description": "Asynchronous process manager.", + "homepage": "https://github.com/amphp/process", + "time": "2019-02-26T16:33:03+00:00" + }, + { + "name": "amphp/serialization", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/amphp/serialization.git", + "reference": "693e77b2fb0b266c3c7d622317f881de44ae94a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/serialization/zipball/693e77b2fb0b266c3c7d622317f881de44ae94a1", + "reference": "693e77b2fb0b266c3c7d622317f881de44ae94a1", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "phpunit/phpunit": "^9 || ^8 || ^7" + }, + "type": "library", + "autoload": { + "psr-4": { + "Amp\\Serialization\\": "src" + }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "Serialization tools for IPC and data storage in PHP.", + "homepage": "https://github.com/amphp/serialization", + "keywords": [ + "async", + "asynchronous", + "serialization", + "serialize" + ], + "time": "2020-03-25T21:39:07+00:00" + }, + { + "name": "amphp/sync", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/amphp/sync.git", + "reference": "613047ac54c025aa800a9cde5b05c3add7327ed4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/sync/zipball/613047ac54c025aa800a9cde5b05c3add7327ed4", + "reference": "613047ac54c025aa800a9cde5b05c3add7327ed4", + "shasum": "" + }, + "require": { + "amphp/amp": "^2.2", + "php": ">=7.1" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "amphp/phpunit-util": "^1.1", + "phpunit/phpunit": "^9 || ^8 || ^7" + }, + "type": "library", + "autoload": { + "psr-4": { + "Amp\\Sync\\": "src" + }, + "files": [ + "src/functions.php", + "src/ConcurrentIterator/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Stephen Coakley", + "email": "me@stephencoakley.com" + } + ], + "description": "Mutex, Semaphore, and other synchronization tools for Amp.", + "homepage": "https://github.com/amphp/sync", + "keywords": [ + "async", + "asynchronous", + "mutex", + "semaphore", + "synchronization" + ], + "time": "2020-05-07T18:57:50+00:00" + }, { "name": "consolidation/annotated-command", "version": "4.1.1", @@ -2445,33 +3206,28 @@ }, { "name": "doctrine/collections", - "version": "1.6.4", + "version": "1.6.7", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "6b1e4b2b66f6d6e49983cebfe23a21b7ccc5b0d7" + "reference": "55f8b799269a1a472457bd1a41b4f379d4cfba4a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/6b1e4b2b66f6d6e49983cebfe23a21b7ccc5b0d7", - "reference": "6b1e4b2b66f6d6e49983cebfe23a21b7ccc5b0d7", + "url": "https://api.github.com/repos/doctrine/collections/zipball/55f8b799269a1a472457bd1a41b4f379d4cfba4a", + "reference": "55f8b799269a1a472457bd1a41b4f379d4cfba4a", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.1.3 || ^8.0" }, "require-dev": { "doctrine/coding-standard": "^6.0", "phpstan/phpstan-shim": "^0.9.2", "phpunit/phpunit": "^7.0", - "vimeo/psalm": "^3.2.2" + "vimeo/psalm": "^3.8.1" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.6.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Common\\Collections\\": "lib/Doctrine/Common/Collections" @@ -2511,7 +3267,7 @@ "iterators", "php" ], - "time": "2019-11-13T13:07:11+00:00" + "time": "2020-07-27T17:53:49+00:00" }, { "name": "doctrine/instantiator", @@ -2755,35 +3511,34 @@ }, { "name": "gitonomy/gitlib", - "version": "v1.1.0", + "version": "v1.2.2", "source": { "type": "git", "url": "https://github.com/gitonomy/gitlib.git", - "reference": "49e599915eae04b734f31e6e88f773d32d921e2e" + "reference": "d1fe4676bf1347c08dec84a14a4c5e7110740d72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/gitonomy/gitlib/zipball/49e599915eae04b734f31e6e88f773d32d921e2e", - "reference": "49e599915eae04b734f31e6e88f773d32d921e2e", + "url": "https://api.github.com/repos/gitonomy/gitlib/zipball/d1fe4676bf1347c08dec84a14a4c5e7110740d72", + "reference": "d1fe4676bf1347c08dec84a14a4c5e7110740d72", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0", - "symfony/process": "^3.4|^4.0" + "ext-pcre": "*", + "php": "^5.6 || ^7.0 || ^8.0", + "symfony/polyfill-mbstring": "^1.7", + "symfony/process": "^3.4 || ^4.0 || ^5.0" }, "require-dev": { - "phpunit/phpunit": "^5.7|^6.5", + "ext-fileinfo": "*", + "phpunit/phpunit": "^5.7 || ^6.5 || ^7.0 || ^8.0 || ^9.0", "psr/log": "^1.0" }, "suggest": { + "ext-fileinfo": "Required to determine the mimetype of a blob", "psr/log": "Required to use loggers for reporting of execution" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, "autoload": { "psr-4": { "Gitonomy\\Git\\": "src/Gitonomy/Git/" @@ -2795,19 +3550,24 @@ ], "authors": [ { - "name": "Alexandre Salomé", - "email": "alexandre.salome@gmail.com", - "homepage": "http://alexandre-salome.fr" + "name": "Graham Campbell", + "email": "graham@alt-three.com" }, { - "name": "Julien DIDIER", - "email": "genzo.wm@gmail.com", - "homepage": "http://www.jdidier.net" + "name": "Julien Didier", + "email": "genzo.wm@gmail.com" + }, + { + "name": "Grégoire Pineau", + "email": "lyrixx@lyrixx.info" + }, + { + "name": "Alexandre Salomé", + "email": "alexandre.salome@gmail.com" } ], "description": "Library for accessing git", - "homepage": "http://gitonomy.com", - "time": "2019-06-23T09:49:01+00:00" + "time": "2020-07-30T14:54:11+00:00" }, { "name": "grasmash/expander", @@ -3240,20 +4000,20 @@ }, { "name": "monolog/monolog", - "version": "2.0.1", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "f9d56fd2f5533322caccdfcddbb56aedd622ef1c" + "reference": "f9eee5cec93dfb313a38b6b288741e84e53f02d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/f9d56fd2f5533322caccdfcddbb56aedd622ef1c", - "reference": "f9d56fd2f5533322caccdfcddbb56aedd622ef1c", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/f9eee5cec93dfb313a38b6b288741e84e53f02d5", + "reference": "f9eee5cec93dfb313a38b6b288741e84e53f02d5", "shasum": "" }, "require": { - "php": "^7.2", + "php": ">=7.2", "psr/log": "^1.0.1" }, "provide": { @@ -3264,11 +4024,11 @@ "doctrine/couchdb": "~1.0@dev", "elasticsearch/elasticsearch": "^6.0", "graylog2/gelf-php": "^1.4.2", - "jakub-onderka/php-parallel-lint": "^0.9", "php-amqplib/php-amqplib": "~2.4", "php-console/php-console": "^3.1.3", + "php-parallel-lint/php-parallel-lint": "^1.0", "phpspec/prophecy": "^1.6.1", - "phpunit/phpunit": "^8.3", + "phpunit/phpunit": "^8.5", "predis/predis": "^1.1", "rollbar/rollbar": "^1.3", "ruflin/elastica": ">=0.90 <3.0", @@ -3317,7 +4077,7 @@ "logging", "psr-3" ], - "time": "2019-11-13T10:27:43+00:00" + "time": "2020-07-23T08:41:23+00:00" }, { "name": "myclabs/deep-copy", @@ -3367,6 +4127,67 @@ ], "time": "2019-08-09T12:45:53+00:00" }, + { + "name": "opis/closure", + "version": "3.6.0", + "source": { + "type": "git", + "url": "https://github.com/opis/closure.git", + "reference": "c547f8262a5fa9ff507bd06cc394067b83a75085" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/opis/closure/zipball/c547f8262a5fa9ff507bd06cc394067b83a75085", + "reference": "c547f8262a5fa9ff507bd06cc394067b83a75085", + "shasum": "" + }, + "require": { + "php": "^5.4 || ^7.0 || ^8.0" + }, + "require-dev": { + "jeremeamia/superclosure": "^2.0", + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.6.x-dev" + } + }, + "autoload": { + "psr-4": { + "Opis\\Closure\\": "src/" + }, + "files": [ + "functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marius Sarca", + "email": "marius.sarca@gmail.com" + }, + { + "name": "Sorin Sarca", + "email": "sarca_sorin@hotmail.com" + } + ], + "description": "A library that can be used to serialize closures (anonymous functions) and arbitrary objects.", + "homepage": "https://opis.io/closure", + "keywords": [ + "anonymous functions", + "closure", + "function", + "serializable", + "serialization", + "serialize" + ], + "time": "2020-10-11T21:42:15+00:00" + }, { "name": "phar-io/manifest", "version": "1.0.3", @@ -3789,46 +4610,50 @@ }, { "name": "phpro/grumphp", - "version": "v0.18.1", + "version": "v1.0.0", "source": { "type": "git", "url": "https://github.com/phpro/grumphp.git", - "reference": "d07e59ebfdd48cf41d12b2af3670abcd1a2b01ef" + "reference": "8d2e85beab65311350ec57f1bb6396b07b4a97b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpro/grumphp/zipball/d07e59ebfdd48cf41d12b2af3670abcd1a2b01ef", - "reference": "d07e59ebfdd48cf41d12b2af3670abcd1a2b01ef", + "url": "https://api.github.com/repos/phpro/grumphp/zipball/8d2e85beab65311350ec57f1bb6396b07b4a97b6", + "reference": "8d2e85beab65311350ec57f1bb6396b07b4a97b6", "shasum": "" }, "require": { + "amphp/amp": "^2.4", + "amphp/parallel": "^1.4", + "amphp/parallel-functions": "^0.1.3", "composer-plugin-api": "~1.0 || ~2.0", - "doctrine/collections": "~1.2", + "doctrine/collections": "^1.6.7", "ext-json": "*", "gitonomy/gitlib": "^1.0.3", "monolog/monolog": "~1.16 || ^2.0", - "php": "^7.2", + "opis/closure": "^3.5", + "php": "^7.3", + "psr/container": "^1.0", "seld/jsonlint": "~1.1", - "symfony/config": "~3.4 || ~4.0 || ~5.0", - "symfony/console": "~3.4 || ~4.0 || ~5.0", - "symfony/dependency-injection": "~3.4 || ~4.0 || ~5.0", - "symfony/event-dispatcher": "~3.4 || ~4.0 || ~5.0", - "symfony/filesystem": "~3.4 || ~4.0 || ~5.0", - "symfony/finder": "~3.4 || ~4.0 || ~5.0", - "symfony/options-resolver": "~3.4 || ~4.0 || ~5.0", - "symfony/process": "~3.4 || ~4.0 || ~5.0", - "symfony/yaml": "~3.4 || ~4.0 || ~5.0" + "symfony/config": "~4.4 || ~5.0", + "symfony/console": "~4.4 || ~5.0", + "symfony/dependency-injection": "~4.4 || ~5.0", + "symfony/dotenv": "~4.4 || ~5.0", + "symfony/event-dispatcher": "~4.4 || ~5.0", + "symfony/filesystem": "~4.4 || ~5.0", + "symfony/finder": "~4.4 || ~5.0", + "symfony/options-resolver": "~4.4 || ~5.0", + "symfony/process": "~4.4 || ~5.0", + "symfony/yaml": "~4.4 || ~5.0" }, "require-dev": { - "brianium/paratest": "~3.1 || dev-master", + "brianium/paratest": "^4.1", "composer/composer": "~1.9 || ^2.0@dev", - "ergebnis/composer-normalize": "~2.1", "jakub-onderka/php-parallel-lint": "~1.0", - "nikic/php-parser": "~3.1", - "phpspec/phpspec": "~6.1", - "phpunit/phpunit": "^7.5.17", - "sensiolabs/security-checker": "~6.0", - "squizlabs/php_codesniffer": "~3.5" + "nikic/php-parser": "~4.0", + "phpspec/phpspec": "^6.2", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.2" }, "suggest": { "atoum/atoum": "Lets GrumPHP run your unit tests.", @@ -3845,7 +4670,9 @@ "jakub-onderka/php-parallel-lint": "Lets GrumPHP quickly lint your entire code base.", "maglnet/composer-require-checker": "Lets GrumPHP analyze composer dependencies.", "malukenho/kawaii-gherkin": "Lets GrumPHP lint your Gherkin files.", + "nette/tester": "Lets GrumPHP run your unit tests with nette tester.", "nikic/php-parser": "Lets GrumPHP run static analyses through your PHP files.", + "pestphp/pest": "Lets GrumPHP run your unit test with Pest PHP", "phan/phan": "Lets GrumPHP unleash a static analyzer on your code", "phing/phing": "Lets GrumPHP run your automated PHP tasks.", "phpmd/phpmd": "Lets GrumPHP sort out the mess in your code", @@ -3889,7 +4716,7 @@ } ], "description": "A composer plugin that enables source code quality checks.", - "time": "2020-05-27T04:48:38+00:00" + "time": "2020-09-25T05:15:46+00:00" }, { "name": "phpspec/prophecy", @@ -4995,20 +5822,20 @@ }, { "name": "seld/jsonlint", - "version": "1.7.2", + "version": "1.8.2", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "e2e5d290e4d2a4f0eb449f510071392e00e10d19" + "reference": "590cfec960b77fd55e39b7d9246659e95dd6d337" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/e2e5d290e4d2a4f0eb449f510071392e00e10d19", - "reference": "e2e5d290e4d2a4f0eb449f510071392e00e10d19", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/590cfec960b77fd55e39b7d9246659e95dd6d337", + "reference": "590cfec960b77fd55e39b7d9246659e95dd6d337", "shasum": "" }, "require": { - "php": "^5.3 || ^7.0" + "php": "^5.3 || ^7.0 || ^8.0" }, "require-dev": { "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" @@ -5040,7 +5867,7 @@ "parser", "validator" ], - "time": "2019-10-24T14:27:39+00:00" + "time": "2020-08-25T06:56:57+00:00" }, { "name": "sensiolabs/security-checker", @@ -5198,22 +6025,24 @@ }, { "name": "symfony/config", - "version": "v5.0.0", + "version": "v5.1.7", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "10cb9692805d2152fe2ecb3af018c188c712bba8" + "reference": "6ad8be6e1280f6734150d8a04a9160dd34ceb191" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/10cb9692805d2152fe2ecb3af018c188c712bba8", - "reference": "10cb9692805d2152fe2ecb3af018c188c712bba8", + "url": "https://api.github.com/repos/symfony/config/zipball/6ad8be6e1280f6734150d8a04a9160dd34ceb191", + "reference": "6ad8be6e1280f6734150d8a04a9160dd34ceb191", "shasum": "" }, "require": { - "php": "^7.2.5", + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", "symfony/filesystem": "^4.4|^5.0", - "symfony/polyfill-ctype": "~1.8" + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-php80": "^1.15" }, "conflict": { "symfony/finder": "<4.4" @@ -5231,7 +6060,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -5258,29 +6087,31 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2019-11-18T17:27:11+00:00" + "time": "2020-09-02T16:23:27+00:00" }, { "name": "symfony/dependency-injection", - "version": "v5.0.0", + "version": "v5.1.7", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "cdaee34c7de6d25bd7dd9712661eedda728d5e62" + "reference": "2dea4a3ef2eb79138354c1d49e9372cc921af20b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/cdaee34c7de6d25bd7dd9712661eedda728d5e62", - "reference": "cdaee34c7de6d25bd7dd9712661eedda728d5e62", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/2dea4a3ef2eb79138354c1d49e9372cc921af20b", + "reference": "2dea4a3ef2eb79138354c1d49e9372cc921af20b", "shasum": "" }, "require": { - "php": "^7.2.5", + "php": ">=7.2.5", "psr/container": "^1.0", + "symfony/deprecation-contracts": "^2.1", + "symfony/polyfill-php80": "^1.15", "symfony/service-contracts": "^1.1.6|^2" }, "conflict": { - "symfony/config": "<5.0", + "symfony/config": "<5.1", "symfony/finder": "<4.4", "symfony/proxy-manager-bridge": "<4.4", "symfony/yaml": "<4.4" @@ -5290,7 +6121,7 @@ "symfony/service-implementation": "1.0" }, "require-dev": { - "symfony/config": "^5.0", + "symfony/config": "^5.1", "symfony/expression-language": "^4.4|^5.0", "symfony/yaml": "^4.4|^5.0" }, @@ -5304,7 +6135,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -5331,7 +6162,115 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2019-11-21T07:02:40+00:00" + "time": "2020-10-01T12:14:45+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5fa56b4074d1ae755beb55617ddafe6f5d78f665", + "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "time": "2020-09-07T11:33:47+00:00" + }, + { + "name": "symfony/dotenv", + "version": "v5.1.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/dotenv.git", + "reference": "f406eaad1231415bf753fbef5aef267a787af4e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dotenv/zipball/f406eaad1231415bf753fbef5aef267a787af4e5", + "reference": "f406eaad1231415bf753fbef5aef267a787af4e5", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1" + }, + "require-dev": { + "symfony/process": "^4.4|^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Dotenv\\": "" + }, + "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": "Registers environment variables from a .env file", + "homepage": "https://symfony.com", + "keywords": [ + "dotenv", + "env", + "environment" + ], + "time": "2020-09-02T16:23:27+00:00" }, { "name": "symfony/error-handler", @@ -5390,21 +6329,23 @@ }, { "name": "symfony/event-dispatcher", - "version": "v5.0.8", + "version": "v5.1.7", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "24f40d95385774ed5c71dbf014edd047e2f2f3dc" + "reference": "d5de97d6af175a9e8131c546db054ca32842dd0f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/24f40d95385774ed5c71dbf014edd047e2f2f3dc", - "reference": "24f40d95385774ed5c71dbf014edd047e2f2f3dc", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d5de97d6af175a9e8131c546db054ca32842dd0f", + "reference": "d5de97d6af175a9e8131c546db054ca32842dd0f", "shasum": "" }, "require": { - "php": "^7.2.5", - "symfony/event-dispatcher-contracts": "^2" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/event-dispatcher-contracts": "^2", + "symfony/polyfill-php80": "^1.15" }, "conflict": { "symfony/dependency-injection": "<4.4" @@ -5417,6 +6358,7 @@ "psr/log": "~1.0", "symfony/config": "^4.4|^5.0", "symfony/dependency-injection": "^4.4|^5.0", + "symfony/error-handler": "^4.4|^5.0", "symfony/expression-language": "^4.4|^5.0", "symfony/http-foundation": "^4.4|^5.0", "symfony/service-contracts": "^1.1|^2", @@ -5429,7 +6371,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -5456,24 +6398,24 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2020-03-27T16:56:45+00:00" + "time": "2020-09-18T14:27:32+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v2.0.1", + "version": "v2.2.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "af23c2584d4577d54661c434446fb8fbed6025dd" + "reference": "0ba7d54483095a198fa51781bc608d17e84dffa2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/af23c2584d4577d54661c434446fb8fbed6025dd", - "reference": "af23c2584d4577d54661c434446fb8fbed6025dd", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0ba7d54483095a198fa51781bc608d17e84dffa2", + "reference": "0ba7d54483095a198fa51781bc608d17e84dffa2", "shasum": "" }, "require": { - "php": "^7.2.5", + "php": ">=7.2.5", "psr/event-dispatcher": "^1" }, "suggest": { @@ -5482,7 +6424,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "2.2-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -5514,30 +6460,30 @@ "interoperability", "standards" ], - "time": "2019-11-18T17:27:11+00:00" + "time": "2020-09-07T11:33:47+00:00" }, { "name": "symfony/filesystem", - "version": "v5.0.8", + "version": "v5.1.7", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "7cd0dafc4353a0f62e307df90b48466379c8cc91" + "reference": "1a8697545a8d87b9f2f6b1d32414199cc5e20aae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/7cd0dafc4353a0f62e307df90b48466379c8cc91", - "reference": "7cd0dafc4353a0f62e307df90b48466379c8cc91", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/1a8697545a8d87b9f2f6b1d32414199cc5e20aae", + "reference": "1a8697545a8d87b9f2f6b1d32414199cc5e20aae", "shasum": "" }, "require": { - "php": "^7.2.5", + "php": ">=7.2.5", "symfony/polyfill-ctype": "~1.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -5564,7 +6510,7 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2020-04-12T14:40:17+00:00" + "time": "2020-09-27T14:02:37+00:00" }, { "name": "symfony/http-client", @@ -5760,25 +6706,27 @@ }, { "name": "symfony/options-resolver", - "version": "v5.0.0", + "version": "v5.1.7", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "1ad3d0ffc00cc1990e5c9c7bb6b81578ec3f5f68" + "reference": "4c7e155bf7d93ea4ba3824d5a14476694a5278dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/1ad3d0ffc00cc1990e5c9c7bb6b81578ec3f5f68", - "reference": "1ad3d0ffc00cc1990e5c9c7bb6b81578ec3f5f68", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/4c7e155bf7d93ea4ba3824d5a14476694a5278dd", + "reference": "4c7e155bf7d93ea4ba3824d5a14476694a5278dd", "shasum": "" }, "require": { - "php": "^7.2.5" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/polyfill-php80": "^1.15" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -5810,73 +6758,7 @@ "configuration", "options" ], - "time": "2019-11-18T17:27:11+00:00" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.17.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "4a5b6bba3259902e386eb80dd1956181ee90b5b2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4a5b6bba3259902e386eb80dd1956181ee90b5b2", - "reference": "4a5b6bba3259902e386eb80dd1956181ee90b5b2", - "shasum": "" - }, - "require": { - "php": ">=7.0.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.17-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "time": "2020-06-06T08:46:27+00:00" + "time": "2020-09-27T03:44:28+00:00" }, { "name": "symfony/var-dumper", diff --git a/grumphp.yml b/grumphp.yml index f04c254..52e357b 100644 --- a/grumphp.yml +++ b/grumphp.yml @@ -1,8 +1,10 @@ --- -parameters: +grumphp: extensions: - ComposerDanglingLockedDeps\GrumPHP\Loader - ascii: ~ + ascii: + succeeded: ~ + failed: ~ tasks: jsonlint: ~ xmllint: ~ From f29a61f182a8c5adc0c18d0bfa434c6738a9a282 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Tue, 20 Oct 2020 00:22:34 +0200 Subject: [PATCH 43/43] Upgrade pretty-package-versions to 1.5 So we can have a cleaner way to get the root package version --- classes/Config.php | 2 +- composer.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/classes/Config.php b/classes/Config.php index 7fadf7f..1a8b5c2 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -316,7 +316,7 @@ class Config */ public function getAppVersion() { - $version = PrettyVersions::getVersion('rudloff/alltube'); + $version = PrettyVersions::getRootPackageVersion(); return $version->getPrettyVersion(); } diff --git a/composer.lock b/composer.lock index d6129aa..c9fb147 100644 --- a/composer.lock +++ b/composer.lock @@ -473,24 +473,24 @@ }, { "name": "jean85/pretty-package-versions", - "version": "1.3.0", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "e3517fb11b67e798239354fe8213927d012ad8f9" + "reference": "a917488320c20057da87f67d0d40543dd9427f7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/e3517fb11b67e798239354fe8213927d012ad8f9", - "reference": "e3517fb11b67e798239354fe8213927d012ad8f9", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/a917488320c20057da87f67d0d40543dd9427f7a", + "reference": "a917488320c20057da87f67d0d40543dd9427f7a", "shasum": "" }, "require": { "composer/package-versions-deprecated": "^1.8.0", - "php": "^7.0" + "php": "^7.0|^8.0" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^6.0|^8.5|^9.2" }, "type": "library", "extra": { @@ -520,7 +520,7 @@ "release", "versions" ], - "time": "2020-04-24T14:19:45+00:00" + "time": "2020-09-14T08:43:34+00:00" }, { "name": "mathmarques/smarty-view",