From d0eb45284720062a611e52f896be250681ec3167 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 19:06:38 +0100 Subject: [PATCH 01/28] feat(dep): update dependencies --- composer.json | 5 +++-- symfony.lock | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index f8a2939..8e3d796 100644 --- a/composer.json +++ b/composer.json @@ -7,14 +7,15 @@ "prefer-stable": true, "require": { "php": ">=8.0.0", - "murph/murph-core": "^1.17" + "murph/murph-core": "dev-feature/tests", + "symfony/flex": "^2.2" }, "require-dev": { "symfony/browser-kit": "^5.4", "symfony/css-selector": "^5.4", "symfony/debug-bundle": "^5.4", "symfony/maker-bundle": "^1.0", - "symfony/phpunit-bridge": "^5.4", + "symfony/phpunit-bridge": "^6.2", "symfony/stopwatch": "^5.4", "symfony/var-dumper": "^5.4", "symfony/web-profiler-bundle": "^5.4" diff --git a/symfony.lock b/symfony.lock index e58a69a..3dc9141 100644 --- a/symfony.lock +++ b/symfony.lock @@ -193,6 +193,20 @@ "phpdocumentor/type-resolver": { "version": "1.4.0" }, + "phpunit/phpunit": { + "version": "9.5", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "9.3", + "ref": "a6249a6c4392e9169b87abf93225f7f9f59025e6" + }, + "files": [ + ".env.test", + "phpunit.xml.dist", + "tests/bootstrap.php" + ] + }, "psr/cache": { "version": "1.0.1" }, From edb8de9800d44e0f0b0087e9455c97ddb150c322 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 19:06:56 +0100 Subject: [PATCH 02/28] feat(test): add database for tests --- .env.test | 1 + 1 file changed, 1 insertion(+) diff --git a/.env.test b/.env.test index 9e7162f..3261772 100644 --- a/.env.test +++ b/.env.test @@ -4,3 +4,4 @@ APP_SECRET='$ecretf0rt3st' SYMFONY_DEPRECATIONS_HELPER=999999 PANTHER_APP_ENV=panther PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots +DATABASE_URL="sqlite:///%kernel.project_dir%/var/data_tests.db" From e232e44dcdf72ff1b018524e386eb408a1864732 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 19:07:35 +0100 Subject: [PATCH 03/28] chore(git): add ignored files phpunit files --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index c2d6405..d71b679 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,8 @@ yarn-error.log /public/media/ /migrations/* !/migrations/.gitkeep + +###> phpunit/phpunit ### +/phpunit.xml +.phpunit.result.cache +###< phpunit/phpunit ### From 7397a1cde8bbb0f1aa34d32995cade778a978dca Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 19:09:12 +0100 Subject: [PATCH 04/28] feat(test): apply new recipe for phpunit --- .gitignore | 1 - bin/phpunit | 20 +++++++++++++------- phpunit.xml.dist | 14 ++++++++------ symfony.lock | 8 ++++---- tests/bootstrap.php | 4 ++++ 5 files changed, 29 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index d71b679..2f54f0e 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,6 @@ ###< symfony/framework-bundle ### ###> symfony/phpunit-bridge ### -.phpunit .phpunit.result.cache /phpunit.xml ###< symfony/phpunit-bridge ### diff --git a/bin/phpunit b/bin/phpunit index 4d1ed05..f26f2c7 100755 --- a/bin/phpunit +++ b/bin/phpunit @@ -1,13 +1,19 @@ #!/usr/bin/env php + - + @@ -21,11 +23,11 @@ - - + + src - - + + diff --git a/symfony.lock b/symfony.lock index 3dc9141..9cd51a3 100644 --- a/symfony.lock +++ b/symfony.lock @@ -487,12 +487,12 @@ "version": "v6.0.2" }, "symfony/phpunit-bridge": { - "version": "5.1", + "version": "6.2", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "5.1", - "ref": "bf16921ef8309a81d9f046e9b6369c46bcbd031f" + "branch": "main", + "version": "5.3", + "ref": "819d3d2ffa4590eba0b8f4f3e5e89415ee4e45c3" }, "files": [ ".env.test", diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 469dcce..3181151 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -9,3 +9,7 @@ if (file_exists(dirname(__DIR__).'/config/bootstrap.php')) { } elseif (method_exists(Dotenv::class, 'bootEnv')) { (new Dotenv())->bootEnv(dirname(__DIR__).'/.env'); } + +if ($_SERVER['APP_DEBUG']) { + umask(0000); +} From 301f22bb4aa9d51e810c2be342f7c552b8bb7522 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 19:13:47 +0100 Subject: [PATCH 05/28] feat(update): apply recipes:update doctrine/doctrine-bundle --- .env | 4 ++-- config/packages/doctrine.yaml | 28 +++++++++++++++++++++++++++- config/packages/prod/doctrine.yaml | 20 -------------------- symfony.lock | 9 ++++----- 4 files changed, 33 insertions(+), 28 deletions(-) delete mode 100644 config/packages/prod/doctrine.yaml diff --git a/.env b/.env index dcac2e3..b66a606 100644 --- a/.env +++ b/.env @@ -27,6 +27,6 @@ MAILER_DSN=smtp://localhost # IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml # DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db" -# DATABASE_URL="mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7" -# DATABASE_URL="postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=13&charset=utf8" +# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8&charset=utf8mb4" +# DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=14&charset=utf8" ###< doctrine/doctrine-bundle ### diff --git a/config/packages/doctrine.yaml b/config/packages/doctrine.yaml index 98560ee..b07e18f 100644 --- a/config/packages/doctrine.yaml +++ b/config/packages/doctrine.yaml @@ -4,7 +4,7 @@ doctrine: # IMPORTANT: You MUST configure your server version, # either here or in the DATABASE_URL env var (see .env file) - #server_version: '13' + #server_version: '14' orm: auto_generate_proxy_classes: true naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware @@ -28,3 +28,29 @@ doctrine: dir: "%kernel.project_dir%/vendor/gedmo/doctrine-extensions/src/Tree/Entity" alias: GedmoTree # (optional) it will default to the name set for the mapping is_bundle: false + +when@test: + doctrine: + dbal: + # "TEST_TOKEN" is typically set by ParaTest + dbname_suffix: '_test%env(default::TEST_TOKEN)%' + +when@prod: + doctrine: + orm: + auto_generate_proxy_classes: false + proxy_dir: '%kernel.build_dir%/doctrine/orm/Proxies' + query_cache_driver: + type: pool + pool: doctrine.system_cache_pool + result_cache_driver: + type: pool + pool: doctrine.result_cache_pool + + framework: + cache: + pools: + doctrine.result_cache_pool: + adapter: cache.app + doctrine.system_cache_pool: + adapter: cache.system diff --git a/config/packages/prod/doctrine.yaml b/config/packages/prod/doctrine.yaml deleted file mode 100644 index 084f59a..0000000 --- a/config/packages/prod/doctrine.yaml +++ /dev/null @@ -1,20 +0,0 @@ -doctrine: - orm: - auto_generate_proxy_classes: false - metadata_cache_driver: - type: pool - pool: doctrine.system_cache_pool - query_cache_driver: - type: pool - pool: doctrine.system_cache_pool - result_cache_driver: - type: pool - pool: doctrine.result_cache_pool - -framework: - cache: - pools: - doctrine.result_cache_pool: - adapter: cache.app - doctrine.system_cache_pool: - adapter: cache.system diff --git a/symfony.lock b/symfony.lock index 9cd51a3..36afd62 100644 --- a/symfony.lock +++ b/symfony.lock @@ -51,16 +51,15 @@ "version": "v0.5.3" }, "doctrine/doctrine-bundle": { - "version": "2.0", + "version": "2.8", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "2.0", - "ref": "40631978d2c4adc9b11220b13eba539b727c36a8" + "branch": "main", + "version": "2.4", + "ref": "5b7882dd9d05ef9b7e71fceed66af1ea573a70d4" }, "files": [ "config/packages/doctrine.yaml", - "config/packages/prod/doctrine.yaml", "src/Entity/.gitignore", "src/Repository/.gitignore" ] From 1366e92ca0f65db25942fadb9fd80dc0313ad009 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 19:14:36 +0100 Subject: [PATCH 06/28] feat(update): apply recipes:update doctrine/doctrine-migrations-bundle --- config/packages/doctrine_migrations.yaml | 1 + symfony.lock | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/config/packages/doctrine_migrations.yaml b/config/packages/doctrine_migrations.yaml index 61e6612..29231d9 100644 --- a/config/packages/doctrine_migrations.yaml +++ b/config/packages/doctrine_migrations.yaml @@ -3,3 +3,4 @@ doctrine_migrations: # namespace is arbitrary but should be different from App\Migrations # as migrations classes should NOT be autoloaded 'DoctrineMigrations': '%kernel.project_dir%/migrations' + enable_profiler: false diff --git a/symfony.lock b/symfony.lock index 36afd62..aed4868 100644 --- a/symfony.lock +++ b/symfony.lock @@ -65,12 +65,12 @@ ] }, "doctrine/doctrine-migrations-bundle": { - "version": "2.2", + "version": "3.2", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "2.2", - "ref": "baaa439e3e3179e69e3da84b671f0a3e4a2f56ad" + "branch": "main", + "version": "3.1", + "ref": "1d01ec03c6ecbd67c3375c5478c9a423ae5d6a33" }, "files": [ "config/packages/doctrine_migrations.yaml", From c7e3867a938e1654627713d9ec502e81691c1d72 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 19:15:02 +0100 Subject: [PATCH 07/28] feat(update): apply recipes:update liip/imagine-bundle --- config/packages/liip_imagine.yaml | 2 +- symfony.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/packages/liip_imagine.yaml b/config/packages/liip_imagine.yaml index f201244..fd746e6 100644 --- a/config/packages/liip_imagine.yaml +++ b/config/packages/liip_imagine.yaml @@ -1,4 +1,4 @@ -# See dos how to configure the bundle: https://symfony.com/doc/current/bundles/LiipImagineBundle/basic-usage.html +# Documentation on how to configure the bundle can be found at: https://symfony.com/doc/current/bundles/LiipImagineBundle/basic-usage.html liip_imagine: # valid drivers options include "gd" or "gmagick" or "imagick" driver: "imagick" diff --git a/symfony.lock b/symfony.lock index aed4868..5c324cc 100644 --- a/symfony.lock +++ b/symfony.lock @@ -147,12 +147,12 @@ "version": "4.0.0" }, "liip/imagine-bundle": { - "version": "1.8", + "version": "2.10", "recipe": { "repo": "github.com/symfony/recipes-contrib", - "branch": "master", + "branch": "main", "version": "1.8", - "ref": "5a5bdc2d0e2533ed6935d5ae562f2b318a8fc1ee" + "ref": "d1227d002b70d1a1f941d91845fcd7ac7fbfc929" }, "files": [ "config/packages/liip_imagine.yaml", From f7e374cebce8554c7d88ef7376b6bf043e053b09 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 19:15:53 +0100 Subject: [PATCH 08/28] feat(update): apply recipes:update stof/doctrine-extensions-bundle --- config/packages/stof_doctrine_extensions.yaml | 2 +- symfony.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/packages/stof_doctrine_extensions.yaml b/config/packages/stof_doctrine_extensions.yaml index c83f3b1..b258add 100644 --- a/config/packages/stof_doctrine_extensions.yaml +++ b/config/packages/stof_doctrine_extensions.yaml @@ -1,4 +1,4 @@ # Read the documentation: https://symfony.com/doc/current/bundles/StofDoctrineExtensionsBundle/index.html -# See the official DoctrineExtensions documentation for more details: https://github.com/Atlantic18/DoctrineExtensions/tree/master/doc/ +# See the official DoctrineExtensions documentation for more details: https://github.com/doctrine-extensions/DoctrineExtensions/tree/main/doc stof_doctrine_extensions: default_locale: en_US diff --git a/symfony.lock b/symfony.lock index 5c324cc..e02ae31 100644 --- a/symfony.lock +++ b/symfony.lock @@ -277,12 +277,12 @@ "version": "v10.0.1" }, "stof/doctrine-extensions-bundle": { - "version": "1.2", + "version": "1.7", "recipe": { "repo": "github.com/symfony/recipes-contrib", - "branch": "master", + "branch": "main", "version": "1.2", - "ref": "6c1ceb662f8997085f739cd089bfbef67f245983" + "ref": "e805aba9eff5372e2d149a9ff56566769e22819d" }, "files": [ "config/packages/stof_doctrine_extensions.yaml" From 41abaa20d8150db71734431ea75d1c2a7afb5282 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 19:16:12 +0100 Subject: [PATCH 09/28] feat(update): apply recipes:update symfony/apache-pack --- public/.htaccess | 4 ++++ symfony.lock | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/public/.htaccess b/public/.htaccess index 2776637..3853fa9 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -18,6 +18,10 @@ DirectoryIndex index.php + # This Option needs to be enabled for RewriteRule, otherwise it will show an error like + # 'Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden' + Options +FollowSymlinks + RewriteEngine On # Determine the RewriteBase automatically and set it as environment variable. diff --git a/symfony.lock b/symfony.lock index e02ae31..eeecd0a 100644 --- a/symfony.lock +++ b/symfony.lock @@ -292,9 +292,9 @@ "version": "1.0", "recipe": { "repo": "github.com/symfony/recipes-contrib", - "branch": "master", + "branch": "main", "version": "1.0", - "ref": "71599f5b0fdeeeec0fb90e9b17c85e6f5e1350c1" + "ref": "efb318193e48384eb5c5aadff15396ed698f8ffc" }, "files": [ "public/.htaccess" From a2ce7ed609182358d654134ade12aa3d1a81d1e5 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 19:16:48 +0100 Subject: [PATCH 10/28] feat(update): apply recipes:update symfony/console --- bin/console | 40 +++++++--------------------------------- symfony.lock | 8 ++++---- 2 files changed, 11 insertions(+), 37 deletions(-) diff --git a/bin/console b/bin/console index 8fe9d49..c933dc5 100755 --- a/bin/console +++ b/bin/console @@ -3,41 +3,15 @@ use App\Kernel; use Symfony\Bundle\FrameworkBundle\Console\Application; -use Symfony\Component\Console\Input\ArgvInput; -use Symfony\Component\Dotenv\Dotenv; -use Symfony\Component\ErrorHandler\Debug; -if (!in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) { - echo 'Warning: The console should be invoked via the CLI version of PHP, not the '.PHP_SAPI.' SAPI'.PHP_EOL; +if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) { + throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".'); } -set_time_limit(0); +require_once dirname(__DIR__).'/vendor/autoload_runtime.php'; -require dirname(__DIR__).'/vendor/autoload.php'; +return function (array $context) { + $kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']); -if (!class_exists(Application::class) || !class_exists(Dotenv::class)) { - throw new LogicException('You need to add "symfony/framework-bundle" and "symfony/dotenv" as Composer dependencies.'); -} - -$input = new ArgvInput(); -if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) { - putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env); -} - -if ($input->hasParameterOption('--no-debug', true)) { - putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0'); -} - -(new Dotenv())->bootEnv(dirname(__DIR__).'/.env'); - -if ($_SERVER['APP_DEBUG']) { - umask(0000); - - if (class_exists(Debug::class)) { - Debug::enable(); - } -} - -$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']); -$application = new Application($kernel); -$application->run($input); + return new Application($kernel); +}; diff --git a/symfony.lock b/symfony.lock index eeecd0a..c99467d 100644 --- a/symfony.lock +++ b/symfony.lock @@ -316,12 +316,12 @@ "version": "v5.2.4" }, "symfony/console": { - "version": "5.1", + "version": "5.4", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "5.1", - "ref": "c6d02bdfba9da13c22157520e32a602dbee8a75c" + "branch": "main", + "version": "5.3", + "ref": "da0c8be8157600ad34f10ff0c9cc91232522e047" }, "files": [ "bin/console" From 72299ba2a5958f18ee81bceb25ed0eb2ba4d21ea Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 19:16:59 +0100 Subject: [PATCH 11/28] feat(update): apply recipes:update symfony/debug-bundle --- config/bundles.php | 2 +- config/packages/debug.yaml | 5 +++++ config/packages/dev/debug.yaml | 4 ---- symfony.lock | 10 +++++----- 4 files changed, 11 insertions(+), 10 deletions(-) create mode 100644 config/packages/debug.yaml delete mode 100644 config/packages/dev/debug.yaml diff --git a/config/bundles.php b/config/bundles.php index 15f9428..26a94c3 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -6,7 +6,7 @@ return [ Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], - Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true], + Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true], Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true], diff --git a/config/packages/debug.yaml b/config/packages/debug.yaml new file mode 100644 index 0000000..ad874af --- /dev/null +++ b/config/packages/debug.yaml @@ -0,0 +1,5 @@ +when@dev: + debug: + # Forwards VarDumper Data clones to a centralized server allowing to inspect dumps on CLI or in your browser. + # See the "server:dump" command to start a new server. + dump_destination: "tcp://%env(VAR_DUMPER_SERVER)%" diff --git a/config/packages/dev/debug.yaml b/config/packages/dev/debug.yaml deleted file mode 100644 index 26d4e53..0000000 --- a/config/packages/dev/debug.yaml +++ /dev/null @@ -1,4 +0,0 @@ -debug: - # Forwards VarDumper Data clones to a centralized server allowing to inspect dumps on CLI or in your browser. - # See the "server:dump" command to start a new server. - dump_destination: "tcp://%env(VAR_DUMPER_SERVER)%" diff --git a/symfony.lock b/symfony.lock index c99467d..cad3834 100644 --- a/symfony.lock +++ b/symfony.lock @@ -331,15 +331,15 @@ "version": "v5.2.4" }, "symfony/debug-bundle": { - "version": "4.1", + "version": "5.4", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "4.1", - "ref": "f8863cbad2f2e58c4b65fa1eac892ab189971bea" + "branch": "main", + "version": "5.3", + "ref": "5aa8aa48234c8eb6dbdd7b3cd5d791485d2cec4b" }, "files": [ - "config/packages/dev/debug.yaml" + "config/packages/debug.yaml" ] }, "symfony/dependency-injection": { From a9c64637ec47be75b7ddb481981d51199b714b00 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 19:17:22 +0100 Subject: [PATCH 12/28] feat(update): apply recipes:update symfony/flex --- .env | 1 + symfony.lock | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.env b/.env index b66a606..e22bcb9 100644 --- a/.env +++ b/.env @@ -9,6 +9,7 @@ # Real environment variables win over .env files. # # DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES. +# https://symfony.com/doc/current/configuration/secrets.html # # Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2). # https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration diff --git a/symfony.lock b/symfony.lock index cad3834..56ceaba 100644 --- a/symfony.lock +++ b/symfony.lock @@ -376,12 +376,12 @@ "version": "v5.2.4" }, "symfony/flex": { - "version": "1.0", + "version": "2.2", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", + "branch": "main", "version": "1.0", - "ref": "c0eeb50665f0f77226616b6038a9b06c03752d8e" + "ref": "146251ae39e06a95be0fe3d13c807bcf3938b172" }, "files": [ ".env" From 1abc6a7b60081f50764dfdb67fa48f4581a2b16d Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 19:18:18 +0100 Subject: [PATCH 13/28] feat(update): apply recipes:update symfony/mailer --- .env | 2 +- symfony.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.env b/.env index e22bcb9..c723847 100644 --- a/.env +++ b/.env @@ -20,7 +20,7 @@ APP_SECRET= ###< symfony/framework-bundle ### ###> symfony/mailer ### -MAILER_DSN=smtp://localhost +# MAILER_DSN=smtp://localhost ###< symfony/mailer ### ###> doctrine/doctrine-bundle ### diff --git a/symfony.lock b/symfony.lock index 56ceaba..f9701a6 100644 --- a/symfony.lock +++ b/symfony.lock @@ -426,12 +426,12 @@ "version": "v5.2.4" }, "symfony/mailer": { - "version": "4.3", + "version": "5.4", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", + "branch": "main", "version": "4.3", - "ref": "15658c2a0176cda2e7dba66276a2030b52bd81b2" + "ref": "2bf89438209656b85b9a49238c4467bff1b1f939" }, "files": [ "config/packages/mailer.yaml" From 6a56bc2c3612a6ae870c82f22679637f24b32ada Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 19:20:22 +0100 Subject: [PATCH 14/28] feat(update): apply recipes:update symfony/framework-bundle --- config/packages/framework.yaml | 9 ++++++++- config/packages/test/framework.yaml | 4 ---- config/routes/dev/framework.yaml | 3 --- config/routes/framework.yaml | 4 ++++ config/services.yaml | 2 +- public/index.php | 21 ++++----------------- src/Kernel.php | 27 --------------------------- symfony.lock | 11 +++++------ 8 files changed, 22 insertions(+), 59 deletions(-) delete mode 100644 config/packages/test/framework.yaml delete mode 100644 config/routes/dev/framework.yaml create mode 100644 config/routes/framework.yaml diff --git a/config/packages/framework.yaml b/config/packages/framework.yaml index cad7f78..7853e9e 100644 --- a/config/packages/framework.yaml +++ b/config/packages/framework.yaml @@ -2,7 +2,7 @@ framework: secret: '%env(APP_SECRET)%' #csrf_protection: true - #http_method_override: true + http_method_override: false # Enables session support. Note that the session will ONLY be started if you read or write from it. # Remove or comment this section to explicitly disable session support. @@ -10,8 +10,15 @@ framework: handler_id: null cookie_secure: auto cookie_samesite: lax + storage_factory_id: session.storage.factory.native #esi: true #fragments: true php_errors: log: true + +when@test: + framework: + test: true + session: + storage_factory_id: session.storage.factory.mock_file diff --git a/config/packages/test/framework.yaml b/config/packages/test/framework.yaml deleted file mode 100644 index d051c84..0000000 --- a/config/packages/test/framework.yaml +++ /dev/null @@ -1,4 +0,0 @@ -framework: - test: true - session: - storage_id: session.storage.mock_file diff --git a/config/routes/dev/framework.yaml b/config/routes/dev/framework.yaml deleted file mode 100644 index bcbbf13..0000000 --- a/config/routes/dev/framework.yaml +++ /dev/null @@ -1,3 +0,0 @@ -_errors: - resource: '@FrameworkBundle/Resources/config/routing/errors.xml' - prefix: /_error diff --git a/config/routes/framework.yaml b/config/routes/framework.yaml new file mode 100644 index 0000000..0fc74bb --- /dev/null +++ b/config/routes/framework.yaml @@ -0,0 +1,4 @@ +when@dev: + _errors: + resource: '@FrameworkBundle/Resources/config/routing/errors.xml' + prefix: /_error diff --git a/config/services.yaml b/config/services.yaml index 8087d8f..baf698d 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -2,7 +2,7 @@ # Files in the packages/ subdirectory configure your dependencies. # 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 +# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration parameters: services: diff --git a/public/index.php b/public/index.php index 3bcee0b..9982c21 100644 --- a/public/index.php +++ b/public/index.php @@ -1,22 +1,9 @@ bootEnv(dirname(__DIR__).'/.env'); - -if ($_SERVER['APP_DEBUG']) { - umask(0000); - - Debug::enable(); -} - -$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']); -$request = Request::createFromGlobals(); -$response = $kernel->handle($request); -$response->send(); -$kernel->terminate($request, $response); +return function (array $context) { + return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']); +}; diff --git a/src/Kernel.php b/src/Kernel.php index 655e796..779cd1f 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -3,36 +3,9 @@ namespace App; use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; -use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; use Symfony\Component\HttpKernel\Kernel as BaseKernel; -use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator; class Kernel extends BaseKernel { use MicroKernelTrait; - - protected function configureContainer(ContainerConfigurator $container): void - { - $container->import('../config/{packages}/*.yaml'); - $container->import('../config/{packages}/'.$this->environment.'/*.yaml'); - - if (is_file(\dirname(__DIR__).'/config/services.yaml')) { - $container->import('../config/services.yaml'); - $container->import('../config/{services}_'.$this->environment.'.yaml'); - } elseif (is_file($path = \dirname(__DIR__).'/config/services.php')) { - (require $path)($container->withPath($path), $this); - } - } - - protected function configureRoutes(RoutingConfigurator $routes): void - { - $routes->import('../config/{routes}/'.$this->environment.'/*.yaml'); - $routes->import('../config/{routes}/*.yaml'); - - if (is_file(\dirname(__DIR__).'/config/routes.yaml')) { - $routes->import('../config/routes.yaml'); - } elseif (is_file($path = \dirname(__DIR__).'/config/routes.php')) { - (require $path)($routes->withPath($path), $this); - } - } } diff --git a/symfony.lock b/symfony.lock index f9701a6..638f596 100644 --- a/symfony.lock +++ b/symfony.lock @@ -391,19 +391,18 @@ "version": "v5.2.5" }, "symfony/framework-bundle": { - "version": "5.2", + "version": "5.4", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "5.2", - "ref": "6ec87563dcc85cd0c48856dcfbfc29610506d250" + "branch": "main", + "version": "5.4", + "ref": "3cd216a4d007b78d8554d44a5b1c0a446dab24fb" }, "files": [ "config/packages/cache.yaml", "config/packages/framework.yaml", - "config/packages/test/framework.yaml", "config/preload.php", - "config/routes/dev/framework.yaml", + "config/routes/framework.yaml", "config/services.yaml", "public/index.php", "src/Controller/.gitignore", From b8dd7aa3bf2d8327e33ed0ba8bd9eddefd9b8ebf Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 19:20:56 +0100 Subject: [PATCH 15/28] feat(update): apply recipes:update symfony/monolog-bundle --- config/packages/dev/monolog.yaml | 19 -------- config/packages/monolog.yaml | 61 ++++++++++++++++++++++++++ config/packages/prod/deprecations.yaml | 8 ---- config/packages/prod/monolog.yaml | 16 ------- config/packages/test/monolog.yaml | 12 ----- symfony.lock | 13 +++--- 6 files changed, 66 insertions(+), 63 deletions(-) delete mode 100644 config/packages/dev/monolog.yaml create mode 100644 config/packages/monolog.yaml delete mode 100644 config/packages/prod/deprecations.yaml delete mode 100644 config/packages/prod/monolog.yaml delete mode 100644 config/packages/test/monolog.yaml diff --git a/config/packages/dev/monolog.yaml b/config/packages/dev/monolog.yaml deleted file mode 100644 index b1998da..0000000 --- a/config/packages/dev/monolog.yaml +++ /dev/null @@ -1,19 +0,0 @@ -monolog: - handlers: - main: - type: stream - path: "%kernel.logs_dir%/%kernel.environment%.log" - level: debug - channels: ["!event"] - # uncomment to get logging in your browser - # you may have to allow bigger header sizes in your Web server configuration - #firephp: - # type: firephp - # level: info - #chromephp: - # type: chromephp - # level: info - console: - type: console - process_psr_3_messages: false - channels: ["!event", "!doctrine", "!console"] diff --git a/config/packages/monolog.yaml b/config/packages/monolog.yaml new file mode 100644 index 0000000..8c9efa9 --- /dev/null +++ b/config/packages/monolog.yaml @@ -0,0 +1,61 @@ +monolog: + channels: + - deprecation # Deprecations are logged in the dedicated "deprecation" channel when it exists + +when@dev: + monolog: + handlers: + main: + type: stream + path: "%kernel.logs_dir%/%kernel.environment%.log" + level: debug + channels: ["!event"] + # uncomment to get logging in your browser + # you may have to allow bigger header sizes in your Web server configuration + #firephp: + # type: firephp + # level: info + #chromephp: + # type: chromephp + # level: info + console: + type: console + process_psr_3_messages: false + channels: ["!event", "!doctrine", "!console"] + +when@test: + monolog: + handlers: + main: + type: fingers_crossed + action_level: error + handler: nested + excluded_http_codes: [404, 405] + channels: ["!event"] + nested: + type: stream + path: "%kernel.logs_dir%/%kernel.environment%.log" + level: debug + +when@prod: + monolog: + handlers: + main: + type: fingers_crossed + action_level: error + handler: nested + excluded_http_codes: [404, 405] + buffer_size: 50 # How many messages should be saved? Prevent memory leaks + nested: + type: stream + path: php://stderr + level: debug + formatter: monolog.formatter.json + console: + type: console + process_psr_3_messages: false + channels: ["!event", "!doctrine"] + deprecation: + type: stream + channels: [deprecation] + path: php://stderr diff --git a/config/packages/prod/deprecations.yaml b/config/packages/prod/deprecations.yaml deleted file mode 100644 index 920a061..0000000 --- a/config/packages/prod/deprecations.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# As of Symfony 5.1, deprecations are logged in the dedicated "deprecation" channel when it exists -#monolog: -# channels: [deprecation] -# handlers: -# deprecation: -# type: stream -# channels: [deprecation] -# path: "%kernel.logs_dir%/%kernel.environment%.deprecations.log" diff --git a/config/packages/prod/monolog.yaml b/config/packages/prod/monolog.yaml deleted file mode 100644 index bfe69c0..0000000 --- a/config/packages/prod/monolog.yaml +++ /dev/null @@ -1,16 +0,0 @@ -monolog: - handlers: - main: - type: fingers_crossed - action_level: error - handler: nested - excluded_http_codes: [404, 405] - buffer_size: 50 # How many messages should be saved? Prevent memory leaks - nested: - type: stream - path: "%kernel.logs_dir%/%kernel.environment%.log" - level: debug - console: - type: console - process_psr_3_messages: false - channels: ["!event", "!doctrine"] diff --git a/config/packages/test/monolog.yaml b/config/packages/test/monolog.yaml deleted file mode 100644 index fc40641..0000000 --- a/config/packages/test/monolog.yaml +++ /dev/null @@ -1,12 +0,0 @@ -monolog: - handlers: - main: - type: fingers_crossed - action_level: error - handler: nested - excluded_http_codes: [404, 405] - channels: ["!event"] - nested: - type: stream - path: "%kernel.logs_dir%/%kernel.environment%.log" - level: debug diff --git a/symfony.lock b/symfony.lock index 638f596..10ca86b 100644 --- a/symfony.lock +++ b/symfony.lock @@ -452,18 +452,15 @@ "version": "v5.2.5" }, "symfony/monolog-bundle": { - "version": "3.3", + "version": "3.8", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "3.3", - "ref": "d7249f7d560f6736115eee1851d02a65826f0a56" + "branch": "main", + "version": "3.7", + "ref": "213676c4ec929f046dfde5ea8e97625b81bc0578" }, "files": [ - "config/packages/dev/monolog.yaml", - "config/packages/prod/deprecations.yaml", - "config/packages/prod/monolog.yaml", - "config/packages/test/monolog.yaml" + "config/packages/monolog.yaml" ] }, "symfony/notifier": { From b9b6d968aa30d0444dd38ec61cb71537d4ca0348 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 19:21:15 +0100 Subject: [PATCH 16/28] feat(update): apply recipes:update symfony/routing --- config/packages/prod/routing.yaml | 3 --- config/packages/routing.yaml | 5 +++++ symfony.lock | 9 ++++----- 3 files changed, 9 insertions(+), 8 deletions(-) delete mode 100644 config/packages/prod/routing.yaml diff --git a/config/packages/prod/routing.yaml b/config/packages/prod/routing.yaml deleted file mode 100644 index b3e6a0a..0000000 --- a/config/packages/prod/routing.yaml +++ /dev/null @@ -1,3 +0,0 @@ -framework: - router: - strict_requirements: null diff --git a/config/packages/routing.yaml b/config/packages/routing.yaml index b45c1ce..4b766ce 100644 --- a/config/packages/routing.yaml +++ b/config/packages/routing.yaml @@ -5,3 +5,8 @@ framework: # Configure how to generate URLs in non-HTTP contexts, such as CLI commands. # See https://symfony.com/doc/current/routing.html#generating-urls-in-commands #default_uri: http://localhost + +when@prod: + framework: + router: + strict_requirements: null diff --git a/symfony.lock b/symfony.lock index 10ca86b..4aaa175 100644 --- a/symfony.lock +++ b/symfony.lock @@ -533,15 +533,14 @@ "version": "v5.2.4" }, "symfony/routing": { - "version": "5.1", + "version": "5.4", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "5.1", - "ref": "b4f3e7c95e38b606eef467e8a42a8408fc460c43" + "branch": "main", + "version": "5.3", + "ref": "85de1d8ae45b284c3c84b668171d2615049e698f" }, "files": [ - "config/packages/prod/routing.yaml", "config/packages/routing.yaml", "config/routes.yaml" ] From b22db21ea40127b8a9d39f88647c93eff4542c1a Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 19:22:59 +0100 Subject: [PATCH 17/28] feat(update): apply recipes:update symfony/security-bundle --- config/packages/security.yaml | 18 ++++++++++++++++++ symfony.lock | 8 ++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/config/packages/security.yaml b/config/packages/security.yaml index 9665acd..7b07d7a 100644 --- a/config/packages/security.yaml +++ b/config/packages/security.yaml @@ -4,6 +4,11 @@ security: algorithm: auto # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers + enable_authenticator_manager: true + # https://symfony.com/doc/current/security.html#registering-the-user-hashing-passwords + password_hashers: + Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto' + # https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider providers: # used to reload user from session & other features (e.g. switch_user) app_user_provider: @@ -52,3 +57,16 @@ security: - { path: ^/admin/file_manager, roles: ROLE_WRITER } - { path: ^/admin, roles: ROLE_USER } - { path: ^/_internal, roles: IS_AUTHENTICATED_ANONYMOUSLY } + +when@test: + security: + password_hashers: + # By default, password hashers are resource intensive and take time. This is + # important to generate secure password hashes. In tests however, secure hashes + # are not important, waste resources and increase test times. The following + # reduces the work factor to the lowest possible values. + Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: + algorithm: auto + cost: 4 # Lowest possible value for bcrypt + time_cost: 3 # Lowest possible value for argon + memory_cost: 10 # Lowest possible value for argon diff --git a/symfony.lock b/symfony.lock index 4aaa175..41ef052 100644 --- a/symfony.lock +++ b/symfony.lock @@ -546,12 +546,12 @@ ] }, "symfony/security-bundle": { - "version": "5.1", + "version": "5.4", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "5.1", - "ref": "0a4bae19389d3b9cba1ca0102e3b2bccea724603" + "branch": "main", + "version": "5.3", + "ref": "98f1f2b0d635908c2b40f3675da2d23b1a069d30" }, "files": [ "config/packages/security.yaml" From 089cd2bb8527ab177abd7c857f9d0a05853ff54b Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 19:23:15 +0100 Subject: [PATCH 18/28] feat(update): apply recipes:update symfony/translation --- config/packages/translation.yaml | 7 +++++++ symfony.lock | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/config/packages/translation.yaml b/config/packages/translation.yaml index 55811cb..8c0264b 100644 --- a/config/packages/translation.yaml +++ b/config/packages/translation.yaml @@ -6,3 +6,10 @@ framework: - '%kernel.project_dir%/vendor/murph/murph-core/src/core/Resources/translations' fallbacks: - en +# providers: +# crowdin: +# dsn: '%env(CROWDIN_DSN)%' +# loco: +# dsn: '%env(LOCO_DSN)%' +# lokalise: +# dsn: '%env(LOKALISE_DSN)%' diff --git a/symfony.lock b/symfony.lock index 41ef052..25d1c53 100644 --- a/symfony.lock +++ b/symfony.lock @@ -582,12 +582,12 @@ "version": "v5.2.4" }, "symfony/translation": { - "version": "3.3", + "version": "5.4", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "3.3", - "ref": "2ad9d2545bce8ca1a863e50e92141f0b9d87ffcd" + "branch": "main", + "version": "5.3", + "ref": "da64f5a2b6d96f5dc24914517c0350a5f91dee43" }, "files": [ "config/packages/translation.yaml", From da12738b941cd1ea2223b7ad8fddc6402ab2e2f6 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 19:24:37 +0100 Subject: [PATCH 19/28] feat(update): apply recipes:update symfony/twig-bundle --- config/packages/test/twig.yaml | 2 -- config/packages/twig.yaml | 4 ++++ symfony.lock | 9 ++++----- 3 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 config/packages/test/twig.yaml diff --git a/config/packages/test/twig.yaml b/config/packages/test/twig.yaml deleted file mode 100644 index 8c6e0b4..0000000 --- a/config/packages/test/twig.yaml +++ /dev/null @@ -1,2 +0,0 @@ -twig: - strict_variables: true diff --git a/config/packages/twig.yaml b/config/packages/twig.yaml index d516d0f..b91df37 100644 --- a/config/packages/twig.yaml +++ b/config/packages/twig.yaml @@ -4,3 +4,7 @@ twig: paths: '%kernel.project_dir%/templates/core/': Core '%kernel.project_dir%/vendor/murph/murph-core/src/core/Resources/views/': Core + +when@test: + twig: + strict_variables: true diff --git a/symfony.lock b/symfony.lock index 25d1c53..0b0b352 100644 --- a/symfony.lock +++ b/symfony.lock @@ -601,15 +601,14 @@ "version": "v5.2.5" }, "symfony/twig-bundle": { - "version": "5.0", + "version": "5.4", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "5.0", - "ref": "fab9149bbaa4d5eca054ed93f9e1b66cc500895d" + "branch": "main", + "version": "5.4", + "ref": "bb2178c57eee79e6be0b297aa96fc0c0def81387" }, "files": [ - "config/packages/test/twig.yaml", "config/packages/twig.yaml", "templates/base.html.twig" ] From 740f90294d5edcb0258e87bb64b6e14f7b95dc11 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 19:24:49 +0100 Subject: [PATCH 20/28] feat(update): apply recipes:update symfony/validator --- config/packages/test/validator.yaml | 3 --- config/packages/validator.yaml | 5 +++++ symfony.lock | 9 ++++----- 3 files changed, 9 insertions(+), 8 deletions(-) delete mode 100644 config/packages/test/validator.yaml diff --git a/config/packages/test/validator.yaml b/config/packages/test/validator.yaml deleted file mode 100644 index 1e5ab78..0000000 --- a/config/packages/test/validator.yaml +++ /dev/null @@ -1,3 +0,0 @@ -framework: - validation: - not_compromised_password: false diff --git a/config/packages/validator.yaml b/config/packages/validator.yaml index 350786a..0201281 100644 --- a/config/packages/validator.yaml +++ b/config/packages/validator.yaml @@ -6,3 +6,8 @@ framework: # For instance, basic validation constraints will be inferred from Doctrine's metadata. #auto_mapping: # App\Entity\: [] + +when@test: + framework: + validation: + not_compromised_password: false diff --git a/symfony.lock b/symfony.lock index 0b0b352..e85835c 100644 --- a/symfony.lock +++ b/symfony.lock @@ -614,15 +614,14 @@ ] }, "symfony/validator": { - "version": "4.3", + "version": "5.4", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "4.3", - "ref": "d902da3e4952f18d3bf05aab29512eb61cabd869" + "branch": "main", + "version": "5.3", + "ref": "c32cfd98f714894c4f128bb99aa2530c1227603c" }, "files": [ - "config/packages/test/validator.yaml", "config/packages/validator.yaml" ] }, From 1cacfd0bb70e081a208e04dc9a9c7da5a5b70d52 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 19:25:03 +0100 Subject: [PATCH 21/28] feat(update): apply recipes:update symfony/web-profiler-bundle --- config/packages/dev/web_profiler.yaml | 6 ------ config/packages/test/web_profiler.yaml | 6 ------ config/packages/web_profiler.yaml | 15 +++++++++++++++ config/routes/dev/web_profiler.yaml | 7 ------- config/routes/web_profiler.yaml | 8 ++++++++ symfony.lock | 13 ++++++------- 6 files changed, 29 insertions(+), 26 deletions(-) delete mode 100644 config/packages/dev/web_profiler.yaml delete mode 100644 config/packages/test/web_profiler.yaml create mode 100644 config/packages/web_profiler.yaml delete mode 100644 config/routes/dev/web_profiler.yaml create mode 100644 config/routes/web_profiler.yaml diff --git a/config/packages/dev/web_profiler.yaml b/config/packages/dev/web_profiler.yaml deleted file mode 100644 index e92166a..0000000 --- a/config/packages/dev/web_profiler.yaml +++ /dev/null @@ -1,6 +0,0 @@ -web_profiler: - toolbar: true - intercept_redirects: false - -framework: - profiler: { only_exceptions: false } diff --git a/config/packages/test/web_profiler.yaml b/config/packages/test/web_profiler.yaml deleted file mode 100644 index 03752de..0000000 --- a/config/packages/test/web_profiler.yaml +++ /dev/null @@ -1,6 +0,0 @@ -web_profiler: - toolbar: false - intercept_redirects: false - -framework: - profiler: { collect: false } diff --git a/config/packages/web_profiler.yaml b/config/packages/web_profiler.yaml new file mode 100644 index 0000000..17893da --- /dev/null +++ b/config/packages/web_profiler.yaml @@ -0,0 +1,15 @@ +when@dev: + web_profiler: + toolbar: true + intercept_redirects: false + + framework: + profiler: { only_exceptions: false } + +when@test: + web_profiler: + toolbar: false + intercept_redirects: false + + framework: + profiler: { collect: false } diff --git a/config/routes/dev/web_profiler.yaml b/config/routes/dev/web_profiler.yaml deleted file mode 100644 index c82beff..0000000 --- a/config/routes/dev/web_profiler.yaml +++ /dev/null @@ -1,7 +0,0 @@ -web_profiler_wdt: - resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml' - prefix: /_wdt - -web_profiler_profiler: - resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml' - prefix: /_profiler diff --git a/config/routes/web_profiler.yaml b/config/routes/web_profiler.yaml new file mode 100644 index 0000000..8d85319 --- /dev/null +++ b/config/routes/web_profiler.yaml @@ -0,0 +1,8 @@ +when@dev: + web_profiler_wdt: + resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml' + prefix: /_wdt + + web_profiler_profiler: + resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml' + prefix: /_profiler diff --git a/symfony.lock b/symfony.lock index e85835c..cc7714a 100644 --- a/symfony.lock +++ b/symfony.lock @@ -635,17 +635,16 @@ "version": "v5.2.5" }, "symfony/web-profiler-bundle": { - "version": "3.3", + "version": "5.4", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "3.3", - "ref": "6bdfa1a95f6b2e677ab985cd1af2eae35d62e0f6" + "branch": "main", + "version": "5.3", + "ref": "24bbc3d84ef2f427f82104f766014e799eefcc3e" }, "files": [ - "config/packages/dev/web_profiler.yaml", - "config/packages/test/web_profiler.yaml", - "config/routes/dev/web_profiler.yaml" + "config/packages/web_profiler.yaml", + "config/routes/web_profiler.yaml" ] }, "symfony/webpack-encore-bundle": { From 74d12bba3bada0ef673a66159fa053a1f8038974 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 19:26:29 +0100 Subject: [PATCH 22/28] feat(update): apply recipes:update symfony/webpack-encore-bundle --- config/packages/assets.yaml | 3 --- config/packages/prod/webpack_encore.yaml | 4 ---- config/packages/test/webpack_encore.yaml | 2 -- config/packages/webpack_encore.yaml | 27 ++++++++++++++++++------ symfony.lock | 11 ++++------ webpack.config.js | 13 ++++++------ 6 files changed, 32 insertions(+), 28 deletions(-) delete mode 100644 config/packages/assets.yaml delete mode 100644 config/packages/prod/webpack_encore.yaml delete mode 100644 config/packages/test/webpack_encore.yaml diff --git a/config/packages/assets.yaml b/config/packages/assets.yaml deleted file mode 100644 index 051d36d..0000000 --- a/config/packages/assets.yaml +++ /dev/null @@ -1,3 +0,0 @@ -framework: - assets: - json_manifest_path: '%kernel.project_dir%/public/build/manifest.json' diff --git a/config/packages/prod/webpack_encore.yaml b/config/packages/prod/webpack_encore.yaml deleted file mode 100644 index d0b3ba8..0000000 --- a/config/packages/prod/webpack_encore.yaml +++ /dev/null @@ -1,4 +0,0 @@ -#webpack_encore: - # Cache the entrypoints.json (rebuild Symfony's cache when entrypoints.json changes) - # Available in version 1.2 - #cache: true diff --git a/config/packages/test/webpack_encore.yaml b/config/packages/test/webpack_encore.yaml deleted file mode 100644 index 02a7651..0000000 --- a/config/packages/test/webpack_encore.yaml +++ /dev/null @@ -1,2 +0,0 @@ -#webpack_encore: -# strict_mode: false diff --git a/config/packages/webpack_encore.yaml b/config/packages/webpack_encore.yaml index 90f1a1d..4c009ee 100644 --- a/config/packages/webpack_encore.yaml +++ b/config/packages/webpack_encore.yaml @@ -7,7 +7,12 @@ webpack_encore: # Set attributes that will be rendered on all script and link tags script_attributes: defer: true + # Uncomment (also under link_attributes) if using Turbo Drive + # https://turbo.hotwired.dev/handbook/drive#reloading-when-assets-change + # 'data-turbo-track': reload # link_attributes: + # Uncomment if using Turbo Drive + # 'data-turbo-track': reload # If using Encore.enableIntegrityHashes() and need the crossorigin attribute (default: false, or use 'anonymous' or 'use-credentials') # crossorigin: 'anonymous' @@ -20,11 +25,21 @@ webpack_encore: # If you have multiple builds: # builds: - # pass "frontend" as the 3rg arg to the Twig functions - # {{ encore_entry_script_tags('entry1', null, 'frontend') }} - # frontend: '%kernel.project_dir%/public/frontend/build' - # Cache the entrypoints.json (rebuild Symfony's cache when entrypoints.json changes) - # Put in config/packages/prod/webpack_encore.yaml - # cache: true + # pass the build name as the 3rd argument to the Twig functions + # {{ encore_entry_script_tags('entry1', null, 'frontend') }} + +framework: + assets: + json_manifest_path: '%kernel.project_dir%/public/build/manifest.json' + +#when@prod: +# webpack_encore: +# # Cache the entrypoints.json (rebuild Symfony's cache when entrypoints.json changes) +# # Available in version 1.2 +# cache: true + +#when@test: +# webpack_encore: +# strict_mode: false diff --git a/symfony.lock b/symfony.lock index cc7714a..8c98b81 100644 --- a/symfony.lock +++ b/symfony.lock @@ -648,12 +648,12 @@ ] }, "symfony/webpack-encore-bundle": { - "version": "1.9", + "version": "1.16", "recipe": { "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "1.9", - "ref": "9399a0bfc6ee7a0c019f952bca46d6a6045dd451" + "branch": "main", + "version": "1.10", + "ref": "f8fc53f1942f76679e9ee3c25fd44865355707b5" }, "files": [ "assets/app.js", @@ -661,9 +661,6 @@ "assets/controllers.json", "assets/controllers/hello_controller.js", "assets/styles/app.css", - "config/packages/assets.yaml", - "config/packages/prod/webpack_encore.yaml", - "config/packages/test/webpack_encore.yaml", "config/packages/webpack_encore.yaml", "package.json", "webpack.config.js" diff --git a/webpack.config.js b/webpack.config.js index a61b3a7..ef2fac8 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -11,7 +11,7 @@ Encore .setOutputPath('public/build/') // public path used by the web server to access the output path .setPublicPath('/build') - // only needed for CDN's or sub-directory deploy + // only needed for CDN's or subdirectory deploy //.setManifestKeyPrefix('build/') /* @@ -44,14 +44,15 @@ Encore // enables hashed filenames (e.g. app.abc123.css) .enableVersioning(Encore.isProduction()) - .configureBabel((config) => { - config.plugins.push('@babel/plugin-proposal-class-properties'); - }) + // configure Babel + // .configureBabel((config) => { + // config.plugins.push('@babel/a-babel-plugin'); + // }) - // enables @babel/preset-env polyfills + // enables and configure @babel/preset-env polyfills .configureBabelPresetEnv((config) => { config.useBuiltIns = 'usage'; - config.corejs = 3; + config.corejs = '3.23'; }) .copyFiles({ From 2b72994cdea0e9f87d1c97da0ac1b2dc0793c0da Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 19:27:58 +0100 Subject: [PATCH 23/28] feat(update): apply recipes:update scheb/2fa-bundle --- config/routes/scheb_2fa.yaml | 2 +- symfony.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/routes/scheb_2fa.yaml b/config/routes/scheb_2fa.yaml index b574a0c..9a8ca66 100644 --- a/config/routes/scheb_2fa.yaml +++ b/config/routes/scheb_2fa.yaml @@ -1,7 +1,7 @@ 2fa_login: path: /2fa defaults: - _controller: "scheb_two_factor.form_controller:form" + _controller: "scheb_two_factor.form_controller::form" 2fa_login_check: path: /2fa_check diff --git a/symfony.lock b/symfony.lock index 8c98b81..45065cb 100644 --- a/symfony.lock +++ b/symfony.lock @@ -228,12 +228,12 @@ "version": "4.1.1" }, "scheb/2fa-bundle": { - "version": "5.0", + "version": "5.13", "recipe": { - "repo": "github.com/symfony/recipes-contrib", - "branch": "master", + "repo": "github.com/symfony/recipes", + "branch": "main", "version": "5.0", - "ref": "95d9da4bffdc29417c209141cae8292e40d6af19" + "ref": "0a83961ef50ff91812b229a6f0caf28431d94aec" }, "files": [ "config/packages/scheb_2fa.yaml", From 70bac192e24cf8a99a3d3f01510d170445f429ef Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 20:52:55 +0100 Subject: [PATCH 24/28] fix(config): fix typo in 2fa conf --- config/packages/scheb_2fa.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/packages/scheb_2fa.yaml b/config/packages/scheb_2fa.yaml index 119eac5..e143e82 100644 --- a/config/packages/scheb_2fa.yaml +++ b/config/packages/scheb_2fa.yaml @@ -2,7 +2,7 @@ scheb_two_factor: google: enabled: true - issuer: "Muprh" + issuer: "Murph" server_name: digits: 6 window: 1 From 0f4767b8e0f86429692c5efec8cbf86b27701979 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 20:53:34 +0100 Subject: [PATCH 25/28] fix(config): fix firewall config add entry_point remove anonymous --- config/packages/security.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/packages/security.yaml b/config/packages/security.yaml index 7b07d7a..f35b7a4 100644 --- a/config/packages/security.yaml +++ b/config/packages/security.yaml @@ -25,7 +25,6 @@ security: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false main: - anonymous: ~ two_factor: auth_form_path: 2fa_login # The route name you have used in the routes.yaml check_path: 2fa_login_check # The route name you have used in the routes.yaml @@ -35,7 +34,7 @@ security: form_login: login_path: auth_login check_path: auth_login - csrf_token_generator: security.csrf.token_manager + enable_csrf: true logout: path: auth_logout target: / @@ -44,6 +43,8 @@ security: lifetime: 604800 path: / + entry_point: form_login + # Easy way to control access for large sections of your site # Note: Only the *first* access control that matches will be used access_control: From 7f5fcc98d7c5198fd8b9b61952a0e3d604452aad Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 8 Jan 2023 20:55:46 +0100 Subject: [PATCH 26/28] feat(dep): update composer.json remove symfony/flex update murph/murph-core --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 8e3d796..dea6ca6 100644 --- a/composer.json +++ b/composer.json @@ -7,8 +7,7 @@ "prefer-stable": true, "require": { "php": ">=8.0.0", - "murph/murph-core": "dev-feature/tests", - "symfony/flex": "^2.2" + "murph/murph-core": "^1.17" }, "require-dev": { "symfony/browser-kit": "^5.4", @@ -27,7 +26,8 @@ }, "sort-packages": true, "allow-plugins": { - "symfony/flex": true + "symfony/flex": true, + "symfony/runtime": true } }, "autoload": { From ab808ee511b0b20531c4a28e77293a3c7107be22 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 13 Jan 2023 18:14:30 +0100 Subject: [PATCH 27/28] ci(conf): add ci --- .woodpecker.yml | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .woodpecker.yml diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..07c7ad0 --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,49 @@ +matrix: + PHP_VERSION: + - 8.0 + - 8.1 + +services: + db: + image: mariadb:10.3 + environment: + - MARIADB_ROOT_PASSWORD=root + +pipeline: + db_wait: + image: gitnet.fr/deblan/timeout:latest + commands: + - /bin/timeout -t 30 -v -c 'while true; do nc -z -v db 3306 2>&1 | grep succeeded && exit 0; sleep 0.5; done' + + db_create: + image: mariadb:10.3 + commands: + - mysql -hdb -uroot -proot -e "CREATE DATABASE app" + + config: + image: deblan/php:8.1 + commands: + - echo APP_ENV=prod >> .env.local + - echo APP_SECRET=$(openssl rand -hex 32) >> .env.local + - echo DATABASE_URL=mysql://root:root@db/app >> .env.local + + composer: + image: deblan/php:${PHP_VERSION} + commands: + - apt-get update && apt-get -y install git + - composer install --no-scripts + + db_migrate: + image: deblan/php:${PHP_VERSION} + environment: + - PHP=php + commands: + - ./bin/doctrine-migrate + + node: + image: node:16-slim + commands: + - yarn + - test -d public/js || mkdir public/js + - test -f public/js/fos_js_routes.json || echo "{}" > public/js/fos_js_routes.json + - npm run build From e550bc54e2652188c06b22fdd2bd9e955a11ed01 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 13 Jan 2023 18:27:44 +0100 Subject: [PATCH 28/28] release v1.18.0 --- CHANGELOG.md | 28 ++++++++++++++++++++++++++++ composer.json | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f2f69f0..d7ada11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,33 @@ ## [Unreleased] +## [1.18.0] 2023-01-13 +### Added +* feat(dep): update dependencies +* feat(update): apply new recipe for phpunit +* feat(update): apply recipes:update doctrine/doctrine-bundle +* feat(update): apply recipes:update doctrine/doctrine-migrations-bundle +* feat(update): apply recipes:update liip/imagine-bundle +* feat(update): apply recipes:update stof/doctrine-extensions-bundle +* feat(update): apply recipes:update symfony/apache-pack +* feat(update): apply recipes:update symfony/console +* feat(update): apply recipes:update symfony/debug-bundle +* feat(update): apply recipes:update symfony/flex +* feat(update): apply recipes:update symfony/mailer +* feat(update): apply recipes:update symfony/framework-bundle +* feat(update): apply recipes:update symfony/monolog-bundle +* feat(update): apply recipes:update symfony/routing +* feat(update): apply recipes:update symfony/security-bundle +* feat(update): apply recipes:update symfony/translation +* feat(update): apply recipes:update symfony/twig-bundle +* feat(update): apply recipes:update symfony/validator +* feat(update): apply recipes:update symfony/web-profiler-bundle +* feat(update): apply recipes:update symfony/webpack-encore-bundle +* feat(update): apply recipes:update scheb/2fa-bundle +### Fixed +* fix(config): fix typo in 2fa conf +* fix(config): fix firewall config + + ## [1.17.0] 2022-11-19 ### Changed * upgrade murph/murph-core diff --git a/composer.json b/composer.json index dea6ca6..a589ba1 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ "prefer-stable": true, "require": { "php": ">=8.0.0", - "murph/murph-core": "^1.17" + "murph/murph-core": "^1.18" }, "require-dev": { "symfony/browser-kit": "^5.4",