<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>yes</td>
</tr>
<tr>
<td>Feature request?</td>
<td>no</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>no</td>
</tr>
<tr>
<td>RFC?</td>
<td>no</td>
</tr>
<tr>
<td>Symfony version</td>
<td>3.2?</td>
</tr>
</tbody>
</table>
<p dir="auto">Creating a ticket to follow up on <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="271971940" data-permission-text="Title is private" data-url="https://github.com/symfony/symfony/issues/24865" data-hovercard-type="issue" data-hovercard-url="/symfony/symfony/issues/24865/hovercard" href="https://github.com/symfony/symfony/issues/24865">#24865</a></p>
<p dir="auto">From <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/weaverryan/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/weaverryan">@weaverryan</a></p>
<blockquote>
<p dir="auto">Tangentially related to this: thanks to the same lack of laziness in Doctrine, the Doctrine Connection object is also instantiated. This means that a DATABASE_URL environment variable must be available at cache:warmup time. It doesn't need to be valid (no connection is make), but it does need to be defined: <a href="https://user-images.githubusercontent.com/121003/32516437-56ceb114-c3d1-11e7-8249-597c514117c1.png" rel="nofollow">https://user-images.githubusercontent.com/121003/32516437-56ceb114-c3d1-11e7-8249-597c514117c1.png</a></p>
</blockquote>
<p dir="auto">And from <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/nicolas-grekas/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/nicolas-grekas">@nicolas-grekas</a></p>
<blockquote>
<p dir="auto">The only way around is using a real lazy proxy from proxy-manager, which has tighter integration with the DI component and is able to call a factory lazily.</p>
</blockquote>
<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>no</td>
</tr>
<tr>
<td>Feature request?</td>
<td>yes</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>maybe</td>
</tr>
<tr>
<td>RFC?</td>
<td>yes</td>
</tr>
<tr>
<td>Symfony version</td>
<td>3.3, 3.4, 4.0</td>
</tr>
</tbody>
</table>
<p dir="auto">I have a CI build &amp; run pipeline.</p>
<ul dir="auto">
<li>The cache is warmed up in the build process (using docker, withing the docker image build)</li>
<li>Environment variables are used to configure the application</li>
</ul>
<p dir="auto">The current implementation of the DI component requires to have all the ENV variables used in the config files as "defined" in the warmup environment, and this is really annoying...</p>
<p dir="auto">I'm forced by <a href="https://github.com/symfony/symfony/blob/master/src/Symfony/Component/DependencyInjection/EnvVarProcessor.php#L76">this</a> the to re-define all of them (with some default values) inside a file like <code class="notranslate">parameters.yml</code> just to be able to warm up the cache</p>
<p dir="auto">There are too many env files to maintain:</p>
<ol dir="auto">
<li>Env variables are used "here and there" in the config files.</li>
<li>a list of env variables is available inside <code class="notranslate">.env.dist</code></li>
<li>the customized env variables for development are stored inside the <code class="notranslate">.env</code> file</li>
<li><code class="notranslate">parameters.yml</code> to workaround the warmup issue</li>
</ol>
<p dir="auto">Can the variable existence check be omitted? Default to <code class="notranslate">null</code>?</p>
<p dir="auto">It is a common thing that in the "build" environment env variables are different from the "run" envs and having to define them just to have a default is annoying.</p>