From e7f8551471d0942b4030ff17bce973d57c5791d8 Mon Sep 17 00:00:00 2001 From: abluchet Date: Fri, 13 Apr 2018 14:52:18 +0200 Subject: [PATCH] Add custom operation --- api/.env | 4 +- api/.gitignore | 4 + api/composer.json | 2 + api/composer.lock | 353 ++++++++++++++++++++++------------ api/config/bundles.php | 1 + api/src/Controller/Custom.php | 12 ++ api/src/Entity/Person.php | 23 ++- api/src/Entity/PersonList.php | 6 +- api/symfony.lock | 12 ++ 9 files changed, 289 insertions(+), 128 deletions(-) create mode 100644 api/src/Controller/Custom.php diff --git a/api/.env b/api/.env index 9350d74ce5a..fd90f867607 100644 --- a/api/.env +++ b/api/.env @@ -3,8 +3,8 @@ # https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration ###> symfony/framework-bundle ### -APP_ENV=dev -APP_SECRET=!ChangeMe! +APP_ENV=!ChangeMe! +APP_SECRET=lalala TRUSTED_PROXIES=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 TRUSTED_HOSTS=localhost,api ###< symfony/framework-bundle ### diff --git a/api/.gitignore b/api/.gitignore index 7e6470ba75f..bfb1288e5f3 100644 --- a/api/.gitignore +++ b/api/.gitignore @@ -13,3 +13,7 @@ .php_cs .php_cs.cache ###< friendsofphp/php-cs-fixer ### + +###> symfony/web-server-bundle ### +/.web-server-pid +###< symfony/web-server-bundle ### diff --git a/api/composer.json b/api/composer.json index 07a818ce5f8..0f3c2b2997b 100644 --- a/api/composer.json +++ b/api/composer.json @@ -7,9 +7,11 @@ "api-platform/api-pack": "^1.1", "guzzlehttp/guzzle": "^6.3", "symfony/console": "^4.0", + "symfony/dotenv": "^4.0", "symfony/flex": "^1.0", "symfony/framework-bundle": "^4.0", "symfony/lts": "^4@dev", + "symfony/web-server-bundle": "^4.0", "symfony/yaml": "^4.0" }, "require-dev": { diff --git a/api/composer.lock b/api/composer.lock index 7e288cac7e9..b5183c1854a 100644 --- a/api/composer.lock +++ b/api/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "65dc82b63f66cd763ec6c03b17d144c9", + "content-hash": "2466bd191478579afacf5f85e8787666", "packages": [ { "name": "api-platform/api-pack", @@ -443,16 +443,16 @@ }, { "name": "doctrine/dbal", - "version": "v2.6.3", + "version": "v2.7.1", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "e3eed9b1facbb0ced3a0995244843a189e7d1b13" + "reference": "11037b4352c008373561dc6fc836834eed80c3b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/e3eed9b1facbb0ced3a0995244843a189e7d1b13", - "reference": "e3eed9b1facbb0ced3a0995244843a189e7d1b13", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/11037b4352c008373561dc6fc836834eed80c3b5", + "reference": "11037b4352c008373561dc6fc836834eed80c3b5", "shasum": "" }, "require": { @@ -461,9 +461,11 @@ "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^5.4.6", + "doctrine/coding-standard": "^4.0", + "phpunit/phpunit": "^7.0", "phpunit/phpunit-mock-objects": "!=3.2.4,!=3.2.5", - "symfony/console": "2.*||^3.0" + "symfony/console": "^2.0.5||^3.0", + "symfony/phpunit-bridge": "^3.4.5|^4.0.5" }, "suggest": { "symfony/console": "For helpful console commands such as SQL execution and import of files." @@ -474,7 +476,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6.x-dev" + "dev-master": "2.7.x-dev" } }, "autoload": { @@ -512,7 +514,7 @@ "persistence", "queryobject" ], - "time": "2017-11-19T13:38:54+00:00" + "time": "2018-04-07T18:44:18+00:00" }, { "name": "doctrine/doctrine-bundle", @@ -1627,7 +1629,7 @@ }, { "name": "symfony/asset", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/asset.git", @@ -1683,7 +1685,7 @@ }, { "name": "symfony/cache", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", @@ -1752,7 +1754,7 @@ }, { "name": "symfony/config", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/config.git", @@ -1814,7 +1816,7 @@ }, { "name": "symfony/console", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", @@ -1882,7 +1884,7 @@ }, { "name": "symfony/debug", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", @@ -1938,7 +1940,7 @@ }, { "name": "symfony/dependency-injection", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", @@ -2009,7 +2011,7 @@ }, { "name": "symfony/doctrine-bridge", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/doctrine-bridge.git", @@ -2086,18 +2088,75 @@ "homepage": "https://symfony.com", "time": "2018-03-19T22:35:49+00:00" }, + { + "name": "symfony/dotenv", + "version": "v4.0.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/dotenv.git", + "reference": "afb6923923e22874dac20bd042167ccb8df1d158" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dotenv/zipball/afb6923923e22874dac20bd042167ccb8df1d158", + "reference": "afb6923923e22874dac20bd042167ccb8df1d158", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "require-dev": { + "symfony/process": "~3.4|~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Dotenv\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Registers environment variables from a .env file", + "homepage": "https://symfony.com", + "keywords": [ + "dotenv", + "env", + "environment" + ], + "time": "2018-01-03T17:15:19+00:00" + }, { "name": "symfony/event-dispatcher", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "85eaf6a8ec915487abac52e133efc4a268204428" + "reference": "63353a71073faf08f62caab4e6889b06a787f07b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/85eaf6a8ec915487abac52e133efc4a268204428", - "reference": "85eaf6a8ec915487abac52e133efc4a268204428", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/63353a71073faf08f62caab4e6889b06a787f07b", + "reference": "63353a71073faf08f62caab4e6889b06a787f07b", "shasum": "" }, "require": { @@ -2147,11 +2206,11 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-02-14T14:11:10+00:00" + "time": "2018-04-06T07:35:43+00:00" }, { "name": "symfony/expression-language", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/expression-language.git", @@ -2201,7 +2260,7 @@ }, { "name": "symfony/filesystem", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -2250,16 +2309,16 @@ }, { "name": "symfony/finder", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "c72995d9f5999b3fcdd8660c0c9690243252e1e1" + "reference": "ca27c02b7a3fef4828c998c2ff9ba7aae1641c49" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/c72995d9f5999b3fcdd8660c0c9690243252e1e1", - "reference": "c72995d9f5999b3fcdd8660c0c9690243252e1e1", + "url": "https://api.github.com/repos/symfony/finder/zipball/ca27c02b7a3fef4828c998c2ff9ba7aae1641c49", + "reference": "ca27c02b7a3fef4828c998c2ff9ba7aae1641c49", "shasum": "" }, "require": { @@ -2295,7 +2354,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-04-02T09:52:41+00:00" + "time": "2018-04-04T05:10:37+00:00" }, { "name": "symfony/flex", @@ -2345,16 +2404,16 @@ }, { "name": "symfony/framework-bundle", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/framework-bundle.git", - "reference": "a8e73bb539054efdca59a4ec0d3af99635812505" + "reference": "3571d235434b566aea39d8f8bfe38860344fd9a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/a8e73bb539054efdca59a4ec0d3af99635812505", - "reference": "a8e73bb539054efdca59a4ec0d3af99635812505", + "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/3571d235434b566aea39d8f8bfe38860344fd9a3", + "reference": "3571d235434b566aea39d8f8bfe38860344fd9a3", "shasum": "" }, "require": { @@ -2455,11 +2514,11 @@ ], "description": "Symfony FrameworkBundle", "homepage": "https://symfony.com", - "time": "2018-04-02T09:52:41+00:00" + "time": "2018-04-04T18:24:59+00:00" }, { "name": "symfony/http-foundation", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", @@ -2512,16 +2571,16 @@ }, { "name": "symfony/http-kernel", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "38337d03a554a2b0e9f553d368723692b7c04a8f" + "reference": "6dd620d96d64456075536ffe3c6c4658dd689021" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/38337d03a554a2b0e9f553d368723692b7c04a8f", - "reference": "38337d03a554a2b0e9f553d368723692b7c04a8f", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/6dd620d96d64456075536ffe3c6c4658dd689021", + "reference": "6dd620d96d64456075536ffe3c6c4658dd689021", "shasum": "" }, "require": { @@ -2594,11 +2653,11 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2018-04-03T06:20:33+00:00" + "time": "2018-04-06T16:25:03+00:00" }, { "name": "symfony/inflector", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/inflector.git", @@ -2805,9 +2864,58 @@ ], "time": "2018-01-30T19:27:44+00:00" }, + { + "name": "symfony/process", + "version": "v4.0.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "d7dc1ee5dfe9f732cb1bba7310f5b99f2b7a6d25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/d7dc1ee5dfe9f732cb1bba7310f5b99f2b7a6d25", + "reference": "d7dc1ee5dfe9f732cb1bba7310f5b99f2b7a6d25", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "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 Process Component", + "homepage": "https://symfony.com", + "time": "2018-04-03T05:24:00+00:00" + }, { "name": "symfony/property-access", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/property-access.git", @@ -2874,7 +2982,7 @@ }, { "name": "symfony/property-info", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/property-info.git", @@ -2950,16 +3058,16 @@ }, { "name": "symfony/routing", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "ca780c838046bfef4a6fd50284ae71a5d1f1a8b2" + "reference": "0663036dd57dbfd4e9ff29f75bbd5dd3253ebe71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/ca780c838046bfef4a6fd50284ae71a5d1f1a8b2", - "reference": "ca780c838046bfef4a6fd50284ae71a5d1f1a8b2", + "url": "https://api.github.com/repos/symfony/routing/zipball/0663036dd57dbfd4e9ff29f75bbd5dd3253ebe71", + "reference": "0663036dd57dbfd4e9ff29f75bbd5dd3253ebe71", "shasum": "" }, "require": { @@ -3024,20 +3132,20 @@ "uri", "url" ], - "time": "2018-04-02T09:52:41+00:00" + "time": "2018-04-04T13:50:32+00:00" }, { "name": "symfony/security", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/security.git", - "reference": "3e08200cc978c71d2cfdbc9500db4f2b65bdd28f" + "reference": "6c15e6b36dfa873c9798e41cac5937b61d0eb3fe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security/zipball/3e08200cc978c71d2cfdbc9500db4f2b65bdd28f", - "reference": "3e08200cc978c71d2cfdbc9500db4f2b65bdd28f", + "url": "https://api.github.com/repos/symfony/security/zipball/6c15e6b36dfa873c9798e41cac5937b61d0eb3fe", + "reference": "6c15e6b36dfa873c9798e41cac5937b61d0eb3fe", "shasum": "" }, "require": { @@ -3101,20 +3209,20 @@ ], "description": "Symfony Security Component", "homepage": "https://symfony.com", - "time": "2018-04-02T14:35:51+00:00" + "time": "2018-04-06T07:35:43+00:00" }, { "name": "symfony/security-bundle", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/security-bundle.git", - "reference": "4edcb55716cdbbb26783313f34046ada778c87c5" + "reference": "dfabecc1fd3e626e676edef97753a645b4de85a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-bundle/zipball/4edcb55716cdbbb26783313f34046ada778c87c5", - "reference": "4edcb55716cdbbb26783313f34046ada778c87c5", + "url": "https://api.github.com/repos/symfony/security-bundle/zipball/dfabecc1fd3e626e676edef97753a645b4de85a5", + "reference": "dfabecc1fd3e626e676edef97753a645b4de85a5", "shasum": "" }, "require": { @@ -3181,11 +3289,11 @@ ], "description": "Symfony SecurityBundle", "homepage": "https://symfony.com", - "time": "2018-03-19T22:35:49+00:00" + "time": "2018-04-06T07:35:43+00:00" }, { "name": "symfony/serializer", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", @@ -3263,7 +3371,7 @@ }, { "name": "symfony/translation", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", @@ -3331,7 +3439,7 @@ }, { "name": "symfony/twig-bridge", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/twig-bridge.git", @@ -3421,7 +3529,7 @@ }, { "name": "symfony/twig-bundle", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/twig-bundle.git", @@ -3494,16 +3602,16 @@ }, { "name": "symfony/validator", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "2f080fe8af133d12bdf3eeb55a9d01e1286f8e24" + "reference": "b9546d78133d6af199ac6625d0d587a2d804f967" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/2f080fe8af133d12bdf3eeb55a9d01e1286f8e24", - "reference": "2f080fe8af133d12bdf3eeb55a9d01e1286f8e24", + "url": "https://api.github.com/repos/symfony/validator/zipball/b9546d78133d6af199ac6625d0d587a2d804f967", + "reference": "b9546d78133d6af199ac6625d0d587a2d804f967", "shasum": "" }, "require": { @@ -3574,11 +3682,69 @@ ], "description": "Symfony Validator Component", "homepage": "https://symfony.com", - "time": "2018-04-02T09:52:41+00:00" + "time": "2018-04-06T07:35:43+00:00" + }, + { + "name": "symfony/web-server-bundle", + "version": "v4.0.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/web-server-bundle.git", + "reference": "20ad52df8164d2eae029e6bb24356956c52380be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/web-server-bundle/zipball/20ad52df8164d2eae029e6bb24356956c52380be", + "reference": "20ad52df8164d2eae029e6bb24356956c52380be", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/config": "~3.4|~4.0", + "symfony/console": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/http-kernel": "~3.4|~4.0", + "symfony/process": "^3.4.2|^4.0.2" + }, + "suggest": { + "symfony/expression-language": "For using the filter option of the log server.", + "symfony/monolog-bridge": "For using the log server." + }, + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Bundle\\WebServerBundle\\": "" + }, + "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 WebServerBundle", + "homepage": "https://symfony.com", + "time": "2018-01-03T17:15:19+00:00" }, { "name": "symfony/yaml", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", @@ -4207,7 +4373,7 @@ }, { "name": "symfony/options-resolver", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", @@ -4314,58 +4480,9 @@ ], "time": "2018-01-31T17:43:24+00:00" }, - { - "name": "symfony/process", - "version": "v4.0.7", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "d7dc1ee5dfe9f732cb1bba7310f5b99f2b7a6d25" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/d7dc1ee5dfe9f732cb1bba7310f5b99f2b7a6d25", - "reference": "d7dc1ee5dfe9f732cb1bba7310f5b99f2b7a6d25", - "shasum": "" - }, - "require": { - "php": "^7.1.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "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 Process Component", - "homepage": "https://symfony.com", - "time": "2018-04-03T05:24:00+00:00" - }, { "name": "symfony/stopwatch", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", diff --git a/api/config/bundles.php b/api/config/bundles.php index 34f3d4765e1..1c52d9735a6 100644 --- a/api/config/bundles.php +++ b/api/config/bundles.php @@ -8,4 +8,5 @@ Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true], Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true], + Symfony\Bundle\WebServerBundle\WebServerBundle::class => ['dev' => true], ]; diff --git a/api/src/Controller/Custom.php b/api/src/Controller/Custom.php new file mode 100644 index 00000000000..81214cd14f5 --- /dev/null +++ b/api/src/Controller/Custom.php @@ -0,0 +1,12 @@ +