Enhance params and envs
This commit is contained in:
20
.env
20
.env
@@ -26,23 +26,6 @@ APP_SHARE_DIR=var/share
|
||||
DEFAULT_URI=http://localhost
|
||||
###< symfony/routing ###
|
||||
|
||||
###> doctrine/doctrine-bundle ###
|
||||
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
|
||||
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
|
||||
#
|
||||
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data_%kernel.environment%.db"
|
||||
# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.0.32&charset=utf8mb4"
|
||||
# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4"
|
||||
DATABASE_URL="postgresql://app:pwd@127.0.0.1:5432/app?serverVersion=16&charset=utf8"
|
||||
|
||||
POSTGRES_VERSION=16
|
||||
POSTGRES_HOST=127.0.0.1
|
||||
POSTGRES_PORT=5432
|
||||
POSTGRES_DB=app
|
||||
POSTGRES_USER=app
|
||||
POSTGRES_PASSWORD=pwd
|
||||
###< doctrine/doctrine-bundle ###
|
||||
|
||||
###> symfony/messenger ###
|
||||
# Choose one of the transports below
|
||||
# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages
|
||||
@@ -53,6 +36,3 @@ MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
|
||||
###> symfony/mailer ###
|
||||
MAILER_DSN=null://null
|
||||
###< symfony/mailer ###
|
||||
|
||||
TMDB_API_TOKEN=eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJkZmE5NDZmMTZmMTcyYmNlMzk0MzZiZmVhZDc2ZTk3NCIsIm5iZiI6MTY0OTE4MjMyNS43NTAwMDAyLCJzdWIiOiI2MjRjODY3NWFmNThjYjAwNTE1NzZiYmEiLCJzY29wZXMiOlsiYXBpX3JlYWQiXSwidmVyc2lvbiI6MX0.KE68nNxPGYWr5WHVaUuILMOH3sPhiAc9CucPVTgRPpM
|
||||
TMDB_HOST=https://api.themoviedb.org/3
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
doctrine:
|
||||
dbal:
|
||||
driver: pdo_pgsql
|
||||
host: '%env(resolve:POSTGRES_HOST)%'
|
||||
port: '%env(resolve:POSTGRES_PORT)%'
|
||||
dbname: '%env(resolve:POSTGRES_DB)%'
|
||||
user: '%env(resolve:POSTGRES_USER)%'
|
||||
password: '%env(resolve:POSTGRES_PASSWORD)%'
|
||||
server_version: '%env(resolve:POSTGRES_VERSION)%'
|
||||
host: '%postgres_host%'
|
||||
port: '%postgres_port%'
|
||||
dbname: '%postgres_db%'
|
||||
user: '%postgres_user%'
|
||||
password: '%postgres_password%'
|
||||
server_version: '%postgres_version%'
|
||||
charset: utf8
|
||||
|
||||
# IMPORTANT: You MUST configure your server version,
|
||||
|
||||
9
config/parameters.yml
Normal file
9
config/parameters.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
parameters:
|
||||
postgres_version: "16"
|
||||
postgres_host: "127.0.0.1"
|
||||
postgres_port: "5432"
|
||||
postgres_db: "app"
|
||||
postgres_user: "app"
|
||||
postgres_password: "pwd"
|
||||
|
||||
tmdb_host: "https://api.themoviedb.org/3"
|
||||
@@ -6,7 +6,8 @@
|
||||
|
||||
# Put parameters here that don't need to change on each machine where the app is deployed
|
||||
# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration
|
||||
parameters:
|
||||
imports:
|
||||
- { resource: parameters.yml }
|
||||
|
||||
services:
|
||||
# default configuration for services in *this* file
|
||||
|
||||
@@ -20,7 +20,7 @@ class TMDBGateway
|
||||
private readonly SerializerInterface $serializer,
|
||||
#[Autowire('%env(TMDB_API_TOKEN)%')]
|
||||
private readonly string $apiToken,
|
||||
#[Autowire('%env(TMDB_HOST)%')]
|
||||
#[Autowire('%tmdb_host%')]
|
||||
private readonly string $host,
|
||||
) {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user