You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ($connection['logging']) {
$logger = new Reference('doctrine.dbal.logger');
}
$connection['logging'] contains something like string(74) "env_53d7fe31b9ea8cf5_bool_LOG_SQL_QUERIES_d2a427ed60021c1b934ed0f420ebe859".
Maybe envVars should be resolved automatically earlier?
Maybe envVars should be resolved automatically earlier?
Env variables are precisely meant to be resolved at runtime and not during the compilation of the container. The initial requirement of designing that feature was that changing the value of the env variable does not require clearing the cache to recompile the container.
And so this indeed means that any configuration setting of a bundle which affects the way services are wired (rather than arguments passed to their constructor) cannot use env variable for the config.
DoctrineBundle used Env to configure dbal.url
As result assumption is that it's possible to use Env to configure other parameters 😃
Just little proposal to make a life of future users easier:
And so this indeed means that any configuration setting of a bundle which affects the way services are wired (rather than arguments passed to their constructor) cannot use env variable for the config.
Maybe it's possible to add something like this to documentation. Main idea is that not all parameters of bundle could be configured via Env.
Symfony version(s) affected: 5.1.8
Description
DoctrineBundle
doctrine.dbal.logging
configuration parameter couldn't be set viaenv
parameter.How to reproduce
symfony + doctrinebundle
Actual result: SQL queries are logged
Expected result: SQL queries are NOT logged
Possible root cause*
https://github.com/doctrine/DoctrineBundle/blob/6b1620354863f1f04fd4aa0a725e4ad1c728faac/DependencyInjection/DoctrineExtension.php#L139
$connection['logging']
contains something likestring(74) "env_53d7fe31b9ea8cf5_bool_LOG_SQL_QUERIES_d2a427ed60021c1b934ed0f420ebe859"
.Maybe envVars should be resolved automatically earlier?
Additional context
Original issue reported to DoctrineBundle doctrine/DoctrineBundle#1244.
The text was updated successfully, but these errors were encountered: