From 25fc19b66c2f062f95d3f793a3fb75d4c678bc89 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 7 May 2018 11:01:23 +0200 Subject: [PATCH] Config --- .env.dist | 4 + composer.json | 1 + composer.lock | 1389 ++++++++++++++++++++++++- config/bundles.php | 4 + config/packages/api_platform.yaml | 184 ++++ config/packages/nelmio_cors.yaml | 9 + config/packages/security.yaml | 24 + config/packages/translation.yaml | 7 + config/packages/twig.yaml | 4 + config/routes/api_platform.yaml | 4 + config/routes/dev/twig.yaml | 3 + config/services.yaml | 1 + src/Repository/ResponseRepository.php | 50 + symfony.lock | 93 ++ templates/base.html.twig | 12 + translations/.gitignore | 0 16 files changed, 1788 insertions(+), 1 deletion(-) create mode 100644 config/packages/api_platform.yaml create mode 100644 config/packages/nelmio_cors.yaml create mode 100644 config/packages/security.yaml create mode 100644 config/packages/translation.yaml create mode 100644 config/packages/twig.yaml create mode 100644 config/routes/api_platform.yaml create mode 100644 config/routes/dev/twig.yaml create mode 100644 src/Repository/ResponseRepository.php create mode 100644 templates/base.html.twig create mode 100644 translations/.gitignore diff --git a/.env.dist b/.env.dist index 038a962..12baab2 100644 --- a/.env.dist +++ b/.env.dist @@ -15,3 +15,7 @@ APP_SECRET=6be4566096577fa91471d270525115fe # Configure your db driver and server_version in config/packages/doctrine.yaml DATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/db_name ###< doctrine/doctrine-bundle ### + +###> nelmio/cors-bundle ### +CORS_ALLOW_ORIGIN=^https?://localhost:?[0-9]*$ +###< nelmio/cors-bundle ### diff --git a/composer.json b/composer.json index b050108..10053aa 100644 --- a/composer.json +++ b/composer.json @@ -4,6 +4,7 @@ "require": { "php": "^7.1.3", "ext-iconv": "*", + "api-platform/api-pack": "^1.1", "symfony/console": "^4.0", "symfony/flex": "^1.0", "symfony/framework-bundle": "^4.0", diff --git a/composer.lock b/composer.lock index 62ee929..8ba734b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,161 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "74c35bf6543d060519ab59b48db35e07", + "content-hash": "6c5efcc52b8bd26da932d44a37546333", "packages": [ + { + "name": "api-platform/api-pack", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/api-platform/api-pack.git", + "reference": "33ade8a1dc23868828788fe1bf3e54291ce54843" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/api-platform/api-pack/zipball/33ade8a1dc23868828788fe1bf3e54291ce54843", + "reference": "33ade8a1dc23868828788fe1bf3e54291ce54843", + "shasum": "" + }, + "require": { + "api-platform/core": "^2.1", + "doctrine/annotations": "^1.0", + "doctrine/doctrine-bundle": "^1.6", + "doctrine/orm": "^2.4.5", + "nelmio/cors-bundle": "^1.5", + "php": "^7.0", + "phpdocumentor/reflection-docblock": "^3.0 || ^4.0", + "symfony/asset": "^3.0 || ^4.0", + "symfony/expression-language": "^3.0 || ^4.0", + "symfony/security-bundle": "^3.0 || ^4.0", + "symfony/twig-bundle": "^3.0 || ^4.0", + "symfony/validator": "^3.0 || ^4.0" + }, + "type": "symfony-pack", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A pack for API Platform", + "time": "2018-02-09T13:21:13+00:00" + }, + { + "name": "api-platform/core", + "version": "v2.2.5", + "source": { + "type": "git", + "url": "https://github.com/api-platform/core.git", + "reference": "d21403eda880a9431da96f45bd77e8a7a7b400c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/api-platform/core/zipball/d21403eda880a9431da96f45bd77e8a7a7b400c4", + "reference": "d21403eda880a9431da96f45bd77e8a7a7b400c4", + "shasum": "" + }, + "require": { + "doctrine/inflector": "^1.0", + "php": ">=7.0", + "psr/cache": "^1.0", + "psr/container": "^1.0", + "symfony/http-foundation": "^3.1 || ^4.0", + "symfony/http-kernel": "^2.7 || ^3.0 || ^4.0", + "symfony/property-access": "^2.7 || ^3.0 || ^4.0", + "symfony/property-info": "^3.3.11 || ^4.0", + "symfony/serializer": "^3.1 || ^4.0", + "willdurand/negotiation": "^2.0.3" + }, + "conflict": { + "symfony/dependency-injection": "<3.3" + }, + "require-dev": { + "behat/behat": "^3.1", + "behat/mink": "^1.7", + "behat/mink-browserkit-driver": "^1.3.1", + "behat/mink-extension": "^2.2", + "behat/symfony2-extension": "^2.1.1", + "behatch/contexts": "^3.0@dev", + "doctrine/annotations": "^1.2", + "doctrine/doctrine-bundle": "^1.6.3", + "doctrine/orm": "^2.5.2", + "friendsofsymfony/user-bundle": "^2.0", + "guzzlehttp/guzzle": "^6.0", + "justinrainbow/json-schema": "^5.0", + "nelmio/api-doc-bundle": "^2.13.3", + "php-mock/php-mock-phpunit": "^2.0", + "phpdocumentor/reflection-docblock": "^3.0 || ^4.0", + "phpdocumentor/type-resolver": "^0.2.1 || ^0.3 || 0.4", + "phpunit/phpunit": "^6.1", + "psr/log": "^1.0", + "sensio/framework-extra-bundle": "^3.0.11 || ^4.0", + "symfony/asset": "^3.3 || ^4.0", + "symfony/cache": "^3.3 || ^4.0", + "symfony/config": "^3.3 || ^4.0", + "symfony/console": "^3.3 || ^4.0", + "symfony/debug": "^2.8 || ^3.0 || ^4.0", + "symfony/dependency-injection": "^3.3 || ^4.0", + "symfony/doctrine-bridge": "^2.8.12 || ^3.0 || ^4.0", + "symfony/event-dispatcher": "^3.3 || ^4.0", + "symfony/expression-language": "^2.8 || ^3.0 || ^4.0", + "symfony/finder": "^3.3 || ^4.0", + "symfony/form": "^3.3 || ^4.0", + "symfony/framework-bundle": "^3.3 || ^4.0", + "symfony/phpunit-bridge": "^3.3 || ^4.0", + "symfony/routing": "^3.3 || ^4.0", + "symfony/security": "^3.0 || ^4.0", + "symfony/security-bundle": "^3.0 || ^4.0", + "symfony/twig-bundle": "^3.1 || ^4.0", + "symfony/validator": "^3.3 || ^4.0", + "symfony/yaml": "^3.3 || ^4.0", + "webonyx/graphql-php": "^0.10.2" + }, + "suggest": { + "friendsofsymfony/user-bundle": "To use the FOSUserBundle bridge.", + "guzzlehttp/guzzle": "To use the HTTP cache invalidation system.", + "phpdocumentor/reflection-docblock": "To support extracting metadata from PHPDoc.", + "psr/cache-implementation": "To use metadata caching.", + "symfony/cache": "To have metadata caching when using Symfony integration.", + "symfony/config": "To load XML configuration files.", + "symfony/expression-language": "To use authorization features.", + "symfony/security": "To use authorization features.", + "symfony/twig-bundle": "To use the Swagger UI integration.", + "webonyx/graphql-php": "To support GraphQL." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "ApiPlatform\\Core\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kévin Dunglas", + "email": "dunglas@gmail.com", + "homepage": "https://dunglas.fr" + } + ], + "description": "The ultimate solution to create web APIs.", + "homepage": "https://api-platform.com", + "keywords": [ + "Hydra", + "JSON-LD", + "api", + "hal", + "json", + "rest", + "swagger" + ], + "time": "2018-04-03T15:42:30+00:00" + }, { "name": "doctrine/annotations", "version": "v1.6.0", @@ -977,6 +1130,64 @@ ], "time": "2014-01-12T16:20:24+00:00" }, + { + "name": "nelmio/cors-bundle", + "version": "1.5.4", + "source": { + "type": "git", + "url": "https://github.com/nelmio/NelmioCorsBundle.git", + "reference": "548dc8ebd3984acd2f6d8787ab1dac2e9aa14254" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nelmio/NelmioCorsBundle/zipball/548dc8ebd3984acd2f6d8787ab1dac2e9aa14254", + "reference": "548dc8ebd3984acd2f6d8787ab1dac2e9aa14254", + "shasum": "" + }, + "require": { + "symfony/framework-bundle": "^2.7 || ^3.0 || ^4.0" + }, + "require-dev": { + "matthiasnoback/symfony-dependency-injection-test": "^1.0 || ^2.0", + "mockery/mockery": "^0.9 || ^1.0", + "symfony/phpunit-bridge": "^2.7 || ^3.0 || ^4.0" + }, + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "1.5.x-dev" + } + }, + "autoload": { + "psr-4": { + "Nelmio\\CorsBundle\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nelmio", + "homepage": "http://nelm.io" + }, + { + "name": "Symfony Community", + "homepage": "https://github.com/nelmio/NelmioCorsBundle/contributors" + } + ], + "description": "Adds CORS (Cross-Origin Resource Sharing) headers support in your Symfony2 application", + "keywords": [ + "api", + "cors", + "crossdomain" + ], + "time": "2017-12-11T18:41:54+00:00" + }, { "name": "nikic/php-parser", "version": "v4.0.1", @@ -1146,6 +1357,158 @@ ], "time": "2017-05-04T11:12:50+00:00" }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "4.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "shasum": "" + }, + "require": { + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-11-30T07:14:17+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2017-07-14T14:27:02+00:00" + }, { "name": "psr/cache", "version": "1.0.1", @@ -1336,6 +1699,62 @@ ], "time": "2017-10-23T01:57:42+00:00" }, + { + "name": "symfony/asset", + "version": "v4.0.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/asset.git", + "reference": "db6063ab6e71c0d4910328a4d10eba197e1d6b40" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/asset/zipball/db6063ab6e71c0d4910328a4d10eba197e1d6b40", + "reference": "db6063ab6e71c0d4910328a4d10eba197e1d6b40", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "require-dev": { + "symfony/http-foundation": "~3.4|~4.0", + "symfony/http-kernel": "~3.4|~4.0" + }, + "suggest": { + "symfony/http-foundation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Asset\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Asset Component", + "homepage": "https://symfony.com", + "time": "2018-01-03T07:38:00+00:00" + }, { "name": "symfony/cache", "version": "v4.0.9", @@ -1804,6 +2223,56 @@ "homepage": "https://symfony.com", "time": "2018-04-06T07:35:43+00:00" }, + { + "name": "symfony/expression-language", + "version": "v4.0.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/expression-language.git", + "reference": "b826c255f22333eccd3365734d2c4e150c284843" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/expression-language/zipball/b826c255f22333eccd3365734d2c4e150c284843", + "reference": "b826c255f22333eccd3365734d2c4e150c284843", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/cache": "~3.4|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\ExpressionLanguage\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony ExpressionLanguage Component", + "homepage": "https://symfony.com", + "time": "2018-01-03T07:38:00+00:00" + }, { "name": "symfony/filesystem", "version": "v4.0.9", @@ -2201,6 +2670,63 @@ "homepage": "https://symfony.com", "time": "2018-04-30T19:45:57+00:00" }, + { + "name": "symfony/inflector", + "version": "v4.0.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/inflector.git", + "reference": "da634a9968162f7c5c94f8d6949a4ede86085304" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/inflector/zipball/da634a9968162f7c5c94f8d6949a4ede86085304", + "reference": "da634a9968162f7c5c94f8d6949a4ede86085304", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Inflector\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Inflector Component", + "homepage": "https://symfony.com", + "keywords": [ + "inflection", + "pluralize", + "singularize", + "string", + "symfony", + "words" + ], + "time": "2018-01-03T17:15:19+00:00" + }, { "name": "symfony/lts", "version": "dev-master", @@ -2446,6 +2972,149 @@ ], "time": "2018-04-26T10:06:28+00:00" }, + { + "name": "symfony/property-access", + "version": "v4.0.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/property-access.git", + "reference": "e0fef10eb7e11cae9421d8d89024dfeae0acffb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/property-access/zipball/e0fef10eb7e11cae9421d8d89024dfeae0acffb7", + "reference": "e0fef10eb7e11cae9421d8d89024dfeae0acffb7", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/inflector": "~3.4|~4.0" + }, + "require-dev": { + "symfony/cache": "~3.4|~4.0" + }, + "suggest": { + "psr/cache-implementation": "To cache access methods." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\PropertyAccess\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony PropertyAccess Component", + "homepage": "https://symfony.com", + "keywords": [ + "access", + "array", + "extraction", + "index", + "injection", + "object", + "property", + "property path", + "reflection" + ], + "time": "2018-01-03T07:38:00+00:00" + }, + { + "name": "symfony/property-info", + "version": "v4.0.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/property-info.git", + "reference": "8a10b0dc3d73037dad86a7df5b0f88f94428b25d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/property-info/zipball/8a10b0dc3d73037dad86a7df5b0f88f94428b25d", + "reference": "8a10b0dc3d73037dad86a7df5b0f88f94428b25d", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/inflector": "~3.4|~4.0" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "<3.0||>=3.2.0,<3.2.2", + "phpdocumentor/type-resolver": "<0.2.1", + "symfony/dependency-injection": "<3.4" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "phpdocumentor/reflection-docblock": "^3.0|^4.0", + "symfony/cache": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/serializer": "~3.4|~4.0" + }, + "suggest": { + "phpdocumentor/reflection-docblock": "To use the PHPDoc", + "psr/cache-implementation": "To cache results", + "symfony/doctrine-bridge": "To use Doctrine metadata", + "symfony/serializer": "To use Serializer metadata" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\PropertyInfo\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kévin Dunglas", + "email": "dunglas@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Property Info Component", + "homepage": "https://symfony.com", + "keywords": [ + "doctrine", + "phpdoc", + "property", + "symfony", + "type", + "validator" + ], + "time": "2018-04-26T16:12:06+00:00" + }, { "name": "symfony/routing", "version": "v4.0.9", @@ -2524,6 +3193,556 @@ ], "time": "2018-04-20T06:20:23+00:00" }, + { + "name": "symfony/security", + "version": "v4.0.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/security.git", + "reference": "3ba77b4b63fa51f048ebbf8291079a13e31eb6a6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/security/zipball/3ba77b4b63fa51f048ebbf8291079a13e31eb6a6", + "reference": "3ba77b4b63fa51f048ebbf8291079a13e31eb6a6", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/http-foundation": "~3.4|~4.0", + "symfony/http-kernel": "~3.4|~4.0", + "symfony/property-access": "~3.4|~4.0" + }, + "replace": { + "symfony/security-core": "self.version", + "symfony/security-csrf": "self.version", + "symfony/security-guard": "self.version", + "symfony/security-http": "self.version" + }, + "require-dev": { + "psr/container": "^1.0", + "psr/log": "~1.0", + "symfony/expression-language": "~3.4|~4.0", + "symfony/finder": "~3.4|~4.0", + "symfony/ldap": "~3.4|~4.0", + "symfony/polyfill-intl-icu": "~1.0", + "symfony/routing": "~3.4|~4.0", + "symfony/validator": "~3.4|~4.0" + }, + "suggest": { + "psr/container-implementation": "To instantiate the Security class", + "symfony/expression-language": "For using the expression voter", + "symfony/form": "", + "symfony/ldap": "For using the LDAP user and authentication providers", + "symfony/routing": "For using the HttpUtils class to create sub-requests, redirect the user, and match URLs", + "symfony/validator": "For using the user password constraint" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Security\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Security Component", + "homepage": "https://symfony.com", + "time": "2018-04-30T01:23:47+00:00" + }, + { + "name": "symfony/security-bundle", + "version": "v4.0.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/security-bundle.git", + "reference": "dfabecc1fd3e626e676edef97753a645b4de85a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/security-bundle/zipball/dfabecc1fd3e626e676edef97753a645b4de85a5", + "reference": "dfabecc1fd3e626e676edef97753a645b4de85a5", + "shasum": "" + }, + "require": { + "ext-xml": "*", + "php": "^7.1.3", + "symfony/dependency-injection": "^3.4.3|^4.0.3", + "symfony/http-kernel": "~3.4|~4.0", + "symfony/security": "~3.4|~4.0" + }, + "conflict": { + "symfony/console": "<3.4", + "symfony/event-dispatcher": "<3.4", + "symfony/framework-bundle": "<3.4", + "symfony/var-dumper": "<3.4" + }, + "require-dev": { + "doctrine/doctrine-bundle": "~1.5", + "symfony/asset": "~3.4|~4.0", + "symfony/browser-kit": "~3.4|~4.0", + "symfony/console": "~3.4|~4.0", + "symfony/css-selector": "~3.4|~4.0", + "symfony/dom-crawler": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", + "symfony/expression-language": "~3.4|~4.0", + "symfony/form": "~3.4|~4.0", + "symfony/framework-bundle": "~3.4|~4.0", + "symfony/http-foundation": "~3.4|~4.0", + "symfony/process": "~3.4|~4.0", + "symfony/translation": "~3.4|~4.0", + "symfony/twig-bridge": "~3.4|~4.0", + "symfony/twig-bundle": "~3.4|~4.0", + "symfony/validator": "~3.4|~4.0", + "symfony/var-dumper": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0", + "twig/twig": "~1.34|~2.4" + }, + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Bundle\\SecurityBundle\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony SecurityBundle", + "homepage": "https://symfony.com", + "time": "2018-04-06T07:35:43+00:00" + }, + { + "name": "symfony/serializer", + "version": "v4.0.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/serializer.git", + "reference": "d0e9269101ccd978af971fd4d7a892848672bfa1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/serializer/zipball/d0e9269101ccd978af971fd4d7a892848672bfa1", + "reference": "d0e9269101ccd978af971fd4d7a892848672bfa1", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "conflict": { + "phpdocumentor/type-resolver": "<0.2.1", + "symfony/dependency-injection": "<3.4", + "symfony/property-access": "<3.4", + "symfony/property-info": "<3.4", + "symfony/yaml": "<3.4" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "doctrine/cache": "~1.0", + "phpdocumentor/reflection-docblock": "^3.0|^4.0", + "symfony/cache": "~3.4|~4.0", + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/http-foundation": "~3.4|~4.0", + "symfony/property-access": "~3.4|~4.0", + "symfony/property-info": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", + "doctrine/cache": "For using the default cached annotation reader and metadata cache.", + "psr/cache-implementation": "For using the metadata cache.", + "symfony/config": "For using the XML mapping loader.", + "symfony/http-foundation": "To use the DataUriNormalizer.", + "symfony/property-access": "For using the ObjectNormalizer.", + "symfony/property-info": "To deserialize relations.", + "symfony/yaml": "For using the default YAML mapping loader." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Serializer\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Serializer Component", + "homepage": "https://symfony.com", + "time": "2018-03-19T17:30:36+00:00" + }, + { + "name": "symfony/translation", + "version": "v4.0.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "ad3abf08eb3450491d8d76513100ef58194cd13e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/ad3abf08eb3450491d8d76513100ef58194cd13e", + "reference": "ad3abf08eb3450491d8d76513100ef58194cd13e", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/config": "<3.4", + "symfony/dependency-injection": "<3.4", + "symfony/yaml": "<3.4" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/finder": "~2.8|~3.0|~4.0", + "symfony/intl": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "psr/log-implementation": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Translation Component", + "homepage": "https://symfony.com", + "time": "2018-04-30T01:23:47+00:00" + }, + { + "name": "symfony/twig-bridge", + "version": "v4.0.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/twig-bridge.git", + "reference": "fc1258b7039d45f3e2230c74c086755832bc9c07" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/fc1258b7039d45f3e2230c74c086755832bc9c07", + "reference": "fc1258b7039d45f3e2230c74c086755832bc9c07", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "twig/twig": "^1.35|^2.4.4" + }, + "conflict": { + "symfony/console": "<3.4", + "symfony/form": "<3.4.9|<4.0.9,>=4.0" + }, + "require-dev": { + "symfony/asset": "~3.4|~4.0", + "symfony/console": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/expression-language": "~3.4|~4.0", + "symfony/finder": "~3.4|~4.0", + "symfony/form": "^3.4.9|^4.0.9", + "symfony/http-foundation": "~3.4|~4.0", + "symfony/http-kernel": "~3.4|~4.0", + "symfony/polyfill-intl-icu": "~1.0", + "symfony/routing": "~3.4|~4.0", + "symfony/security": "~3.4|~4.0", + "symfony/security-acl": "~2.8|~3.0", + "symfony/stopwatch": "~3.4|~4.0", + "symfony/templating": "~3.4|~4.0", + "symfony/translation": "~3.4|~4.0", + "symfony/var-dumper": "~3.4|~4.0", + "symfony/web-link": "~3.4|~4.0", + "symfony/workflow": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "symfony/asset": "For using the AssetExtension", + "symfony/expression-language": "For using the ExpressionExtension", + "symfony/finder": "", + "symfony/form": "For using the FormExtension", + "symfony/http-kernel": "For using the HttpKernelExtension", + "symfony/routing": "For using the RoutingExtension", + "symfony/security": "For using the SecurityExtension", + "symfony/stopwatch": "For using the StopwatchExtension", + "symfony/templating": "For using the TwigEngine", + "symfony/translation": "For using the TranslationExtension", + "symfony/var-dumper": "For using the DumpExtension", + "symfony/web-link": "For using the WebLinkExtension", + "symfony/yaml": "For using the YamlExtension" + }, + "type": "symfony-bridge", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Bridge\\Twig\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Twig Bridge", + "homepage": "https://symfony.com", + "time": "2018-04-30T16:59:37+00:00" + }, + { + "name": "symfony/twig-bundle", + "version": "v4.0.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/twig-bundle.git", + "reference": "f4f2ce9f9386bddff52bfb4110a28d2a4be7ea94" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/twig-bundle/zipball/f4f2ce9f9386bddff52bfb4110a28d2a4be7ea94", + "reference": "f4f2ce9f9386bddff52bfb4110a28d2a4be7ea94", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/config": "~3.4|~4.0", + "symfony/http-foundation": "~3.4|~4.0", + "symfony/http-kernel": "~3.4|~4.0", + "symfony/twig-bridge": "^3.4.3|^4.0.3", + "twig/twig": "~1.34|~2.4" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/event-dispatcher": "<3.4" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "doctrine/cache": "~1.0", + "symfony/asset": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/expression-language": "~3.4|~4.0", + "symfony/finder": "~3.4|~4.0", + "symfony/form": "~3.4|~4.0", + "symfony/framework-bundle": "~3.4|~4.0", + "symfony/routing": "~3.4|~4.0", + "symfony/stopwatch": "~3.4|~4.0", + "symfony/templating": "~3.4|~4.0", + "symfony/web-link": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Bundle\\TwigBundle\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony TwigBundle", + "homepage": "https://symfony.com", + "time": "2018-04-20T06:20:23+00:00" + }, + { + "name": "symfony/validator", + "version": "v4.0.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/validator.git", + "reference": "87c2d527687f158368b3e890933fbb77178f3415" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/validator/zipball/87c2d527687f158368b3e890933fbb77178f3415", + "reference": "87c2d527687f158368b3e890933fbb77178f3415", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/translation": "~3.4|~4.0" + }, + "conflict": { + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", + "symfony/dependency-injection": "<3.4", + "symfony/http-kernel": "<3.4", + "symfony/yaml": "<3.4" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "doctrine/cache": "~1.0", + "egulias/email-validator": "^1.2.8|~2.0", + "symfony/cache": "~3.4|~4.0", + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/expression-language": "~3.4|~4.0", + "symfony/http-foundation": "~3.4|~4.0", + "symfony/http-kernel": "~3.4|~4.0", + "symfony/intl": "~3.4|~4.0", + "symfony/property-access": "~3.4|~4.0", + "symfony/var-dumper": "~3.4|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.", + "doctrine/cache": "For using the default cached annotation reader and metadata cache.", + "egulias/email-validator": "Strict (RFC compliant) email validation", + "psr/cache-implementation": "For using the metadata cache.", + "symfony/config": "", + "symfony/expression-language": "For using the Expression validator", + "symfony/http-foundation": "", + "symfony/intl": "", + "symfony/property-access": "For accessing properties within comparison constraints", + "symfony/yaml": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Validator\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Validator Component", + "homepage": "https://symfony.com", + "time": "2018-04-20T10:04:09+00:00" + }, { "name": "symfony/yaml", "version": "v4.0.9", @@ -2582,6 +3801,174 @@ "homepage": "https://symfony.com", "time": "2018-04-08T08:49:08+00:00" }, + { + "name": "twig/twig", + "version": "v2.4.8", + "source": { + "type": "git", + "url": "https://github.com/twigphp/Twig.git", + "reference": "7b604c89da162034bdf4bb66310f358d313dd16d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/7b604c89da162034bdf4bb66310f358d313dd16d", + "reference": "7b604c89da162034bdf4bb66310f358d313dd16d", + "shasum": "" + }, + "require": { + "php": "^7.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "psr/container": "^1.0", + "symfony/debug": "^2.7", + "symfony/phpunit-bridge": "^3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.4-dev" + } + }, + "autoload": { + "psr-0": { + "Twig_": "lib/" + }, + "psr-4": { + "Twig\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + }, + { + "name": "Twig Team", + "homepage": "http://twig.sensiolabs.org/contributors", + "role": "Contributors" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "http://twig.sensiolabs.org", + "keywords": [ + "templating" + ], + "time": "2018-04-02T09:24:19+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2018-01-29T19:49:41+00:00" + }, + { + "name": "willdurand/negotiation", + "version": "v2.3.1", + "source": { + "type": "git", + "url": "https://github.com/willdurand/Negotiation.git", + "reference": "03436ededa67c6e83b9b12defac15384cb399dc9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/willdurand/Negotiation/zipball/03436ededa67c6e83b9b12defac15384cb399dc9", + "reference": "03436ededa67c6e83b9b12defac15384cb399dc9", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-4": { + "Negotiation\\": "src/Negotiation" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "William Durand", + "email": "will+git@drnd.me" + } + ], + "description": "Content Negotiation tools for PHP provided as a standalone library.", + "homepage": "http://williamdurand.fr/Negotiation/", + "keywords": [ + "accept", + "content", + "format", + "header", + "negotiation" + ], + "time": "2017-05-14T17:21:12+00:00" + }, { "name": "zendframework/zend-code", "version": "3.3.0", diff --git a/config/bundles.php b/config/bundles.php index e20ca90..6c66c7b 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -7,4 +7,8 @@ return [ Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true], Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], + Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], + Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], + Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true], + ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true], ]; diff --git a/config/packages/api_platform.yaml b/config/packages/api_platform.yaml new file mode 100644 index 0000000..b35a904 --- /dev/null +++ b/config/packages/api_platform.yaml @@ -0,0 +1,184 @@ +api_platform: + + # The title of the API. + title: 'Am I late' + + # The description of the API. + description: 'Are you late at HETIC ? Obviously yes.' + + # The version of the API. + version: '0.1.1' + + # Specify a name converter to use. + name_converter: ~ + + # Specify a path name generator to use. + path_segment_name_generator: 'api_platform.path_segment_name_generator.underscore' + + eager_loading: + # To enable or disable eager loading. + enabled: true + + # Fetch only partial data according to serialization groups. + # If enabled, Doctrine ORM entities will not work as expected if any of the other fields are used. + fetch_partial: false + + # Max number of joined relations before EagerLoading throws a RuntimeException. + max_joins: 30 + + # Force join on every relation. + # If disabled, it will only join relations having the EAGER fetch mode. + force_eager: true + + # Enable the FOSUserBundle integration. + enable_fos_user: false + + # Enable the Nelmio Api doc integration. + enable_nelmio_api_doc: false + + # Enable the Swagger documentation and export. + enable_swagger: true + + # Enable Swagger ui. + enable_swagger_ui: true + + # Enable the entrypoint. + enable_entrypoint: true + + # Enable the docs. + enable_docs: true + + oauth: + # To enable or disable oauth. + enabled: false + + # The oauth client id. + clientId: '' + + # The oauth client secret. + clientSecret: '' + + # The oauth type. + type: 'oauth2' + + # The oauth flow grant type. + flow: 'application' + + # The oauth token url. + tokenUrl: '/oauth/v2/token' + + # The oauth authentication url. + authorizationUrl: '/oauth/v2/auth' + + # The oauth scopes. + scopes: [] + + graphql: + enabled: false + graphiql: + enabled: true + + swagger: + # The swagger api keys. + api_keys: [] + + collection: + # The default order of results. + order: 'ASC' + + # The name of the query parameter to order results. + order_parameter_name: 'order' + + pagination: + # To enable or disable pagination for all resource collections by default. + enabled: true + + # To allow the client to enable or disable the pagination. + client_enabled: false + + # To allow the client to set the number of items per page. + client_items_per_page: false + + # The default number of items per page. + items_per_page: 30 + + # The maximum number of items per page. + maximum_items_per_page: 50 + + # The default name of the parameter handling the page number. + page_parameter_name: 'page' + + # The name of the query parameter to enable or disable pagination. + enabled_parameter_name: 'pagination' + + # The name of the query parameter to set the number of items per page. + items_per_page_parameter_name: 'itemsPerPage' + + # To allow partial pagination for all resource collections. + # This improves performances by skipping the `COUNT` query. + partial: true + + # To allow the client to enable or disable the partial pagination. + client_partial: true + + # The name of the query parameter to enable or disable the partial pagination. + partial_parameter_name: 'partial' # Default value + + mapping: + # The list of paths with files or directories where the bundle will look for additional resource files. + paths: [] + + # The list of your resources class directories. Defaults to the directories of the mapping paths but might differ. + resource_class_directories: + - '%kernel.project_dir%/src/Entity' + + http_cache: + # Automatically generate etags for API responses. + etag: true + + # Default value for the response max age. + max_age: 3600 + + # Default value for the response shared (proxy) max age. + shared_max_age: 3600 + + # Default values of the "Vary" HTTP header. + vary: ['Accept'] + + # To make all responses public by default. + public: ~ + + invalidation: + # To enable the tags-based cache invalidation system. + enabled: false + + # URLs of the Varnish servers to purge using cache tags when a resource is updated. + varnish_urls: [] + + # The list of exceptions mapped to their HTTP status code. + exception_to_status: + # With a status code. + Symfony\Component\Serializer\Exception\ExceptionInterface: 400 + + # The list of enabled formats. The first one will be the default. + formats: + jsonld: + mime_types: ['application/ld+json'] + + json: + mime_types: ['application/json'] + + html: + mime_types: ['text/html'] + + # ... + + # The list of enabled error formats. The first one will be the default. + error_formats: + jsonproblem: + mime_types: ['application/problem+json'] + + jsonld: + mime_types: ['application/ld+json'] + + # ... \ No newline at end of file diff --git a/config/packages/nelmio_cors.yaml b/config/packages/nelmio_cors.yaml new file mode 100644 index 0000000..0e04c0b --- /dev/null +++ b/config/packages/nelmio_cors.yaml @@ -0,0 +1,9 @@ +nelmio_cors: + defaults: + origin_regex: true + allow_origin: ['%env(CORS_ALLOW_ORIGIN)%'] + allow_methods: ['GET', 'OPTIONS', 'POST', 'PUT', 'PATCH', 'DELETE'] + allow_headers: ['Content-Type', 'Authorization'] + max_age: 3600 + paths: + '^/': ~ diff --git a/config/packages/security.yaml b/config/packages/security.yaml new file mode 100644 index 0000000..fb4c593 --- /dev/null +++ b/config/packages/security.yaml @@ -0,0 +1,24 @@ +security: + # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers + providers: + in_memory: { memory: ~ } + firewalls: + dev: + pattern: ^/(_(profiler|wdt)|css|images|js)/ + security: false + main: + anonymous: true + + # activate different ways to authenticate + + # http_basic: true + # https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate + + # form_login: true + # https://symfony.com/doc/current/security/form_login_setup.html + + # Easy way to control access for large sections of your site + # Note: Only the *first* access control that matches will be used + access_control: + # - { path: ^/admin, roles: ROLE_ADMIN } + # - { path: ^/profile, roles: ROLE_USER } diff --git a/config/packages/translation.yaml b/config/packages/translation.yaml new file mode 100644 index 0000000..1edfbe2 --- /dev/null +++ b/config/packages/translation.yaml @@ -0,0 +1,7 @@ +framework: + default_locale: '%locale%' + translator: + paths: + - '%kernel.project_dir%/translations' + fallbacks: + - '%locale%' diff --git a/config/packages/twig.yaml b/config/packages/twig.yaml new file mode 100644 index 0000000..3b315dc --- /dev/null +++ b/config/packages/twig.yaml @@ -0,0 +1,4 @@ +twig: + paths: ['%kernel.project_dir%/templates'] + debug: '%kernel.debug%' + strict_variables: '%kernel.debug%' diff --git a/config/routes/api_platform.yaml b/config/routes/api_platform.yaml new file mode 100644 index 0000000..38f11cb --- /dev/null +++ b/config/routes/api_platform.yaml @@ -0,0 +1,4 @@ +api_platform: + resource: . + type: api_platform + prefix: /api diff --git a/config/routes/dev/twig.yaml b/config/routes/dev/twig.yaml new file mode 100644 index 0000000..f4ee839 --- /dev/null +++ b/config/routes/dev/twig.yaml @@ -0,0 +1,3 @@ +_errors: + resource: '@TwigBundle/Resources/config/routing/errors.xml' + prefix: /_error diff --git a/config/services.yaml b/config/services.yaml index 2047088..99d73aa 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -1,6 +1,7 @@ # Put parameters here that don't need to change on each machine where the app is deployed # https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration parameters: + locale: 'en' services: # default configuration for services in *this* file diff --git a/src/Repository/ResponseRepository.php b/src/Repository/ResponseRepository.php new file mode 100644 index 0000000..031ec07 --- /dev/null +++ b/src/Repository/ResponseRepository.php @@ -0,0 +1,50 @@ +createQueryBuilder('r') + ->andWhere('r.exampleField = :val') + ->setParameter('val', $value) + ->orderBy('r.id', 'ASC') + ->setMaxResults(10) + ->getQuery() + ->getResult() + ; + } + */ + + /* + public function findOneBySomeField($value): ?Response + { + return $this->createQueryBuilder('r') + ->andWhere('r.exampleField = :val') + ->setParameter('val', $value) + ->getQuery() + ->getOneOrNullResult() + ; + } + */ +} diff --git a/symfony.lock b/symfony.lock index 3f0ab10..dcd9cd1 100644 --- a/symfony.lock +++ b/symfony.lock @@ -1,4 +1,16 @@ { + "api-platform/api-pack": { + "version": "1.1.0" + }, + "api-platform/core": { + "version": "2.1", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "master", + "version": "2.1", + "ref": "b50f8aa321cc40c380dda7605aa5cef66f476802" + } + }, "doctrine/annotations": { "version": "1.0", "recipe": { @@ -59,6 +71,15 @@ "jdorn/sql-formatter": { "version": "v1.2.17" }, + "nelmio/cors-bundle": { + "version": "1.5", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "master", + "version": "1.5", + "ref": "7b6cbc842f8cd3d550815247d12294f6f304a8c4" + } + }, "nikic/php-parser": { "version": "v4.0.1" }, @@ -68,6 +89,15 @@ "ocramius/proxy-manager": { "version": "2.1.1" }, + "phpdocumentor/reflection-common": { + "version": "1.0.1" + }, + "phpdocumentor/reflection-docblock": { + "version": "4.3.0" + }, + "phpdocumentor/type-resolver": { + "version": "0.4.0" + }, "psr/cache": { "version": "1.0.1" }, @@ -80,6 +110,9 @@ "psr/simple-cache": { "version": "1.0.1" }, + "symfony/asset": { + "version": "v4.0.9" + }, "symfony/cache": { "version": "v4.0.9" }, @@ -110,6 +143,9 @@ "symfony/event-dispatcher": { "version": "v4.0.9" }, + "symfony/expression-language": { + "version": "v4.0.9" + }, "symfony/filesystem": { "version": "v4.0.9" }, @@ -140,6 +176,9 @@ "symfony/http-kernel": { "version": "v4.0.9" }, + "symfony/inflector": { + "version": "v4.0.9" + }, "symfony/lts": { "version": "4-dev" }, @@ -161,6 +200,12 @@ "symfony/process": { "version": "v4.0.9" }, + "symfony/property-access": { + "version": "v4.0.9" + }, + "symfony/property-info": { + "version": "v4.0.9" + }, "symfony/routing": { "version": "4.0", "recipe": { @@ -170,6 +215,45 @@ "ref": "cda8b550123383d25827705d05a42acf6819fe4e" } }, + "symfony/security": { + "version": "v4.0.9" + }, + "symfony/security-bundle": { + "version": "3.3", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "master", + "version": "3.3", + "ref": "f8a63faa0d9521526499c0a8f403c9964ecb0527" + } + }, + "symfony/serializer": { + "version": "v4.0.9" + }, + "symfony/translation": { + "version": "3.3", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "master", + "version": "3.3", + "ref": "6bcd6c570c017ea6ae5a7a6a027c929fd3542cd8" + } + }, + "symfony/twig-bridge": { + "version": "v4.0.9" + }, + "symfony/twig-bundle": { + "version": "3.3", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "master", + "version": "3.3", + "ref": "f75ac166398e107796ca94cc57fa1edaa06ec47f" + } + }, + "symfony/validator": { + "version": "v4.0.9" + }, "symfony/web-server-bundle": { "version": "3.3", "recipe": { @@ -182,6 +266,15 @@ "symfony/yaml": { "version": "v4.0.9" }, + "twig/twig": { + "version": "v2.4.8" + }, + "webmozart/assert": { + "version": "1.3.0" + }, + "willdurand/negotiation": { + "version": "v2.3.1" + }, "zendframework/zend-code": { "version": "3.3.0" }, diff --git a/templates/base.html.twig b/templates/base.html.twig new file mode 100644 index 0000000..043f42d --- /dev/null +++ b/templates/base.html.twig @@ -0,0 +1,12 @@ + + + + + {% block title %}Welcome!{% endblock %} + {% block stylesheets %}{% endblock %} + + + {% block body %}{% endblock %} + {% block javascripts %}{% endblock %} + + diff --git a/translations/.gitignore b/translations/.gitignore new file mode 100644 index 0000000..e69de29