diff --git a/.env b/.env index a09a7a3..39bd341 100644 --- a/.env +++ b/.env @@ -16,7 +16,7 @@ ###> symfony/framework-bundle ### APP_ENV=dev -APP_SECRET=5d06ec43bb4fba3510e81575422626eb +APP_SECRET= ###< symfony/framework-bundle ### ###> symfony/messenger ### @@ -32,8 +32,8 @@ MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0 # # DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db" DATABASE_URL="mysql://app:app@mysql:3306/app?serverVersion=9.1.0&charset=utf8mb4" -# DATABASE_URL="mysql://app:!ChangeMe!@database:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4" -#DATABASE_URL="postgresql://app:!ChangeMe!@database:5432/app?serverVersion=15&charset=utf8" +# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4" +# DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=16&charset=utf8" ###< doctrine/doctrine-bundle ### ###> docker/atmoz-sftp ### diff --git a/.env.dev b/.env.dev new file mode 100644 index 0000000..b2e94fb --- /dev/null +++ b/.env.dev @@ -0,0 +1,4 @@ + +###> symfony/framework-bundle ### +APP_SECRET=956760cc4838bd97673f94ffec6eed30 +###< symfony/framework-bundle ### diff --git a/bin/console b/bin/console index c933dc5..d8d530e 100755 --- a/bin/console +++ b/bin/console @@ -4,6 +4,10 @@ use App\Kernel; use Symfony\Bundle\FrameworkBundle\Console\Application; +if (!is_dir(dirname(__DIR__).'/vendor')) { + throw new LogicException('Dependencies are missing. Try running "composer install".'); +} + if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) { throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".'); } diff --git a/composer.json b/composer.json index 2c9cda5..3cb6c76 100644 --- a/composer.json +++ b/composer.json @@ -58,5 +58,11 @@ } ], "minimum-stability": "dev", - "prefer-stable": true + "prefer-stable": true, + "extra": { + "symfony": { + "allow-contrib": false, + "require": "7.2.*" + } + } } diff --git a/config/bundles.php b/config/bundles.php index bc64251..e7d5f11 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -18,5 +18,6 @@ CleverAge\SoapProcessBundle\CleverAgeSoapProcessBundle::class => ['all' => true], CleverAge\RestProcessBundle\CleverAgeRestProcessBundle::class => ['all' => true], CleverAge\FlysystemProcessBundle\CleverAgeFlysystemProcessBundle::class => ['all' => true], - \League\FlysystemBundle\FlysystemBundle::class => ['all' => true] + \League\FlysystemBundle\FlysystemBundle::class => ['all' => true], + Symfony\UX\TwigComponent\TwigComponentBundle::class => ['all' => true], ]; diff --git a/config/packages/csrf.yaml b/config/packages/csrf.yaml new file mode 100644 index 0000000..89402ba --- /dev/null +++ b/config/packages/csrf.yaml @@ -0,0 +1,12 @@ +# Enable stateless CSRF protection for forms and logins/logouts +# Uncomment following if you are using Symfony 7.2 or higher +#framework: +# form: +# csrf_protection: +# token_id: submit +# +# csrf_protection: +# stateless_token_ids: +# - submit +# - authenticate +# - logout diff --git a/config/packages/doctrine.yaml b/config/packages/doctrine.yaml index ec0f77e..25138b9 100644 --- a/config/packages/doctrine.yaml +++ b/config/packages/doctrine.yaml @@ -4,22 +4,28 @@ doctrine: # IMPORTANT: You MUST configure your server version, # either here or in the DATABASE_URL env var (see .env file) - #server_version: '15' + #server_version: '16' profiling_collect_backtrace: '%kernel.debug%' + use_savepoints: true orm: auto_generate_proxy_classes: true enable_lazy_ghost_objects: true report_fields_where_declared: true validate_xml_mapping: true naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware + identity_generation_preferences: + Doctrine\DBAL\Platforms\PostgreSQLPlatform: identity auto_mapping: true mappings: App: + type: attribute is_bundle: false dir: '%kernel.project_dir%/src/Entity' prefix: 'App\Entity' alias: App + controller_resolver: + auto_mapping: false when@test: doctrine: diff --git a/config/packages/framework.yaml b/config/packages/framework.yaml index 6d85c29..7e1ee1f 100644 --- a/config/packages/framework.yaml +++ b/config/packages/framework.yaml @@ -1,22 +1,12 @@ # see https://symfony.com/doc/current/reference/configuration/framework.html framework: secret: '%env(APP_SECRET)%' - #csrf_protection: true - http_method_override: false - handle_all_throwables: true - # 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. - session: - handler_id: null - cookie_secure: auto - cookie_samesite: lax - storage_factory_id: session.storage.factory.native + # Note that the session will be started ONLY if you read or write from it. + session: true #esi: true #fragments: true - php_errors: - log: true when@test: framework: diff --git a/config/packages/monolog.yaml b/config/packages/monolog.yaml index 8c9efa9..9db7d8a 100644 --- a/config/packages/monolog.yaml +++ b/config/packages/monolog.yaml @@ -59,3 +59,4 @@ when@prod: type: stream channels: [deprecation] path: php://stderr + formatter: monolog.formatter.json diff --git a/config/packages/routing.yaml b/config/packages/routing.yaml index 4b766ce..8166181 100644 --- a/config/packages/routing.yaml +++ b/config/packages/routing.yaml @@ -1,7 +1,5 @@ framework: router: - utf8: true - # 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 diff --git a/config/packages/translation.yaml b/config/packages/translation.yaml index 888f0ba..b3f8f9c 100644 --- a/config/packages/translation.yaml +++ b/config/packages/translation.yaml @@ -4,12 +4,4 @@ framework: default_path: '%kernel.project_dir%/translations' fallbacks: - en -# providers: -# crowdin: -# dsn: '%env(CROWDIN_DSN)%' -# loco: -# dsn: '%env(LOCO_DSN)%' -# lokalise: -# dsn: '%env(LOKALISE_DSN)%' -# phrase: -# dsn: '%env(PHRASE_DSN)%' + providers: diff --git a/config/packages/twig.yaml b/config/packages/twig.yaml index f9f4cc5..3f795d9 100644 --- a/config/packages/twig.yaml +++ b/config/packages/twig.yaml @@ -1,5 +1,5 @@ twig: - default_path: '%kernel.project_dir%/templates' + file_name_pattern: '*.twig' when@test: twig: diff --git a/config/packages/twig_component.yaml b/config/packages/twig_component.yaml new file mode 100644 index 0000000..fd17ac6 --- /dev/null +++ b/config/packages/twig_component.yaml @@ -0,0 +1,5 @@ +twig_component: + anonymous_template_directory: 'components/' + defaults: + # Namespace & directory for components + App\Twig\Components\: 'components/' diff --git a/config/packages/uid.yaml b/config/packages/uid.yaml deleted file mode 100644 index 0152094..0000000 --- a/config/packages/uid.yaml +++ /dev/null @@ -1,4 +0,0 @@ -framework: - uid: - default_uuid_version: 7 - time_based_uuid_version: 7 diff --git a/config/packages/validator.yaml b/config/packages/validator.yaml index 0201281..dd47a6a 100644 --- a/config/packages/validator.yaml +++ b/config/packages/validator.yaml @@ -1,7 +1,5 @@ framework: validation: - email_validation_mode: html5 - # Enables validator auto-mapping support. # For instance, basic validation constraints will be inferred from Doctrine's metadata. #auto_mapping: diff --git a/config/routes/security.yaml b/config/routes/security.yaml new file mode 100644 index 0000000..f853be1 --- /dev/null +++ b/config/routes/security.yaml @@ -0,0 +1,3 @@ +_security_logout: + resource: security.route_loader.logout + type: service diff --git a/symfony.lock b/symfony.lock index 5e9a38c..092fb9d 100644 --- a/symfony.lock +++ b/symfony.lock @@ -5,22 +5,22 @@ "cleverage/process-bundle": { "version": "dev-prepare-release" }, - "cleverage/soap-process-bundle": { + "cleverage/rest-process-bundle": { "version": "dev-prepare-release" }, - "cleverage/rest-process-bundle": { + "cleverage/soap-process-bundle": { "version": "dev-prepare-release" }, "cleverage/ui-process-bundle": { "version": "dev-prepare-release" }, "doctrine/doctrine-bundle": { - "version": "2.10", + "version": "2.13", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", - "version": "2.10", - "ref": "e025a6cb69b195970543820b2f18ad21724473fa" + "version": "2.13", + "ref": "8d96c0b51591ffc26794d865ba3ee7d193438a83" }, "files": [ "config/packages/doctrine.yaml", @@ -100,12 +100,12 @@ ] }, "phpstan/phpstan": { - "version": "1.10", + "version": "2.0", "recipe": { "repo": "github.com/symfony/recipes-contrib", "branch": "main", "version": "1.0", - "ref": "f10b8054de1a94a3b9e8806a6453fd5c98491c44" + "ref": "5e490cc197fb6bb1ae22e5abbc531ddc633b6767" }, "files": [ "phpstan.dist.neon" @@ -126,12 +126,12 @@ ] }, "symfony/console": { - "version": "6.3", + "version": "7.2", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", "version": "5.3", - "ref": "da0c8be8157600ad34f10ff0c9cc91232522e047" + "ref": "1781ff40d8a17d87cf53f8d4cf0c8346ed2bb461" }, "files": [ "bin/console" @@ -150,24 +150,37 @@ ] }, "symfony/flex": { - "version": "2.3", + "version": "2.4", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", - "version": "1.0", - "ref": "146251ae39e06a95be0fe3d13c807bcf3938b172" + "version": "2.4", + "ref": "52e9754527a15e2b79d9a610f98185a1fe46622a" + }, + "files": [ + ".env", + ".env.dev" + ] + }, + "symfony/form": { + "version": "7.2", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "7.2", + "ref": "7d86a6723f4a623f59e2bf966b6aad2fc461d36b" }, "files": [ - ".env" + "config/packages/csrf.yaml" ] }, "symfony/framework-bundle": { - "version": "6.3", + "version": "7.2", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", - "version": "6.2", - "ref": "af47254c5e4cd543e6af3e4508298ffebbdaddd3" + "version": "7.2", + "ref": "87bcf6f7c55201f345d8895deda46d2adbdbaa89" }, "files": [ "config/packages/cache.yaml", @@ -202,24 +215,24 @@ ] }, "symfony/monolog-bundle": { - "version": "3.8", + "version": "3.10", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", "version": "3.7", - "ref": "213676c4ec929f046dfde5ea8e97625b81bc0578" + "ref": "aff23899c4440dd995907613c1dd709b6f59503f" }, "files": [ "config/packages/monolog.yaml" ] }, "symfony/routing": { - "version": "6.3", + "version": "7.2", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", - "version": "6.2", - "ref": "e0a11b4ccb8c9e70b574ff5ad3dfdcd41dec5aa6" + "version": "7.0", + "ref": "21b72649d5622d8f7da329ffb5afb232a023619d" }, "files": [ "config/packages/routing.yaml", @@ -227,24 +240,25 @@ ] }, "symfony/security-bundle": { - "version": "6.3", + "version": "7.2", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", - "version": "6.0", - "ref": "8a5b112826f7d3d5b07027f93786ae11a1c7de48" + "version": "6.4", + "ref": "2ae08430db28c8eb4476605894296c82a642028f" }, "files": [ - "config/packages/security.yaml" + "config/packages/security.yaml", + "config/routes/security.yaml" ] }, "symfony/translation": { - "version": "6.3", + "version": "7.2", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", "version": "6.3", - "ref": "64fe617084223633e1dedf9112935d8c95410d3e" + "ref": "e28e27f53663cc34f0be2837aba18e3a1bef8e7b" }, "files": [ "config/packages/translation.yaml", @@ -252,12 +266,12 @@ ] }, "symfony/twig-bundle": { - "version": "6.3", + "version": "7.2", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", - "version": "6.3", - "ref": "b7772eb20e92f3fb4d4fe756e7505b4ba2ca1a2c" + "version": "6.4", + "ref": "cab5fd2a13a45c266d45a7d9337e28dee6272877" }, "files": [ "config/packages/twig.yaml", @@ -265,24 +279,34 @@ ] }, "symfony/uid": { - "version": "6.3", + "version": "7.2", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", - "version": "6.2", - "ref": "d294ad4add3e15d7eb1bae0221588ca89b38e558" + "version": "7.0", + "ref": "0df5844274d871b37fc3816c57a768ffc60a43a5" + }, + "files": [] + }, + "symfony/ux-twig-component": { + "version": "2.22", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "2.13", + "ref": "67814b5f9794798b885cec9d3f48631424449a01" }, "files": [ - "config/packages/uid.yaml" + "config/packages/twig_component.yaml" ] }, "symfony/validator": { - "version": "6.3", + "version": "7.2", "recipe": { "repo": "github.com/symfony/recipes", "branch": "main", - "version": "5.3", - "ref": "c32cfd98f714894c4f128bb99aa2530c1227603c" + "version": "7.0", + "ref": "8c1c4e28d26a124b0bb273f537ca8ce443472bfd" }, "files": [ "config/packages/validator.yaml" diff --git a/templates/base.html.twig b/templates/base.html.twig index 67598ac..1069c14 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -3,7 +3,7 @@