Skip to content
This repository has been archived by the owner on Dec 29, 2023. It is now read-only.

Commit

Permalink
Migration to Symfony 6.4 LTS
Browse files Browse the repository at this point in the history
  • Loading branch information
jgauthi committed Dec 29, 2023
1 parent b758a38 commit 387e29e
Show file tree
Hide file tree
Showing 12 changed files with 1,169 additions and 1,159 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ DB_PORT=3306
DB_NAME=poc-messenger
DB_USER=local
DB_PASS=local
DATABASE_URL=mysql://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}?serverVersion=8
DATABASE_URL=mysql://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}?serverVersion=8.2.0
###< doctrine/doctrine-bundle ###

###> symfony/messenger ###
Expand Down
1 change: 1 addition & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
'native_function_invocation' => false,
'native_constant_invocation' => false,
'new_with_braces' => false,
'new_with_parentheses' => false,
'no_php4_constructor' => true,
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# POC Symfony 6.2 with Messenger component + Docker (LAMP with Supervisor, MailDev, RabbitMQ)
# POC Symfony 6.4 with Messenger component + Docker (LAMP with Supervisor, MailDev, RabbitMQ)
Messenger provides a message bus with the ability to send messages and then handle them immediately in your application or send them through transports (e.g. queues) to be handled later. To learn more deeply about it, read the [Messenger component docs](https://symfony.com/doc/6.2/messenger.htmlcomponents/messenger.html).

The messages are automatically consumed (send) by a worker from [supervisor](http://supervisord.org). Without it, you need to launch manually the command `make messenger` (or `php bin/console messenger:consume async` in local symfony server).
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jgauthi/poc_symfony6_messenger",
"description": "POC Symfony 6.2 with messenger component",
"description": "POC Symfony 6.4 with messenger component",
"type": "project",
"license": "GPL-3.0-only",
"require": {
Expand All @@ -15,6 +15,7 @@
"knplabs/knp-paginator-bundle": "*",
"symfony/amqp-messenger": "*",
"symfony/asset": "*",
"symfony/clock": "*",
"symfony/console": "*",
"symfony/doctrine-messenger": "*",
"symfony/dotenv": "*",
Expand Down Expand Up @@ -101,7 +102,7 @@
"extra": {
"symfony": {
"allow-contrib": false,
"require": "6.3.*"
"require": "6.4.*"
}
},
"authors": [
Expand Down
2,259 changes: 1,146 additions & 1,113 deletions composer.lock

Large diffs are not rendered by default.

15 changes: 8 additions & 7 deletions config/packages/doctrine.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
parameters:
# Adds a fallback DATABASE_URL if the env var is not set.
# This allows you to run cache:warmup even if your
# environment variables are not available yet.
# You should not need to change this value.
env(DATABASE_URL): ''

doctrine:
dbal:
url: '%env(resolve:DATABASE_URL)%'

# IMPORTANT: You MUST configure your server version,
# either here or in the DATABASE_URL env var (see .env file)
#server_version: '13'

profiling_collect_backtrace: '%kernel.debug%'

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
auto_mapping: true
mappings:
App:
type: attribute
is_bundle: false
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
Expand All @@ -27,6 +27,7 @@ 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
Expand Down
2 changes: 1 addition & 1 deletion config/packages/doctrine_migrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +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: '%kernel.debug%'
enable_profiler: false
2 changes: 1 addition & 1 deletion config/packages/framework.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# see https://symfony.com/doc/current/reference/configuration/framework.html
framework:
secret: '%env(APP_SECRET)%'
annotations: false
#csrf_protection: true
http_method_override: false
handle_all_throwables: true
Expand All @@ -11,7 +12,6 @@ framework:
handler_id: null
cookie_secure: auto
cookie_samesite: lax
storage_factory_id: session.storage.factory.native

#esi: true
#fragments: true
Expand Down
25 changes: 0 additions & 25 deletions config/packages/monolog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,6 @@ when@prod:
process_psr_3_messages: false
channels: [ "!event", "!doctrine", "!console", "!deprecation" ]

when@staging: # Showroom DEV
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
excluded_http_codes: [405]
buffer_size: 50 # How many messages should be saved? Prevent memory leaks
nested:
type: rotating_file
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
max_files: 30
channels: [ "!deprecation" ]
deprecation:
type: rotating_file
path: "%kernel.logs_dir%/%kernel.environment%.deprecations.log"
max_files: 2
channels: [ "deprecation" ]
console:
type: console
process_psr_3_messages: false
channels: [ "!event", "!doctrine", "!console", "!deprecation" ]

when@dev:
monolog:
handlers:
Expand Down
3 changes: 0 additions & 3 deletions config/packages/security.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
security:
password_hashers:
# Our user class and the algorithm we'll use to encode passwords
# 'auto' means to let Symfony choose the best possible password hasher (Argon2 or Bcrypt)
# https://symfony.com/doc/current/security.html#c-encoding-passwords
Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: 'auto'
providers:
database_users:
Expand Down
6 changes: 4 additions & 2 deletions config/packages/web_profiler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ when@dev:
intercept_redirects: false

framework:
profiler: { only_exceptions: false }
profiler:
only_exceptions: false
collect_serializer_data: true

when@test:
web_profiler:
toolbar: false
intercept_redirects: false

framework:
profiler: { collect: false }
profiler: { collect: false }
6 changes: 3 additions & 3 deletions src/Entity/Trait/LastUpdateTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ trait LastUpdateTrait
{
#[ORM\Column(type: Types::DATETIME_MUTABLE, options: ['default' => 'CURRENT_TIMESTAMP'])]
#[Groups('Details')]
private \DateTimeInterface $lastUpdate;
private \DateTime $lastUpdate;

public function getLastUpdate(): \DateTimeInterface
public function getLastUpdate(): \DateTime
{
return $this->lastUpdate;
}

public function setLastUpdate(\DateTimeInterface $lastUpdate): self
public function setLastUpdate(\DateTime $lastUpdate): self
{
$this->lastUpdate = $lastUpdate;

Expand Down

0 comments on commit 387e29e

Please sign in to comment.