Configuration and environments

← Configuration and environments

Ashterix

docs(articles): Magento and Symfony examples side by side, request lifecycle as a Mermaid diagram

en/articles/magento-to-symfony/core/config.md +6 −1

2 2
3 3 Configuration has two levels. Bundle config (`config/packages/*.yaml`) describes how the framework is set up and is read when the container is compiled. Environment variables (`%env(...)%`) hold what differs between servers and are read at runtime.
4 4
5 + ::::columns
6 + :::col
5 7 **Magento** · a value from the admin
6 8
7 9 ```php
10 12 ScopeInterface::SCOPE_STORE
11 13 );
12 14 ```
13 −
15 + :::
16 + :::col
14 17 **Symfony** · a value from the environment
15 18
16 19 ```dotenv
26 29 ) {}
27 30 }
28 31 ```
32 + :::
33 + ::::
29 34
30 35 - **File order:** `.env` → `.env.local` → `.env.$APP_ENV` → `.env.$APP_ENV.local`. Real environment variables win over all files. `.env` is committed, `*.local` is not.
31 36 - **Processors:** `%env(int:X)%`, `bool:`, `json:`, `resolve:`, `default:fallback_param:X`.