Skip to content

Instantly share code, notes, and snippets.

@mkurzeja

mkurzeja/app.php Secret

Created February 2, 2017 08:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkurzeja/078ec50f315e3bd36be9f1a82a5c3123 to your computer and use it in GitHub Desktop.
Save mkurzeja/078ec50f315e3bd36be9f1a82a5c3123 to your computer and use it in GitHub Desktop.
Better Env handling in Symfony 3.2 and 3.3
<?php
// add this
(new \Symfony\Component\Dotenv\Dotenv())->load(__DIR__.'/../.env');
// before this line
$kernel = new AppKernel('dev', true);
parameters:
database_host: '%env(DB_HOST)%'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment