diff --git a/composer.json b/composer.json index 920105e..6a8ce03 100644 --- a/composer.json +++ b/composer.json @@ -4,19 +4,20 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=7.2.5", - "ext-ctype": "*", - "ext-iconv": "*", - "composer/package-versions-deprecated": "1.11.99.1", - "doctrine/annotations": "^1.0", - "doctrine/doctrine-bundle": "^2.2", - "doctrine/doctrine-migrations-bundle": "^3.0", - "doctrine/orm": "^2.8", - "phpdocumentor/reflection-docblock": "^5.2", - "ramsey/uuid-doctrine": "^1.6", - "sensio/framework-extra-bundle": "^5.6", - "symfony/asset": "5.2.*", - "symfony/console": "5.2.*", + "php": ">=7.2.5", + "ext-ctype": "*", + "ext-iconv": "*", + "amphp/http-client": "^4.5", + "composer/package-versions-deprecated": "1.11.99.1", + "doctrine/annotations": "^1.0", + "doctrine/doctrine-bundle": "^2.2", + "doctrine/doctrine-migrations-bundle": "^3.0", + "doctrine/orm": "^2.8", + "phpdocumentor/reflection-docblock": "^5.2", + "ramsey/uuid-doctrine": "^1.6", + "sensio/framework-extra-bundle": "^5.6", + "symfony/asset": "5.2.*", + "symfony/console": "5.2.*", "symfony/dotenv": "5.2.*", "symfony/expression-language": "5.2.*", "symfony/flex": "^1.3.1", diff --git a/composer.lock b/composer.lock index faa54b6..f648a5c 100644 --- a/composer.lock +++ b/composer.lock @@ -1,22 +1,858 @@ { - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "933c72cef2e64ebd56ee4b95dd36ffd0", - "packages": [ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "7a63ec16e3e2daa0fbf514d4aedd88d5", + "packages": [ + { + "name": "amphp/amp", + "version": "v2.5.1", + "source": { + "type": "git", + "url": "https://github.com/amphp/amp.git", + "reference": "ecdc3c476b3ccff02f8e5d5bcc04f7ccfd18751c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/amp/zipball/ecdc3c476b3ccff02f8e5d5bcc04f7ccfd18751c", + "reference": "ecdc3c476b3ccff02f8e5d5bcc04f7ccfd18751c", + "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": "brick/math", - "version": "0.9.1", - "source": { - "type": "git", - "url": "https://github.com/brick/math.git", - "reference": "283a40c901101e66de7061bd359252c013dcc43c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/brick/math/zipball/283a40c901101e66de7061bd359252c013dcc43c", + "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" + ], + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2020-11-03T16:23:45+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/cache", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/amphp/cache.git", + "reference": "e7bccc526fc2a555d59e6ee8380eeb39a95c0835" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/cache/zipball/e7bccc526fc2a555d59e6ee8380eeb39a95c0835", + "reference": "e7bccc526fc2a555d59e6ee8380eeb39a95c0835", + "shasum": "" + }, + "require": { + "amphp/amp": "^2", + "amphp/serialization": "^1", + "amphp/sync": "^1.2", + "php": ">=7.1" + }, + "conflict": { + "amphp/file": "<0.2 || >=2" + }, + "require-dev": { + "amphp/file": "^1", + "amphp/php-cs-fixer-config": "dev-master", + "amphp/phpunit-util": "^1.1", + "phpunit/phpunit": "^6 | ^7 | ^8 | ^9", + "vimeo/psalm": "^3.11@dev" + }, + "type": "library", + "autoload": { + "psr-4": { + "Amp\\Cache\\": "lib" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + }, + { + "name": "Daniel Lowrey", + "email": "rdlowrey@php.net" + } + ], + "description": "A promise-aware caching API for Amp.", + "homepage": "https://github.com/amphp/cache", + "time": "2020-04-19T16:10:08+00:00" + }, + { + "name": "amphp/dns", + "version": "v1.2.3", + "source": { + "type": "git", + "url": "https://github.com/amphp/dns.git", + "reference": "852292532294d7972c729a96b49756d781f7c59d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/dns/zipball/852292532294d7972c729a96b49756d781f7c59d", + "reference": "852292532294d7972c729a96b49756d781f7c59d", + "shasum": "" + }, + "require": { + "amphp/amp": "^2", + "amphp/byte-stream": "^1.1", + "amphp/cache": "^1.2", + "amphp/parser": "^1", + "amphp/windows-registry": "^0.3", + "daverandom/libdns": "^2.0.1", + "ext-filter": "*", + "ext-json": "*", + "php": ">=7.0" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "amphp/phpunit-util": "^1", + "phpunit/phpunit": "^6 || ^7 || ^8 || ^9" + }, + "type": "library", + "autoload": { + "psr-4": { + "Amp\\Dns\\": "lib" + }, + "files": [ + "lib/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Wright", + "email": "addr@daverandom.com" + }, + { + "name": "Daniel Lowrey", + "email": "rdlowrey@php.net" + }, + { + "name": "Bob Weinand", + "email": "bobwei9@hotmail.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + }, + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + } + ], + "description": "Async DNS resolution for Amp.", + "homepage": "https://github.com/amphp/dns", + "keywords": [ + "amp", + "amphp", + "async", + "client", + "dns", + "resolve" + ], + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2020-07-21T19:04:57+00:00" + }, + { + "name": "amphp/hpack", + "version": "v3.1.0", + "source": { + "type": "git", + "url": "https://github.com/amphp/hpack.git", + "reference": "0dcd35f9a8d9fc04d5fb8af0aeb109d4474cfad8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/hpack/zipball/0dcd35f9a8d9fc04d5fb8af0aeb109d4474cfad8", + "reference": "0dcd35f9a8d9fc04d5fb8af0aeb109d4474cfad8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "http2jp/hpack-test-case": "^1", + "phpunit/phpunit": "^6 | ^7" + }, + "type": "library", + "autoload": { + "psr-4": { + "Amp\\Http\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Lowrey", + "email": "rdlowrey@php.net" + }, + { + "name": "Bob Weinand" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + }, + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + } + ], + "description": "HTTP/2 HPack implementation.", + "homepage": "https://github.com/amphp/hpack", + "keywords": [ + "headers", + "hpack", + "http-2" + ], + "time": "2020-01-11T19:33:14+00:00" + }, + { + "name": "amphp/http", + "version": "v1.6.3", + "source": { + "type": "git", + "url": "https://github.com/amphp/http.git", + "reference": "e2b75561011a9596e4574cc867e07a706d56394b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/http/zipball/e2b75561011a9596e4574cc867e07a706d56394b", + "reference": "e2b75561011a9596e4574cc867e07a706d56394b", + "shasum": "" + }, + "require": { + "amphp/hpack": "^3", + "php": ">=7.1" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "phpunit/phpunit": "^7 || ^6.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Amp\\Http\\": "src" + }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "Basic HTTP primitives which can be shared by servers and clients.", + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2020-11-28T17:04:34+00:00" + }, + { + "name": "amphp/http-client", + "version": "v4.5.5", + "source": { + "type": "git", + "url": "https://github.com/amphp/http-client.git", + "reference": "ac286c0a2bf1bf175b08aa89d3086d1e9be03985" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/http-client/zipball/ac286c0a2bf1bf175b08aa89d3086d1e9be03985", + "reference": "ac286c0a2bf1bf175b08aa89d3086d1e9be03985", + "shasum": "" + }, + "require": { + "amphp/amp": "^2.4", + "amphp/byte-stream": "^1.6", + "amphp/hpack": "^3", + "amphp/http": "^1.6", + "amphp/socket": "^1", + "amphp/sync": "^1.3", + "league/uri": "^6", + "php": ">=7.2", + "psr/http-message": "^1" + }, + "conflict": { + "amphp/file": "<0.2" + }, + "require-dev": { + "amphp/file": "^1 || ^0.3 || ^0.2", + "amphp/http-server": "^2", + "amphp/php-cs-fixer-config": "dev-master", + "amphp/phpunit-util": "^1.1", + "amphp/react-adapter": "^2.1", + "clue/socks-react": "^1.0", + "ext-json": "*", + "kelunik/link-header-rfc5988": "^1.0", + "laminas/laminas-diactoros": "^2.3", + "phpunit/phpunit": "^7 || ^8 || ^9", + "vimeo/psalm": "^3.9@dev" + }, + "suggest": { + "amphp/file": "Required for file request bodies and HTTP archive logging", + "ext-json": "Required for logging HTTP archives", + "ext-zlib": "Allows using compression for response bodies." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, + "autoload": { + "psr-4": { + "Amp\\Http\\Client\\": "src" + }, + "files": [ + "src/Internal/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Lowrey", + "email": "rdlowrey@gmail.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + }, + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + } + ], + "description": "Asynchronous concurrent HTTP/2 and HTTP/1.1 client built on the Amp concurrency framework", + "homepage": "https://github.com/amphp/http-client", + "keywords": [ + "async", + "client", + "concurrent", + "http", + "non-blocking", + "rest" + ], + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2020-12-23T16:54:43+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/socket", + "version": "v1.1.3", + "source": { + "type": "git", + "url": "https://github.com/amphp/socket.git", + "reference": "b9064b98742d12f8f438eaf73369bdd7d8446331" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/socket/zipball/b9064b98742d12f8f438eaf73369bdd7d8446331", + "reference": "b9064b98742d12f8f438eaf73369bdd7d8446331", + "shasum": "" + }, + "require": { + "amphp/amp": "^2", + "amphp/byte-stream": "^1.6", + "amphp/dns": "^1 || ^0.9", + "ext-openssl": "*", + "kelunik/certificate": "^1.1", + "league/uri-parser": "^1.4", + "php": ">=7.1" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "amphp/phpunit-util": "^1", + "phpunit/phpunit": "^6 || ^7 || ^8", + "vimeo/psalm": "^3.9@dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Amp\\Socket\\": "src" + }, + "files": [ + "src/functions.php", + "src/Internal/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Lowrey", + "email": "rdlowrey@gmail.com" + }, + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "Async socket connection / server tools for Amp.", + "homepage": "https://github.com/amphp/socket", + "keywords": [ + "amp", + "async", + "encryption", + "non-blocking", + "sockets", + "tcp", + "tls" + ], + "time": "2020-06-25T18:55:28+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": "amphp/windows-registry", + "version": "v0.3.3", + "source": { + "type": "git", + "url": "https://github.com/amphp/windows-registry.git", + "reference": "0f56438b9197e224325e88f305346f0221df1f71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/windows-registry/zipball/0f56438b9197e224325e88f305346f0221df1f71", + "reference": "0f56438b9197e224325e88f305346f0221df1f71", + "shasum": "" + }, + "require": { + "amphp/amp": "^2", + "amphp/byte-stream": "^1.4", + "amphp/process": "^1" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master" + }, + "type": "library", + "autoload": { + "psr-4": { + "Amp\\WindowsRegistry\\": "lib" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "Windows Registry Reader.", + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2020-07-10T16:13:29+00:00" + }, + { + "name": "brick/math", + "version": "0.9.1", + "source": { + "type": "git", + "url": "https://github.com/brick/math.git", + "reference": "283a40c901101e66de7061bd359252c013dcc43c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/brick/math/zipball/283a40c901101e66de7061bd359252c013dcc43c", "reference": "283a40c901101e66de7061bd359252c013dcc43c", "shasum": "" }, @@ -118,26 +954,66 @@ }, { "url": "https://github.com/composer", - "type": "github" + "type": "github" }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } ], - "time": "2020-11-11T10:22:58+00:00" + "time": "2020-11-11T10:22:58+00:00" }, - { - "name": "doctrine/annotations", - "version": "1.11.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "ce77a7ba1770462cd705a91a151b6c3746f9c6ad" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/ce77a7ba1770462cd705a91a151b6c3746f9c6ad", + { + "name": "daverandom/libdns", + "version": "v2.0.2", + "source": { + "type": "git", + "url": "https://github.com/DaveRandom/LibDNS.git", + "reference": "e8b6d6593d18ac3a6a14666d8a68a4703b2e05f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/DaveRandom/LibDNS/zipball/e8b6d6593d18ac3a6a14666d8a68a4703b2e05f9", + "reference": "e8b6d6593d18ac3a6a14666d8a68a4703b2e05f9", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "php": ">=7.0" + }, + "suggest": { + "ext-intl": "Required for IDN support" + }, + "type": "library", + "autoload": { + "psr-4": { + "LibDNS\\": "src/" + }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "DNS protocol implementation written in pure PHP", + "keywords": [ + "dns" + ], + "time": "2019-12-03T09:12:46+00:00" + }, + { + "name": "doctrine/annotations", + "version": "1.11.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "ce77a7ba1770462cd705a91a151b6c3746f9c6ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/ce77a7ba1770462cd705a91a151b6c3746f9c6ad", "reference": "ce77a7ba1770462cd705a91a151b6c3746f9c6ad", "shasum": "" }, @@ -1520,26 +2396,75 @@ "funding": [ { "url": "https://github.com/Ocramius", - "type": "github" + "type": "github" }, - { - "url": "https://tidelift.com/funding/github/packagist/ocramius/proxy-manager", - "type": "tidelift" - } + { + "url": "https://tidelift.com/funding/github/packagist/ocramius/proxy-manager", + "type": "tidelift" + } ], - "time": "2021-01-04T11:21:26+00:00" + "time": "2021-01-04T11:21:26+00:00" }, + { + "name": "kelunik/certificate", + "version": "v1.1.2", + "source": { + "type": "git", + "url": "https://github.com/kelunik/certificate.git", + "reference": "56542e62d51533d04d0a9713261fea546bff80f6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kelunik/certificate/zipball/56542e62d51533d04d0a9713261fea546bff80f6", + "reference": "56542e62d51533d04d0a9713261fea546bff80f6", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "php": ">=5.4" + }, + "require-dev": { + "fabpot/php-cs-fixer": "^1.9", + "phpunit/phpunit": "^4.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Kelunik\\Certificate\\": "lib" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ { - "name": "laminas/laminas-code", - "version": "4.0.0", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-code.git", - "reference": "28a6d70ea8b8bca687d7163300e611ae33baf82a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-code/zipball/28a6d70ea8b8bca687d7163300e611ae33baf82a", + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "Access certificate details and transform between different formats.", + "keywords": [ + "DER", + "certificate", + "certificates", + "openssl", + "pem", + "x509" + ], + "time": "2019-05-29T19:02:31+00:00" + }, + { + "name": "laminas/laminas-code", + "version": "4.0.0", + "source": { + "type": "git", + "url": "https://github.com/laminas/laminas-code.git", + "reference": "28a6d70ea8b8bca687d7163300e611ae33baf82a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laminas/laminas-code/zipball/28a6d70ea8b8bca687d7163300e611ae33baf82a", "reference": "28a6d70ea8b8bca687d7163300e611ae33baf82a", "shasum": "" }, @@ -1702,25 +2627,242 @@ "laminas", "zf" ], - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], - "time": "2020-09-14T14:23:00+00:00" + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2020-09-14T14:23:00+00:00" }, + { + "name": "league/uri", + "version": "6.4.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/uri.git", + "reference": "09da64118eaf4c5d52f9923a1e6a5be1da52fd9a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/uri/zipball/09da64118eaf4c5d52f9923a1e6a5be1da52fd9a", + "reference": "09da64118eaf4c5d52f9923a1e6a5be1da52fd9a", + "shasum": "" + }, + "require": { + "ext-json": "*", + "league/uri-interfaces": "^2.1", + "php": ">=7.2", + "psr/http-message": "^1.0" + }, + "conflict": { + "league/uri-schemes": "^1.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.16", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^8.0 || ^9.0", + "psr/http-factory": "^1.0" + }, + "suggest": { + "ext-fileinfo": "Needed to create Data URI from a filepath", + "ext-intl": "Needed to improve host validation", + "league/uri-components": "Needed to easily manipulate URI objects", + "psr/http-factory": "Needed to use the URI factory" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Uri\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ { - "name": "monolog/monolog", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/monolog.git", - "reference": "1cb1cde8e8dd0f70cc0fe51354a59acad9302084" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1cb1cde8e8dd0f70cc0fe51354a59acad9302084", + "name": "Ignace Nyamagana Butera", + "email": "nyamsprod@gmail.com", + "homepage": "https://nyamsprod.com" + } + ], + "description": "URI manipulation library", + "homepage": "http://uri.thephpleague.com", + "keywords": [ + "data-uri", + "file-uri", + "ftp", + "hostname", + "http", + "https", + "middleware", + "parse_str", + "parse_url", + "psr-7", + "query-string", + "querystring", + "rfc3986", + "rfc3987", + "rfc6570", + "uri", + "uri-template", + "url", + "ws" + ], + "funding": [ + { + "url": "https://github.com/sponsors/nyamsprod", + "type": "github" + } + ], + "time": "2020-11-22T14:29:11+00:00" + }, + { + "name": "league/uri-interfaces", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/uri-interfaces.git", + "reference": "667f150e589d65d79c89ffe662e426704f84224f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/667f150e589d65d79c89ffe662e426704f84224f", + "reference": "667f150e589d65d79c89ffe662e426704f84224f", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Uri\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ignace Nyamagana Butera", + "email": "nyamsprod@gmail.com", + "homepage": "https://nyamsprod.com" + } + ], + "description": "Common interface for URI representation", + "homepage": "http://github.com/thephpleague/uri-interfaces", + "keywords": [ + "rfc3986", + "rfc3987", + "uri", + "url" + ], + "funding": [ + { + "url": "https://github.com/sponsors/nyamsprod", + "type": "github" + } + ], + "time": "2020-10-31T13:45:51+00:00" + }, + { + "name": "league/uri-parser", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/uri-parser.git", + "reference": "671548427e4c932352d9b9279fdfa345bf63fa00" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/uri-parser/zipball/671548427e4c932352d9b9279fdfa345bf63fa00", + "reference": "671548427e4c932352d9b9279fdfa345bf63fa00", + "shasum": "" + }, + "require": { + "php": ">=7.0.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.0", + "phpstan/phpstan": "^0.9.2", + "phpstan/phpstan-phpunit": "^0.9.4", + "phpstan/phpstan-strict-rules": "^0.9.0", + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-intl": "Allow parsing RFC3987 compliant hosts", + "league/uri-schemes": "Allow validating and normalizing URI parsing results" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Uri\\": "src" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ignace Nyamagana Butera", + "email": "nyamsprod@gmail.com", + "homepage": "https://nyamsprod.com" + } + ], + "description": "userland URI parser RFC 3986 compliant", + "homepage": "https://github.com/thephpleague/uri-parser", + "keywords": [ + "parse_url", + "parser", + "rfc3986", + "rfc3987", + "uri", + "url" + ], + "time": "2018-11-22T07:55:51+00:00" + }, + { + "name": "monolog/monolog", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "1cb1cde8e8dd0f70cc0fe51354a59acad9302084" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1cb1cde8e8dd0f70cc0fe51354a59acad9302084", "reference": "1cb1cde8e8dd0f70cc0fe51354a59acad9302084", "shasum": "" }, @@ -2081,25 +3223,75 @@ "homepage": "http://www.php-fig.org/" } ], - "description": "Standard interfaces for event handling.", - "keywords": [ - "events", - "psr", - "psr-14" - ], - "time": "2019-01-08T18:20:26+00:00" + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "time": "2019-01-08T18:20:26+00:00" }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ { - "name": "psr/link", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/link.git", - "reference": "eea8e8662d5cd3ae4517c9b864493f59fca95562" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/link/zipball/eea8e8662d5cd3ae4517c9b864493f59fca95562", + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "psr/link", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/link.git", + "reference": "eea8e8662d5cd3ae4517c9b864493f59fca95562" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/link/zipball/eea8e8662d5cd3ae4517c9b864493f59fca95562", "reference": "eea8e8662d5cd3ae4517c9b864493f59fca95562", "shasum": "" }, diff --git a/landingzone/.gitignore b/landingzone/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/migrations/Version20210105224915.php b/migrations/Version20210105224915.php new file mode 100644 index 0000000..f16ab11 --- /dev/null +++ b/migrations/Version20210105224915.php @@ -0,0 +1,63 @@ +addSql('DROP INDEX UNIQ_8D93D6495E237E06'); + $this->addSql('CREATE TEMPORARY TABLE __temp__user AS SELECT id, password, name, roles FROM user'); + $this->addSql('DROP TABLE user'); + $this->addSql('CREATE TABLE user (id BLOB NOT NULL, password VARCHAR(255) NOT NULL COLLATE BINARY, name VARCHAR(180) NOT NULL COLLATE BINARY, roles CLOB NOT NULL COLLATE BINARY --(DC2Type:json) + , PRIMARY KEY(id))'); + $this->addSql('INSERT INTO user (id, password, name, roles) SELECT id, password, name, roles FROM __temp__user'); + $this->addSql('DROP TABLE __temp__user'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D6495E237E06 ON user (name)'); + $this->addSql('DROP INDEX IDX_7CC7DA2C16678C77'); + $this->addSql('CREATE TEMPORARY TABLE __temp__video AS SELECT id, uploader_id, uploaded, name, description, tags FROM video'); + $this->addSql('DROP TABLE video'); + $this->addSql('CREATE TABLE video (id BLOB NOT NULL, uploader_id BLOB NOT NULL, uploaded DATETIME NOT NULL --(DC2Type:datetime_immutable) + , name VARCHAR(255) NOT NULL COLLATE BINARY, description VARCHAR(1024) NOT NULL COLLATE BINARY, tags CLOB NOT NULL COLLATE BINARY --(DC2Type:array) + , state INTEGER NOT NULL, PRIMARY KEY(id), CONSTRAINT FK_7CC7DA2C16678C77 FOREIGN KEY (uploader_id) REFERENCES user (id) NOT DEFERRABLE INITIALLY IMMEDIATE)'); + $this->addSql('INSERT INTO video (id, uploader_id, uploaded, name, description, tags) SELECT id, uploader_id, uploaded, name, description, tags FROM __temp__video'); + $this->addSql('DROP TABLE __temp__video'); + $this->addSql('CREATE INDEX IDX_7CC7DA2C16678C77 ON video (uploader_id)'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('DROP INDEX UNIQ_8D93D6495E237E06'); + $this->addSql('CREATE TEMPORARY TABLE __temp__user AS SELECT id, name, roles, password FROM user'); + $this->addSql('DROP TABLE user'); + $this->addSql('CREATE TABLE user (id BLOB NOT NULL, name VARCHAR(180) NOT NULL, roles CLOB NOT NULL --(DC2Type:json) + , password VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('INSERT INTO user (id, name, roles, password) SELECT id, name, roles, password FROM __temp__user'); + $this->addSql('DROP TABLE __temp__user'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D6495E237E06 ON user (name)'); + $this->addSql('DROP INDEX IDX_7CC7DA2C16678C77'); + $this->addSql('CREATE TEMPORARY TABLE __temp__video AS SELECT id, uploader_id, uploaded, name, description, tags FROM video'); + $this->addSql('DROP TABLE video'); + $this->addSql('CREATE TABLE video (id BLOB NOT NULL, uploaded DATETIME NOT NULL --(DC2Type:datetime_immutable) + , name VARCHAR(255) NOT NULL, description VARCHAR(1024) NOT NULL, tags CLOB NOT NULL --(DC2Type:array) + , uploader_id BLOB NOT NULL, PRIMARY KEY(id))'); + $this->addSql('INSERT INTO video (id, uploader_id, uploaded, name, description, tags) SELECT id, uploader_id, uploaded, name, description, tags FROM __temp__video'); + $this->addSql('DROP TABLE __temp__video'); + $this->addSql('CREATE INDEX IDX_7CC7DA2C16678C77 ON video (uploader_id)'); + } +} diff --git a/scripts/transcode.sh b/scripts/transcode.sh new file mode 100755 index 0000000..46d741e --- /dev/null +++ b/scripts/transcode.sh @@ -0,0 +1,49 @@ +#!/bin/sh + +dir="content/$1/" +mkdir "$dir" +mkdir "$dir/360p/" +mkdir "$dir/480p/" +mkdir "$dir/720p/" +mkdir "$dir/1080p/" + +#ffmpeg -hide_banner -y -i "landingzone/$1.vid" \ +# -vf scale=w=640:h=360:force_original_aspect_ratio=decrease -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 \ +# -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 800k -maxrate 856k -bufsize 1200k \ +# -b:a 96k -hls_segment_filename "$dir/360p/%03d.ts" "$dir/360p.m3u8" \ +# -vf scale=w=842:h=480:force_original_aspect_ratio=decrease -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 \ +# -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 1400k -maxrate 1498k -bufsize 2100k \ +# -b:a 128k -hls_segment_filename "$dir/480p/%03d.ts" "$dir/480p.m3u8" \ +# -vf scale=w=1280:h=720:force_original_aspect_ratio=decrease -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 \ +# -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 2800k -maxrate 2996k -bufsize 4200k \ +# -b:a 128k -hls_segment_filename "$dir/720p/%03d.ts" "$dir/720p.m3u8" \ +# -vf scale=w=1920:h=1080:force_original_aspect_ratio=decrease -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 \ +# -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 5000k -maxrate 5350k -bufsize 7500k \ +# -b:a 192k -hls_segment_filename "$dir/1080p/%03d.ts" "$dir/1080p.m3u8" + +ffmpeg -hide_banner -y -i "landingzone/$1.vid" \ + -vf scale=w='(oh/a/2)*2':h=360 -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 \ + -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 800k -maxrate 856k -bufsize 1200k \ + -b:a 96k -hls_segment_filename "$dir/360p/360p-%03d.ts" "$dir/360p/playlist.m3u8" \ + -vf scale=w='(oh/a/2)*2':h=480 -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 \ + -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 1400k -maxrate 1498k -bufsize 2100k \ + -b:a 128k -hls_segment_filename "$dir/480p/480p-%03d.ts" "$dir/480p/playlist.m3u8" \ + -vf scale=w='(oh/a/2)*2':h=720 -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 \ + -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 2800k -maxrate 2996k -bufsize 4200k \ + -b:a 128k -hls_segment_filename "$dir/720p/720p-%03d.ts" "$dir/720p/playlist.m3u8" \ + -vf scale=w='(oh/a/2)*2':h=1080 -c:a aac -ar 48000 -c:v h264 -profile:v main -crf 20 \ + -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 5000k -maxrate 5350k -bufsize 7500k \ + -b:a 192k -hls_segment_filename "$dir/1080p/1080p-%03d.ts" "$dir/1080p/playlist.m3u8" + +cat > "$dir/playlist.m3u8" <userRepository = $userRepository; - $this->videoRepository = $videoRepository; + $this->userService = $userService; + $this->videoService = $videoService; } /** @@ -32,11 +35,36 @@ class HomeController extends AbstractController return $this->redirectToRoute("app_login"); } - $user = $this->userRepository->findOneByName($this->getUser()->getUsername()); - $videos = $this->videoRepository->findByUploader($user); + $user = $this->userService->getLoggedInUser(); + $videos = $this->videoService->getVideos($user); - dump($videos); + return $this->render("home/dashboard.html.twig", [ + "videos" => $videos + ]); + } - return $this->render("home/dashboard.html.twig"); + /** + * @Route("/upload", name="app_upload") + */ + public function upload(Request $request): Response + { + $video = new Video(); + $form = $this->createForm(VideoType::class, $video); + + $form->handleRequest($request); + if ($form->isSubmitted() && $form->isValid()) { + $video = $form->getData(); + + $file = $form->get("file")->getData(); + if (!$file) { + $form->addError(new FormError("")); + } else { + $this->videoService->addVideo($video, $file); + } + } + + return $this->render("home/upload.html.twig", [ + "form" => $form->createView() + ]); } } \ No newline at end of file diff --git a/src/Entity/Video.php b/src/Entity/Video.php index 4d6e47d..cb1be4c 100644 --- a/src/Entity/Video.php +++ b/src/Entity/Video.php @@ -13,6 +13,11 @@ use Ramsey\Uuid\UuidInterface; */ class Video { + public const WAITING = 1; + public const PROCESSING_THUMBNAIL = 2; + public const PROCESSING_TRANSCODE = 3; + public const DONE = 4; + /** * @ORM\Id * @ORM\Column(type="uuid", unique=true) @@ -47,10 +52,10 @@ class Video */ private $tags = []; - public function __construct() - { - $this->uploaded = new DateTimeImmutable(); - } + /** + * @ORM\Column(type="integer") + */ + private $state = self::WAITING; public function getId(): ?UuidInterface { @@ -74,6 +79,12 @@ class Video return $this->uploaded; } + public function setUploaded(): self + { + $this->uploaded = new DateTimeImmutable(); + return $this; + } + public function getName(): ?string { return $this->name; @@ -109,4 +120,15 @@ class Video return $this; } + + public function setState($state): self + { + $this->state = $state; + return $this; + } + + public function getState(): int + { + return $this->state; + } } diff --git a/src/Form/VideoType.php b/src/Form/VideoType.php new file mode 100644 index 0000000..8ec78f6 --- /dev/null +++ b/src/Form/VideoType.php @@ -0,0 +1,54 @@ +add("name", TextType::class) + ->add("description", TextareaType::class) + ->add("file", FileType::class, [ + "label" => "Video File", + "mapped" => false, + "required" => true, + "constraints" => [ + new File([ + "maxSize" => "1024Mi", + "maxSizeMessage" => "Yo, the file is too thigh. ({{ limit }} {{ suffix }})", + "mimeTypes" => [ + "video/mp4", + "video/H264", + "video/H265", + "video/3gpp", + "video/quicktime", + "video/mpv" + ], + "mimeTypesMessage" => "Video type not supported." + ]) + ] + ]) + ->add("submit", SubmitType::class); + } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + 'data_class' => Video::class, + ]); + } + +} \ No newline at end of file diff --git a/src/Repository/UserRepository.php b/src/Repository/UserRepository.php index 5948d73..f112a67 100644 --- a/src/Repository/UserRepository.php +++ b/src/Repository/UserRepository.php @@ -54,12 +54,12 @@ class UserRepository extends ServiceEntityRepository implements PasswordUpgrader } */ - public function findOneByName($value): ?User + /*public function findOneByName($value): ?User { return $this->createQueryBuilder('u') ->andWhere('u.name = :val') ->setParameter('val', $value) ->getQuery() ->getOneOrNullResult(); - } + }*/ } diff --git a/src/Repository/VideoRepository.php b/src/Repository/VideoRepository.php index 6616dea..1fbb1c3 100644 --- a/src/Repository/VideoRepository.php +++ b/src/Repository/VideoRepository.php @@ -45,4 +45,15 @@ class VideoRepository extends ServiceEntityRepository ->getArrayResult() ; }*/ + + public function save(Video $video) + { + $this->_em->persist($video); + $this->_em->flush(); + } + + public function update() + { + $this->_em->flush(); + } } diff --git a/src/Service/UserService.php b/src/Service/UserService.php new file mode 100644 index 0000000..20b0278 --- /dev/null +++ b/src/Service/UserService.php @@ -0,0 +1,34 @@ +security = $security; + $this->userRepository = $userRepository; + } + + public function getLoggedInUser(): ?User + { + $user = $this->security->getUser(); + if (!$user) { + return null; + } + + $user = $this->userRepository->findOneByName($user->getUsername()); + + return $user; + } +} \ No newline at end of file diff --git a/src/Service/VideoService.php b/src/Service/VideoService.php new file mode 100644 index 0000000..8d4bb0e --- /dev/null +++ b/src/Service/VideoService.php @@ -0,0 +1,49 @@ +videoRepository = $videoRepository; + $this->userService = $userService; + } + + public function getVideos(User $user): array + { + return $this->videoRepository->findByUploader($user); + } + + public function addVideo(Video $video, UploadedFile $file) + { + $video->setUploaded(); + $video->setUploader($this->userService->getLoggedInUser()); + $this->videoRepository->save($video); + + $file->move(self::LANDINGZONE_DIRECTORY, $video->getId()->toString() . ".vid"); + } + + public function getVideosForTranscode(): array + { + return $this->videoRepository->findByState(Video::WAITING); + } + + public function setVideoState(Video $video, $state) + { + $video->setState($state); + $this->videoRepository->update(); + } +} \ No newline at end of file diff --git a/symfony.lock b/symfony.lock index db9b804..7257f8b 100644 --- a/symfony.lock +++ b/symfony.lock @@ -1,10 +1,52 @@ { + "amphp/amp": { + "version": "v2.5.1" + }, + "amphp/byte-stream": { + "version": "v1.8.0" + }, + "amphp/cache": { + "version": "v1.4.0" + }, + "amphp/dns": { + "version": "v1.2.3" + }, + "amphp/hpack": { + "version": "v3.1.0" + }, + "amphp/http": { + "version": "v1.6.3" + }, + "amphp/http-client": { + "version": "v4.5.5" + }, + "amphp/parser": { + "version": "v1.0.0" + }, + "amphp/process": { + "version": "v1.1.0" + }, + "amphp/serialization": { + "version": "v1.0.0" + }, + "amphp/socket": { + "version": "v1.1.3" + }, + "amphp/sync": { + "version": "v1.4.0" + }, + "amphp/windows-registry": { + "version": "v0.3.3" + }, "brick/math": { "version": "0.9.1" }, "composer/package-versions-deprecated": { "version": "1.11.99.1" }, + "daverandom/libdns": { + "version": "v2.0.2" + }, "doctrine/annotations": { "version": "1.0", "recipe": { @@ -102,6 +144,9 @@ "friendsofphp/proxy-manager-lts": { "version": "v1.0.2" }, + "kelunik/certificate": { + "version": "v1.1.2" + }, "laminas/laminas-code": { "version": "4.0.0" }, @@ -111,6 +156,15 @@ "laminas/laminas-zendframework-bridge": { "version": "1.1.1" }, + "league/uri": { + "version": "6.4.0" + }, + "league/uri-interfaces": { + "version": "2.2.0" + }, + "league/uri-parser": { + "version": "1.4.1" + }, "monolog/monolog": { "version": "2.2.0" }, @@ -138,6 +192,9 @@ "psr/event-dispatcher": { "version": "1.0.0" }, + "psr/http-message": { + "version": "1.0.1" + }, "psr/link": { "version": "1.0.0" }, diff --git a/templates/home/dashboard.html.twig b/templates/home/dashboard.html.twig index ae38124..3a20cbb 100644 --- a/templates/home/dashboard.html.twig +++ b/templates/home/dashboard.html.twig @@ -4,6 +4,10 @@ {% block body %} - Hi + {% for video in videos %} +
+ {{ video.name }} +
+ {% endfor %} {% endblock %} \ No newline at end of file diff --git a/templates/home/upload.html.twig b/templates/home/upload.html.twig new file mode 100644 index 0000000..a5c8ffd --- /dev/null +++ b/templates/home/upload.html.twig @@ -0,0 +1,7 @@ +{% extends 'base.html.twig' %} + +{% block title %}Home{% endblock %} + +{% block body %} + {{ form(form) }} +{% endblock %} \ No newline at end of file