php -v
composer --version
composer selfupdate
sudo update-alternatives --set php /usr/bin/php8.2
symfony new gift_manager_api '--version=6.2.*' --webapp
composer require api
composer require symfony/apache-pack
composer require gedmo/doctrine-extensions "^3.10"
dans config/services.yaml
parameters:
app.from_email.address: "%env(APP_FROM_EMAIL_ADDRESS)%"
app.from_email.name: "%env(APP_FROM_EMAIL_NAME)%"
services:
App\Service\MailSender:
arguments:
$fromEmailAddress: "%app.from_email.address%"
$fromEmailName: "%app.from_email.name%"
gedmo.listener.timestampable:
class: Gedmo\Timestampable\TimestampableListener
tags:
- { name: doctrine.event_subscriber, connection: default }
calls:
- [ setAnnotationReader, [ "@annotation_reader" ] ]
Dans le .env
APP_FROM_EMAIL_ADDRESS=noreply@noreply.com
APP_FROM_EMAIL_NAME="NO REPLY"
MESSENGER_TRANSPORT_DSN=doctrine://default
APP_SECRET à changer
Paquets
"require-dev": {
"roave/security-advisories": "dev-latest",
"captainhook/captainhook": "^5.10",
"marcocesarato/php-conventional-changelog": "^1.15",
"ramsey/conventional-commits": "^1.3",
}
Exposition reverse proxy
S'assurer que le reverse proxy renvoie bien http-forwarded-prefix
Configurer les trusted proxies
# config/packages/framework.yml
framework:
trusted_proxies: '%env(TRUSTED_PROXIES)%'
trusted_headers: ['x-forwarded-for', 'x-forwarded-host', 'x-forwarded-proto', 'x-forwarded-port', 'x-forwarded-prefix']
définir la variable d'env TRUSTED_PROXIES avec le/les réseaux ou IP spécfiques (séparés par des virgules, réseaux en notation CIDR)
dans le .env
: TRUSTED_PROXIES=""
Description
Languages
PHP
84.4%
Shell
9%
Dockerfile
6.6%