From 51c20b55a063d20d35946e46343d52a9f79d87d8 Mon Sep 17 00:00:00 2001 From: Michel Fedde <35878897+Neintonine@users.noreply.github.com> Date: Sun, 30 Jun 2024 22:29:50 +0200 Subject: [PATCH] Implermented login --- .gitignore | 3 +- composer.json | 10 +- composer.lock | 1777 ++++++++++++++++++- src/css/common/index.scss | 29 +- src/js/common/index.ts | 4 +- src/php/Api/DiscordAPI.php | 79 + src/php/ContainerHandler.php | 3 +- src/php/DoctrineManager.php | 33 + src/php/Entities/Account/User.php | 85 + src/php/Entities/SystemAttribute.php | 34 + src/php/Environment/DatabaseEnvironment.php | 21 + src/php/Environment/EnvironmentHandler.php | 12 + src/php/Errors/ExtendedException.php | 26 + src/php/Errors/WhoopsHandler.php | 8 + src/php/Login/DiscordLoginProvider.php | 47 + src/php/Login/LoginHandler.php | 65 +- src/php/Login/LoginMethod.php | 16 + src/php/Login/LoginProvider.php | 12 + src/php/Login/UserPermission.php | 19 + src/php/Paths.php | 2 + src/php/Routing/LoginRoutes.php | 44 + src/php/Routing/Router.php | 6 +- src/php/Routing/SetupRoute.php | 53 + src/php/SetupHandler.php | 13 + src/php/bin/doctrine.php | 15 + src/php/bootstrap.php | 11 + src/php/index.dev.php | 11 +- src/templates/layout/accountDisplay.php | 37 + src/templates/layout/main.php | 25 +- src/templates/layout/navbar.php | 34 + 30 files changed, 2495 insertions(+), 39 deletions(-) create mode 100644 src/php/Api/DiscordAPI.php create mode 100644 src/php/DoctrineManager.php create mode 100644 src/php/Entities/Account/User.php create mode 100644 src/php/Entities/SystemAttribute.php create mode 100644 src/php/Environment/DatabaseEnvironment.php create mode 100644 src/php/Errors/ExtendedException.php create mode 100644 src/php/Errors/WhoopsHandler.php create mode 100644 src/php/Login/DiscordLoginProvider.php create mode 100644 src/php/Login/LoginMethod.php create mode 100644 src/php/Login/LoginProvider.php create mode 100644 src/php/Login/UserPermission.php create mode 100644 src/php/Routing/SetupRoute.php create mode 100644 src/php/SetupHandler.php create mode 100644 src/php/bin/doctrine.php create mode 100644 src/php/bootstrap.php create mode 100644 src/templates/layout/accountDisplay.php create mode 100644 src/templates/layout/navbar.php diff --git a/.gitignore b/.gitignore index 6fe2641..92835b4 100644 --- a/.gitignore +++ b/.gitignore @@ -123,4 +123,5 @@ Thumbs.db # ------------ # ignore public directory (we build it on server) -/public \ No newline at end of file +/public +/data/ diff --git a/composer.json b/composer.json index 15bcf1f..b59f2d5 100644 --- a/composer.json +++ b/composer.json @@ -12,6 +12,14 @@ "laminas/laminas-diactoros": "^3.3", "laminas/laminas-httphandlerrunner": "^2.10", "ralouphie/mimey": "^1.0", - "dotenv-org/phpdotenv-vault": "^0.2.4" + "dotenv-org/phpdotenv-vault": "^0.2.4", + "doctrine/orm": "^3.2", + "doctrine/dbal": "^4.0", + "symfony/uid": "^7.1", + "php-curl-class/php-curl-class": "^9.19", + "symfony/cache": "^7.1", + }, + "require-dev": { + "ext-xdebug": "*" } } diff --git a/composer.lock b/composer.lock index 8b77550..b7b1891 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,763 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "4de2ef21cc0982a5170abd32ccf9d3bb", + "content-hash": "3dbd3cfcf406f3c8c63570303d3d7942", "packages": [ + { + "name": "doctrine/collections", + "version": "2.2.2", + "source": { + "type": "git", + "url": "https://github.com/doctrine/collections.git", + "reference": "d8af7f248c74f195f7347424600fd9e17b57af59" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/collections/zipball/d8af7f248c74f195f7347424600fd9e17b57af59", + "reference": "d8af7f248c74f195f7347424600fd9e17b57af59", + "shasum": "" + }, + "require": { + "doctrine/deprecations": "^1", + "php": "^8.1" + }, + "require-dev": { + "doctrine/coding-standard": "^12", + "ext-json": "*", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^10.5", + "vimeo/psalm": "^5.11" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Collections\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.", + "homepage": "https://www.doctrine-project.org/projects/collections.html", + "keywords": [ + "array", + "collections", + "iterators", + "php" + ], + "support": { + "issues": "https://github.com/doctrine/collections/issues", + "source": "https://github.com/doctrine/collections/tree/2.2.2" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcollections", + "type": "tidelift" + } + ], + "time": "2024-04-18T06:56:21+00:00" + }, + { + "name": "doctrine/dbal", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/doctrine/dbal.git", + "reference": "50fda19f80724b55ff770bb4ff352407008e63c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/50fda19f80724b55ff770bb4ff352407008e63c5", + "reference": "50fda19f80724b55ff770bb4ff352407008e63c5", + "shasum": "" + }, + "require": { + "doctrine/deprecations": "^0.5.3|^1", + "php": "^8.1", + "psr/cache": "^1|^2|^3", + "psr/log": "^1|^2|^3" + }, + "require-dev": { + "doctrine/coding-standard": "12.0.0", + "fig/log-test": "^1", + "jetbrains/phpstorm-stubs": "2023.2", + "phpstan/phpstan": "1.11.5", + "phpstan/phpstan-phpunit": "1.4.0", + "phpstan/phpstan-strict-rules": "^1.6", + "phpunit/phpunit": "10.5.22", + "psalm/plugin-phpunit": "0.19.0", + "slevomat/coding-standard": "8.13.1", + "squizlabs/php_codesniffer": "3.10.1", + "symfony/cache": "^6.3.8|^7.0", + "symfony/console": "^5.4|^6.3|^7.0", + "vimeo/psalm": "5.24.0" + }, + "suggest": { + "symfony/console": "For helpful console commands such as SQL execution and import of files." + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\DBAL\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + } + ], + "description": "Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.", + "homepage": "https://www.doctrine-project.org/projects/dbal.html", + "keywords": [ + "abstraction", + "database", + "db2", + "dbal", + "mariadb", + "mssql", + "mysql", + "oci8", + "oracle", + "pdo", + "pgsql", + "postgresql", + "queryobject", + "sasql", + "sql", + "sqlite", + "sqlserver", + "sqlsrv" + ], + "support": { + "issues": "https://github.com/doctrine/dbal/issues", + "source": "https://github.com/doctrine/dbal/tree/4.0.4" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdbal", + "type": "tidelift" + } + ], + "time": "2024-06-19T11:57:23+00:00" + }, + { + "name": "doctrine/deprecations", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/doctrine/deprecations.git", + "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9", + "phpstan/phpstan": "1.4.10 || 1.10.15", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "0.18.4", + "psr/log": "^1 || ^2 || ^3", + "vimeo/psalm": "4.30.0 || 5.12.0" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/1.1.3" + }, + "time": "2024-01-30T19:34:25+00:00" + }, + { + "name": "doctrine/event-manager", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/event-manager.git", + "reference": "b680156fa328f1dfd874fd48c7026c41570b9c6e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/event-manager/zipball/b680156fa328f1dfd874fd48c7026c41570b9c6e", + "reference": "b680156fa328f1dfd874fd48c7026c41570b9c6e", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "conflict": { + "doctrine/common": "<2.9" + }, + "require-dev": { + "doctrine/coding-standard": "^12", + "phpstan/phpstan": "^1.8.8", + "phpunit/phpunit": "^10.5", + "vimeo/psalm": "^5.24" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.", + "homepage": "https://www.doctrine-project.org/projects/event-manager.html", + "keywords": [ + "event", + "event dispatcher", + "event manager", + "event system", + "events" + ], + "support": { + "issues": "https://github.com/doctrine/event-manager/issues", + "source": "https://github.com/doctrine/event-manager/tree/2.0.1" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fevent-manager", + "type": "tidelift" + } + ], + "time": "2024-05-22T20:47:39+00:00" + }, + { + "name": "doctrine/inflector", + "version": "2.0.10", + "source": { + "type": "git", + "url": "https://github.com/doctrine/inflector.git", + "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/5817d0659c5b50c9b950feb9af7b9668e2c436bc", + "reference": "5817d0659c5b50c9b950feb9af7b9668e2c436bc", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^11.0", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.3", + "phpunit/phpunit": "^8.5 || ^9.5", + "vimeo/psalm": "^4.25 || ^5.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", + "homepage": "https://www.doctrine-project.org/projects/inflector.html", + "keywords": [ + "inflection", + "inflector", + "lowercase", + "manipulation", + "php", + "plural", + "singular", + "strings", + "uppercase", + "words" + ], + "support": { + "issues": "https://github.com/doctrine/inflector/issues", + "source": "https://github.com/doctrine/inflector/tree/2.0.10" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector", + "type": "tidelift" + } + ], + "time": "2024-02-18T20:23:39+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "doctrine/coding-standard": "^11", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.9.4", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5.27", + "vimeo/psalm": "^5.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/2.0.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2022-12-30T00:23:10+00:00" + }, + { + "name": "doctrine/lexer", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", + "reference": "31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "doctrine/coding-standard": "^12", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^10.5", + "psalm/plugin-phpunit": "^0.18.3", + "vimeo/psalm": "^5.21" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Lexer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "keywords": [ + "annotations", + "docblock", + "lexer", + "parser", + "php" + ], + "support": { + "issues": "https://github.com/doctrine/lexer/issues", + "source": "https://github.com/doctrine/lexer/tree/3.0.1" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", + "type": "tidelift" + } + ], + "time": "2024-02-05T11:56:58+00:00" + }, + { + "name": "doctrine/orm", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/orm.git", + "reference": "722cea6536775206e81744542b36fa7c9a4ea3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/orm/zipball/722cea6536775206e81744542b36fa7c9a4ea3e5", + "reference": "722cea6536775206e81744542b36fa7c9a4ea3e5", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2", + "doctrine/collections": "^2.2", + "doctrine/dbal": "^3.8.2 || ^4", + "doctrine/deprecations": "^0.5.3 || ^1", + "doctrine/event-manager": "^1.2 || ^2", + "doctrine/inflector": "^1.4 || ^2.0", + "doctrine/instantiator": "^1.3 || ^2", + "doctrine/lexer": "^3", + "doctrine/persistence": "^3.3.1", + "ext-ctype": "*", + "php": "^8.1", + "psr/cache": "^1 || ^2 || ^3", + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/var-exporter": "^6.3.9 || ^7.0" + }, + "require-dev": { + "doctrine/coding-standard": "^12.0", + "phpbench/phpbench": "^1.0", + "phpstan/phpstan": "1.11.1", + "phpunit/phpunit": "^10.4.0", + "psr/log": "^1 || ^2 || ^3", + "squizlabs/php_codesniffer": "3.7.2", + "symfony/cache": "^5.4 || ^6.2 || ^7.0", + "vimeo/psalm": "5.24.0" + }, + "suggest": { + "ext-dom": "Provides support for XSD validation for XML mapping files", + "symfony/cache": "Provides cache support for Setup Tool with doctrine/cache 2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\ORM\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "Object-Relational-Mapper for PHP", + "homepage": "https://www.doctrine-project.org/projects/orm.html", + "keywords": [ + "database", + "orm" + ], + "support": { + "issues": "https://github.com/doctrine/orm/issues", + "source": "https://github.com/doctrine/orm/tree/3.2.1" + }, + "time": "2024-06-26T21:48:58+00:00" + }, + { + "name": "doctrine/persistence", + "version": "3.3.3", + "source": { + "type": "git", + "url": "https://github.com/doctrine/persistence.git", + "reference": "b337726451f5d530df338fc7f68dee8781b49779" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/persistence/zipball/b337726451f5d530df338fc7f68dee8781b49779", + "reference": "b337726451f5d530df338fc7f68dee8781b49779", + "shasum": "" + }, + "require": { + "doctrine/event-manager": "^1 || ^2", + "php": "^7.2 || ^8.0", + "psr/cache": "^1.0 || ^2.0 || ^3.0" + }, + "conflict": { + "doctrine/common": "<2.10" + }, + "require-dev": { + "doctrine/coding-standard": "^12", + "doctrine/common": "^3.0", + "phpstan/phpstan": "1.11.1", + "phpstan/phpstan-phpunit": "^1", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.5", + "symfony/cache": "^4.4 || ^5.4 || ^6.0", + "vimeo/psalm": "4.30.0 || 5.24.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Persistence\\": "src/Persistence" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + }, + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "The Doctrine Persistence project is a set of shared interfaces and functionality that the different Doctrine object mappers share.", + "homepage": "https://www.doctrine-project.org/projects/persistence.html", + "keywords": [ + "mapper", + "object", + "odm", + "orm", + "persistence" + ], + "support": { + "issues": "https://github.com/doctrine/persistence/issues", + "source": "https://github.com/doctrine/persistence/tree/3.3.3" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fpersistence", + "type": "tidelift" + } + ], + "time": "2024-06-20T10:14:30+00:00" + }, { "name": "dotenv-org/phpdotenv-vault", "version": "v0.2.4", @@ -694,6 +1449,86 @@ }, "time": "2022-01-27T09:35:39+00:00" }, + { + "name": "php-curl-class/php-curl-class", + "version": "9.19.2", + "source": { + "type": "git", + "url": "https://github.com/php-curl-class/php-curl-class.git", + "reference": "c41efeb4ea2dc3cf8f90f8f967b0fcf45a41e294" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-curl-class/php-curl-class/zipball/c41efeb4ea2dc3cf8f90f8f967b0fcf45a41e294", + "reference": "c41efeb4ea2dc3cf8f90f8f967b0fcf45a41e294", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": ">=7.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "*", + "ext-gd": "*", + "friendsofphp/php-cs-fixer": "*", + "phpcompatibility/php-compatibility": "dev-develop", + "phpcsstandards/phpcsutils": "@alpha", + "phpunit/phpunit": "*", + "squizlabs/php_codesniffer": "*", + "vimeo/psalm": ">=0.3.63" + }, + "suggest": { + "ext-mbstring": "*" + }, + "type": "library", + "autoload": { + "psr-4": { + "Curl\\": "src/Curl/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Unlicense" + ], + "authors": [ + { + "name": "Zach Borboa" + }, + { + "name": "Contributors", + "homepage": "https://github.com/php-curl-class/php-curl-class/graphs/contributors" + } + ], + "description": "PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs.", + "homepage": "https://github.com/php-curl-class/php-curl-class", + "keywords": [ + "API-Client", + "api", + "class", + "client", + "curl", + "framework", + "http", + "http-client", + "http-proxy", + "json", + "php", + "php-curl", + "php-curl-library", + "proxy", + "requests", + "restful", + "web-scraper", + "web-scraping ", + "web-service", + "xml" + ], + "support": { + "issues": "https://github.com/php-curl-class/php-curl-class/issues", + "source": "https://github.com/php-curl-class/php-curl-class/tree/9.19.2" + }, + "time": "2024-04-09T18:03:13+00:00" + }, { "name": "phpoption/phpoption", "version": "1.9.2", @@ -769,6 +1604,55 @@ ], "time": "2023-11-12T21:59:55+00:00" }, + { + "name": "psr/cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/3.0.0" + }, + "time": "2021-02-03T23:26:27+00:00" + }, { "name": "psr/container", "version": "2.0.2", @@ -1188,6 +2072,339 @@ }, "time": "2016-09-28T03:36:23+00:00" }, + { + "name": "symfony/cache", + "version": "v7.1.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache.git", + "reference": "e933e1d947ffb88efcdd34a2bd51561cab7deaae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/cache/zipball/e933e1d947ffb88efcdd34a2bd51561cab7deaae", + "reference": "e933e1d947ffb88efcdd34a2bd51561cab7deaae", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "psr/cache": "^2.0|^3.0", + "psr/log": "^1.1|^2|^3", + "symfony/cache-contracts": "^2.5|^3", + "symfony/deprecation-contracts": "^2.5|^3.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/var-exporter": "^6.4|^7.0" + }, + "conflict": { + "doctrine/dbal": "<3.6", + "symfony/dependency-injection": "<6.4", + "symfony/http-kernel": "<6.4", + "symfony/var-dumper": "<6.4" + }, + "provide": { + "psr/cache-implementation": "2.0|3.0", + "psr/simple-cache-implementation": "1.0|2.0|3.0", + "symfony/cache-implementation": "1.1|2.0|3.0" + }, + "require-dev": { + "cache/integration-tests": "dev-master", + "doctrine/dbal": "^3.6|^4", + "predis/predis": "^1.1|^2.0", + "psr/simple-cache": "^1.0|^2.0|^3.0", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/filesystem": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Cache\\": "" + }, + "classmap": [ + "Traits/ValueWrapper.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": "Provides extended PSR-6, PSR-16 (and tags) implementations", + "homepage": "https://symfony.com", + "keywords": [ + "caching", + "psr6" + ], + "support": { + "source": "https://github.com/symfony/cache/tree/v7.1.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-06-11T13:32:38+00:00" + }, + { + "name": "symfony/cache-contracts", + "version": "v3.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache-contracts.git", + "reference": "df6a1a44c890faded49a5fca33c2d5c5fd3c2197" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/df6a1a44c890faded49a5fca33c2d5c5fd3c2197", + "reference": "df6a1a44c890faded49a5fca33c2d5c5fd3c2197", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/cache": "^3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Cache\\": "" + } + }, + "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 caching", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/cache-contracts/tree/v3.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:32:20+00:00" + }, + { + "name": "symfony/console", + "version": "v7.1.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "0aa29ca177f432ab68533432db0de059f39c92ae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/0aa29ca177f432ab68533432db0de059f39c92ae", + "reference": "0aa29ca177f432ab68533432db0de059f39c92ae", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-mbstring": "~1.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^6.4|^7.0" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/lock": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" + }, + "type": "library", + "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": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v7.1.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-06-28T10:03:55+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.5-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", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:32:20+00:00" + }, { "name": "symfony/polyfill-ctype", "version": "v1.30.0", @@ -1267,6 +2484,165 @@ ], "time": "2024-05-31T15:07:36+00:00" }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.30.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/64647a7c30b2283f5d49b874d84a18fc22054b7a", + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "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" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T15:07:36+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.30.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/a95281b0be0d9ab48050ebd988b967875cdb9fdb", + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "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" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T15:07:36+00:00" + }, { "name": "symfony/polyfill-mbstring", "version": "v1.30.0", @@ -1427,6 +2803,405 @@ ], "time": "2024-05-31T15:07:36+00:00" }, + { + "name": "symfony/polyfill-uuid", + "version": "v1.30.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-uuid.git", + "reference": "2ba1f33797470debcda07fe9dce20a0003df18e9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/2ba1f33797470debcda07fe9dce20a0003df18e9", + "reference": "2ba1f33797470debcda07fe9dce20a0003df18e9", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-uuid": "*" + }, + "suggest": { + "ext-uuid": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Uuid\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Grégoire Pineau", + "email": "lyrixx@lyrixx.info" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for uuid functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "uuid" + ], + "support": { + "source": "https://github.com/symfony/polyfill-uuid/tree/v1.30.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T15:07:36+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "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" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:32:20+00:00" + }, + { + "name": "symfony/string", + "version": "v7.1.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "14221089ac66cf82e3cf3d1c1da65de305587ff8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/14221089ac66cf82e3cf3d1c1da65de305587ff8", + "reference": "14221089ac66cf82e3cf3d1c1da65de305587ff8", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.5" + }, + "require-dev": { + "symfony/emoji": "^7.1", + "symfony/error-handler": "^6.4|^7.0", + "symfony/http-client": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "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": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v7.1.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-06-28T09:27:18+00:00" + }, + { + "name": "symfony/uid", + "version": "v7.1.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/uid.git", + "reference": "bb59febeecc81528ff672fad5dab7f06db8c8277" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/uid/zipball/bb59febeecc81528ff672fad5dab7f06db8c8277", + "reference": "bb59febeecc81528ff672fad5dab7f06db8c8277", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-uuid": "^1.15" + }, + "require-dev": { + "symfony/console": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Uid\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Grégoire Pineau", + "email": "lyrixx@lyrixx.info" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to generate and represent UIDs", + "homepage": "https://symfony.com", + "keywords": [ + "UID", + "ulid", + "uuid" + ], + "support": { + "source": "https://github.com/symfony/uid/tree/v7.1.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-05-31T14:57:53+00:00" + }, + { + "name": "symfony/var-exporter", + "version": "v7.1.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-exporter.git", + "reference": "b80a669a2264609f07f1667f891dbfca25eba44c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/b80a669a2264609f07f1667f891dbfca25eba44c", + "reference": "b80a669a2264609f07f1667f891dbfca25eba44c", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "symfony/property-access": "^6.4|^7.0", + "symfony/serializer": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\VarExporter\\": "" + }, + "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": "Allows exporting any serializable PHP data structure to plain PHP code", + "homepage": "https://symfony.com", + "keywords": [ + "clone", + "construct", + "export", + "hydrate", + "instantiate", + "lazy-loading", + "proxy", + "serialize" + ], + "support": { + "source": "https://github.com/symfony/var-exporter/tree/v7.1.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-06-28T08:00:31+00:00" + }, { "name": "vlucas/phpdotenv", "version": "v5.6.0", diff --git a/src/css/common/index.scss b/src/css/common/index.scss index bafca61..acb8a8e 100644 --- a/src/css/common/index.scss +++ b/src/css/common/index.scss @@ -3,7 +3,7 @@ $main-container-max-width: 992px; -.navbar :first-child, +.navigation-container, main { width: 100%; max-width: $main-container-max-width; @@ -11,3 +11,30 @@ main { margin: 0 auto; } +.ratio-1 { + aspect-ratio: 1; +} + +.avatar { + height: 3rem; + + .avatar-login-method-icon { + scale: 1.5; + } +} + +@include media-breakpoint-down(lg) { + .mode-switch { + text-align: center; + padding-top: 0.5rem; + margin-left: auto; + } + + .navigation-container { + .navbar-brand { + margin: 0 auto !important; + } + + } + +} \ No newline at end of file diff --git a/src/js/common/index.ts b/src/js/common/index.ts index a9600ac..adb695b 100644 --- a/src/js/common/index.ts +++ b/src/js/common/index.ts @@ -1 +1,3 @@ -import "./theme"; \ No newline at end of file +import "./theme"; + +import "bootstrap/js/src/collapse"; \ No newline at end of file diff --git a/src/php/Api/DiscordAPI.php b/src/php/Api/DiscordAPI.php new file mode 100644 index 0000000..67e122a --- /dev/null +++ b/src/php/Api/DiscordAPI.php @@ -0,0 +1,79 @@ +env->getDiscordEnvironment(); + + $curl = new Curl(); + $curl->setHeader('Content-Type', 'application/x-www-form-urlencoded'); + $curl->setBasicAuthentication($discordEnv->clientId, $discordEnv->clientSecret); + + $data =[ + 'grant_type' => 'authorization_code', + 'code' => $code, + 'redirect_uri' => $redirectUri + ]; + $curl->post(self::OAUTH_TOKEN_URL, $data); + + if ($curl->error) { + $curl->diagnose(); + + throw new ExtendedException($curl->errorMessage, [ 'response' => $curl->response, 'data' => $data ]); + } + + $accessToken = $curl->response->access_token; + $tokenType = $curl->response->token_type; + + $curl = new Curl(); + $curl->setHeader("authorization", "$tokenType $accessToken"); + $curl->get(self::USER_ME_URL); + + if ($curl->error) { + $curl->diagnose(); + + throw new ExtendedException($curl->errorMessage, [ 'response' => $curl->response, ]); + } + + return [ + 'id' => $curl->response->id, + 'global_name' => $curl->response->global_name, + 'avatar' => $curl->response->avatar, + 'discriminator' => (int) $curl->response->discriminator + ]; + } + + public function getAvatarURL(string $userId, string|int $avatarHash) { + if (is_int($avatarHash)) { + return "https://cdn.discordapp.com/embed/avatars/{$avatarHash}.png"; + } + + $extension = 'png'; + if (str_starts_with($avatarHash, 'a_')) { + $extension = 'gif'; + } + + return "https://cdn.discordapp.com/avatars/{$userId}/{$avatarHash}.{$extension}"; + } +} \ No newline at end of file diff --git a/src/php/ContainerHandler.php b/src/php/ContainerHandler.php index c0be762..34c8427 100644 --- a/src/php/ContainerHandler.php +++ b/src/php/ContainerHandler.php @@ -33,6 +33,7 @@ final class ContainerHandler private static function createInstance() { self::$instance = new Container(); - self::$instance->delegate(new ReflectionContainer(true)); + $reflectionContainer = new ReflectionContainer(true); + self::$instance->delegate($reflectionContainer); } } \ No newline at end of file diff --git a/src/php/DoctrineManager.php b/src/php/DoctrineManager.php new file mode 100644 index 0000000..ca0f674 --- /dev/null +++ b/src/php/DoctrineManager.php @@ -0,0 +1,33 @@ +get(EnvironmentHandler::class); + + $config = ORMSetup::createAttributeMetadataConfiguration( + paths: [ Paths::PHP_SOURCE_PATH . '/Entities' ], + isDevMode: !$environmentHandler->isProduction() + ); + + $dbEnvironment = $environmentHandler->getDatabaseEnvironment(); + $connection = DriverManager::getConnection($dbEnvironment->getDoctrineConfig()); + + $entityManager = new EntityManager($connection, $config); + + $container->addShared(EntityManager::class, $entityManager); + $container->addShared(Connection::class, $connection); + } + +} \ No newline at end of file diff --git a/src/php/Entities/Account/User.php b/src/php/Entities/Account/User.php new file mode 100644 index 0000000..26131d9 --- /dev/null +++ b/src/php/Entities/Account/User.php @@ -0,0 +1,85 @@ +loginMethod = $loginMethod; + $this->foreignLoginId = $foreignLoginId; + $this->name = $name; + $this->profilePictureUrl = $profilePictureUrl; + $this->permission = $permission; + } + + public function getId(): ?int + { + return $this->id; + } + + public function getLoginMethod(): LoginMethod + { + return $this->loginMethod; + } + + public function getForeignLoginId(): ?string + { + return $this->foreignLoginId; + } + + public function getName(): string + { + return $this->name; + } + + public function getProfilePictureUrl(): string + { + return $this->profilePictureUrl; + } + + public function getPermission(): UserPermission + { + return $this->permission; + } + + public function setName(string $name): void + { + $this->name = $name; + } + + public function setProfilePictureUrl(string $profilePictureUrl): void + { + $this->profilePictureUrl = $profilePictureUrl; + } + + public function setPermission(UserPermission $permission): void + { + $this->permission = $permission; + } +} \ No newline at end of file diff --git a/src/php/Entities/SystemAttribute.php b/src/php/Entities/SystemAttribute.php new file mode 100644 index 0000000..5eeab0f --- /dev/null +++ b/src/php/Entities/SystemAttribute.php @@ -0,0 +1,34 @@ +name = $name; + $this->value = $value; + } + + public function getName(): string + { + return $this->name; + } + + public function getValue(): string + { + return $this->value; + } +} \ No newline at end of file diff --git a/src/php/Environment/DatabaseEnvironment.php b/src/php/Environment/DatabaseEnvironment.php new file mode 100644 index 0000000..7e5ab3e --- /dev/null +++ b/src/php/Environment/DatabaseEnvironment.php @@ -0,0 +1,21 @@ + $this->driver, + 'path' => $this->path + ]; + } +} \ No newline at end of file diff --git a/src/php/Environment/EnvironmentHandler.php b/src/php/Environment/EnvironmentHandler.php index af5c41f..8774be0 100644 --- a/src/php/Environment/EnvironmentHandler.php +++ b/src/php/Environment/EnvironmentHandler.php @@ -25,4 +25,16 @@ final class EnvironmentHandler $_SERVER['DISCORD_CLIENT_LOGIN_URI'], ); } + + public function getDatabaseEnvironment(): DatabaseEnvironment + { + return new DatabaseEnvironment( + $_SERVER['DB_DRIVER'], + $_SERVER['DB_PATH'] + ); + } + + public function isProduction(): bool { + return $_SERVER['PRODUCTION'] === 'true'; + } } \ No newline at end of file diff --git a/src/php/Errors/ExtendedException.php b/src/php/Errors/ExtendedException.php new file mode 100644 index 0000000..f06ff35 --- /dev/null +++ b/src/php/Errors/ExtendedException.php @@ -0,0 +1,26 @@ +addDataTable("Additional Info", $additionals); + } +} \ No newline at end of file diff --git a/src/php/Errors/WhoopsHandler.php b/src/php/Errors/WhoopsHandler.php new file mode 100644 index 0000000..a5e17a8 --- /dev/null +++ b/src/php/Errors/WhoopsHandler.php @@ -0,0 +1,8 @@ +getUserFromCode($request->getQueryParams()['code'], (string)$request->getUri()->withQuery('')); + + $repo = $this->entityManager->getRepository(User::class); + $users = $repo->findBy(['loginMethod' => LoginMethod::DISCORD, 'foreignLoginId' => $result['id']]); + + $profilePictureUrl = $discordApiHandler->getAvatarURL($result['id'], $result['avatar'] ?? $result['discriminator'] % 5); + if (!empty($users)) { + $user = $users[0]; + $user->setName($result['global_name']); + $user->setProfilePictureUrl($profilePictureUrl); + + return $user; + } + + $newUser = new User( + LoginMethod::DISCORD, + $result['id'], + $result['global_name'], + $profilePictureUrl, + UserPermission::VIEWER + ); + + return $newUser; + } +} \ No newline at end of file diff --git a/src/php/Login/LoginHandler.php b/src/php/Login/LoginHandler.php index bbab46d..407d00f 100644 --- a/src/php/Login/LoginHandler.php +++ b/src/php/Login/LoginHandler.php @@ -3,15 +3,74 @@ declare(strict_types=1); namespace GamesShop\Login; +use Doctrine\ORM\EntityManager; +use Exception; +use GamesShop\ContainerHandler; +use GamesShop\Entities\Account\User; + final class LoginHandler { + /** + * @return class-string[] + */ + private static array $providers; + + public function __construct( + private readonly EntityManager $entityManager + ) + { + } + public function isLoggedIn(): bool { - if (session_status() !== PHP_SESSION_ACTIVE) { - session_start(); - } + $this->ensureSession(); return isset($_SESSION['accountid']); } + /** + * @throws Exception + */ + public function getLoginProvider(string $method): LoginProvider { + $providers = self::getProviders(); + if (!array_key_exists($method, $providers)) { + throw new Exception("Couldn't find method for login '{$method}'"); + } + return ContainerHandler::get($providers[$method]); + } + + public function setCurrentUser(User $user) { + $this->ensureSession(); + + $_SESSION['accountid'] = $user->getId(); + } + + public function getCurrentUser(): User { + $this->ensureSession(); + + $userid = $_SESSION['accountid']; + return $this->entityManager->getRepository(User::class)->find($userid); + } + + public function deleteSession() { + $this->ensureSession(); + session_destroy(); + } + + private function ensureSession() + { + if (session_status() !== PHP_SESSION_ACTIVE) { + session_start(); + } + } + + /** + * @return class-string[] + */ + private static function getProviders(): array + { + return self::$providers ??= [ + 'discord' => DiscordLoginProvider::class + ]; + } } \ No newline at end of file diff --git a/src/php/Login/LoginMethod.php b/src/php/Login/LoginMethod.php new file mode 100644 index 0000000..687cae6 --- /dev/null +++ b/src/php/Login/LoginMethod.php @@ -0,0 +1,16 @@ + 'fa-discord', + }; + } +} diff --git a/src/php/Login/LoginProvider.php b/src/php/Login/LoginProvider.php new file mode 100644 index 0000000..51ecd43 --- /dev/null +++ b/src/php/Login/LoginProvider.php @@ -0,0 +1,12 @@ + "Claimer", + self::PROVIDER => "Provider", + self::ADMIN => "Admin", + }; + } +} diff --git a/src/php/Paths.php b/src/php/Paths.php index 85c8a4c..6a1d42c 100644 --- a/src/php/Paths.php +++ b/src/php/Paths.php @@ -8,4 +8,6 @@ final class Paths public const string ROOT_PATH = __DIR__ . '/../..'; public const string PUBLIC_PATH = self::ROOT_PATH . '/public'; public const string SOURCE_PATH = self::ROOT_PATH . '/src'; + + public const string PHP_SOURCE_PATH = self::SOURCE_PATH . '/php'; } \ No newline at end of file diff --git a/src/php/Routing/LoginRoutes.php b/src/php/Routing/LoginRoutes.php index d86e03b..e3d11bf 100644 --- a/src/php/Routing/LoginRoutes.php +++ b/src/php/Routing/LoginRoutes.php @@ -3,14 +3,25 @@ declare(strict_types=1); namespace GamesShop\Routing; +use Doctrine\ORM\EntityManager; +use Doctrine\ORM\Exception\ORMException; +use Doctrine\ORM\OptimisticLockException; use GamesShop\ContainerHandler; use GamesShop\Environment\EnvironmentHandler; +use GamesShop\Login\LoginHandler; use GamesShop\Templates\TemplateEngine; use Laminas\Diactoros\Response; +use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; final class LoginRoutes { + public function __construct( + private readonly EntityManager $entityManager + ) + { + } + public function login(ServerRequestInterface $request) { $discordEnv = ContainerHandler::get(EnvironmentHandler::class)->getDiscordEnvironment(); $pageContent = ContainerHandler::get(TemplateEngine::class)->renderPage( @@ -25,9 +36,42 @@ final class LoginRoutes return $response; } + /** + * @throws OptimisticLockException + * @throws ORMException + */ + public function loginCallback(ServerRequestInterface $request, array $args): ResponseInterface { + if (array_key_exists('error', $request->getQueryParams())) { + return new Response\RedirectResponse('/login'); + } + + $method = $args['method']; + $loginHandler = ContainerHandler::get(LoginHandler::class); + $loginProvider = $loginHandler->getLoginProvider($method); + + $user = $loginProvider->getUser($request); + if ($user->getId() === null) { + $this->entityManager->persist($user); + $this->entityManager->flush(); + } + + $loginHandler->setCurrentUser($user); + return new Response\RedirectResponse('/'); + } + + public function logout(ServerRequestInterface $request): ResponseInterface + { + $loginHandler = ContainerHandler::get(LoginHandler::class); + $loginHandler->deleteSession(); + + return new Response\RedirectResponse('/login'); + } + public static function addRoutes(\League\Route\Router $router): void { $routes = ContainerHandler::get(LoginRoutes::class); $router->get('/login', $routes->login(...)); + $router->get('/login-callback/{method:word}', $routes->loginCallback(...)); + $router->get('/logout', $routes->logout(...)); } } \ No newline at end of file diff --git a/src/php/Routing/Router.php b/src/php/Routing/Router.php index 0de53da..9f0a98d 100644 --- a/src/php/Routing/Router.php +++ b/src/php/Routing/Router.php @@ -9,13 +9,14 @@ use GamesShop\Templates\TemplateEngine; use Laminas\Diactoros\Response; use Laminas\Diactoros\ServerRequestFactory; use League\Container\Container; +use League\Route\Http\Exception\NotFoundException; use League\Route\Strategy\ApplicationStrategy; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; final class Router { - public function route() + public function route(): ResponseInterface { $request = ServerRequestFactory::fromGlobals( $_SERVER, $_GET, $_POST, $_COOKIE, $_FILES @@ -26,11 +27,12 @@ final class Router IndexRoute::applyRoutes($router); LoginRoutes::addRoutes($router); + SetupRoute::applyRoutes($router); ResourceRoute::addRouteEntry($router); try { return $router->dispatch($request); - } catch (\League\Route\Http\Exception\NotFoundException $e) { + } catch (NotFoundException $e) { return (new ErrorRoute())->renderErrorPage(404); } } diff --git a/src/php/Routing/SetupRoute.php b/src/php/Routing/SetupRoute.php new file mode 100644 index 0000000..b351ddf --- /dev/null +++ b/src/php/Routing/SetupRoute.php @@ -0,0 +1,53 @@ +loginHandler->isLoggedIn()) { + return new RedirectResponse('/login'); + } + + $repo = $this->entityManager->getRepository(SystemAttribute::class); + + $attribute = $repo->find('ADMIN_SETUP_COMPLETED'); + if ($attribute) { + + return new RedirectResponse('/'); + } + + $user = $this->loginHandler->getCurrentUser(); + $user->setPermission(UserPermission::ADMIN); + + $attribute = new SystemAttribute( + 'ADMIN_SETUP_COMPLETED', + 'true' + ); + $this->entityManager->persist($attribute); + $this->entityManager->flush(); + + return new RedirectResponse('/'); + } + + public static function applyRoutes(\League\Route\Router $router) { + $router->get('/setup-admin', self::class); + } + +} \ No newline at end of file diff --git a/src/php/SetupHandler.php b/src/php/SetupHandler.php new file mode 100644 index 0000000..e93e04b --- /dev/null +++ b/src/php/SetupHandler.php @@ -0,0 +1,13 @@ +load(); +ContainerHandler::get(DoctrineManager::class)->setup(); \ No newline at end of file diff --git a/src/php/index.dev.php b/src/php/index.dev.php index 63794ab..cb62482 100644 --- a/src/php/index.dev.php +++ b/src/php/index.dev.php @@ -2,20 +2,23 @@ declare(strict_types=1); use GamesShop\ContainerHandler; +use GamesShop\DoctrineManager; use GamesShop\Environment\EnvironmentHandler; use GamesShop\Routing\Router; use Laminas\HttpHandlerRunner\Emitter\SapiEmitter; +use Whoops\Handler\HandlerInterface; use Whoops\Handler\PrettyPageHandler; use Whoops\Run; -require_once __DIR__ . '/../vendor/autoload.php'; - -ContainerHandler::get(EnvironmentHandler::class)->load(); +require_once __DIR__ . '/../src/php/bootstrap.php'; $whoops = new Run(); -$whoops->pushHandler(new PrettyPageHandler); +$prettyPageHandler = new PrettyPageHandler(); +$whoops->pushHandler($prettyPageHandler); $whoops->register(); +ContainerHandler::getInstance()->addShared(HandlerInterface::class, $prettyPageHandler); + $router = ContainerHandler::getInstance()->get(Router::class); $result = $router->route(); diff --git a/src/templates/layout/accountDisplay.php b/src/templates/layout/accountDisplay.php new file mode 100644 index 0000000..cd42d32 --- /dev/null +++ b/src/templates/layout/accountDisplay.php @@ -0,0 +1,37 @@ + + +isLoggedIn()): + $user = $loginHandler->getCurrentUser(); +?> +