Issue 1:
➜ src git clone git://github.com/symfony/symfony.git
Cloning into 'symfony'...
remote: Counting objects: 144068, done.
remote: Compressing objects: 100% (44515/44515), done.
remote: Total 144068 (delta 91155), reused 135518 (delta 83912)
Receiving objects: 100% (144068/144068), 22.84 MiB | 837 KiB/s, done.
Resolving deltas: 100% (91155/91155), done.

➜ src cd symfony

➜ symfony git:(master) composer install
Installing dependencies
- Installing doctrine/common (2.3.x-dev)
Cloning 605b1b8b5a7bc8daf9111fb35483e5708e30de35

- Installing twig/twig (dev-master)
Cloning 459720ff3b74ee0c0d159277c6f2f5df89d8a4f6

Writing lock file
Generating autoload files

➜ symfony git:(master) phpunit

Warning: require_once(/usr/local/src/symfony/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php): failed to open stream: No such file or directory in /usr/local/src/symfony/vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationRegistry.php on line 59

Call Stack:
0.0002 274896 1. {main}() /usr/local/src/phpunit/phpunit.php:0
0.0254 2845976 2. PHPUnit_TextUI_Command::main() /usr/local/src/phpunit/phpunit.php:46
0.0254 2846568 3. PHPUnit_TextUI_Command->run() /usr/local/src/phpunit/PHPUnit/TextUI/Command.php:130
0.0254 2847120 4. PHPUnit_TextUI_Command->handleArguments() /usr/local/src/phpunit/PHPUnit/TextUI/Command.php:139
0.0312 3242512 5. PHPUnit_TextUI_Command->handleBootstrap() /usr/local/src/phpunit/PHPUnit/TextUI/Command.php:615
0.0314 3252840 6. PHPUnit_Util_Fileloader::checkAndLoad() /usr/local/src/phpunit/PHPUnit/TextUI/Command.php:787
0.0314 3253224 7. PHPUnit_Util_Fileloader::load() /usr/local/src/phpunit/PHPUnit/Util/Fileloader.php:77
0.0315 3260656 8. include_once('/usr/local/src/symfony/autoload.php.dist') /usr/local/src/phpunit/PHPUnit/Util/Fileloader.php:93
0.0330 3385496 9. Doctrine\Common\Annotations\AnnotationRegistry::registerFile() /usr/local/src/symfony/autoload.php.dist:17

Issue 2:
Q
A

Bug report?
no

Feature request?
no

BC Break report?
no

RFC?
no

Symfony version
4.0.8

Hi,

I'd like to jump on the Symfony 4 bandwagon but I'm usure how a Command can use env vars when it's part of a website project.

The symfony documentation recommends to define the necessary env vars in the web server. In my case, that would be in the virtual host configuration file for apache2. So far,

For example, let's say i define a DATABASE_URL var that is used by Doctrine to connect to my database. This works fine for my app when I access the website.

Let's say I need a Command to be executed periodically (using cron the server) to compute and save some new data, based on the data currently stored in the database. My Command would need to access the database but it won't be launched from the web server, so the virtual host config file won't set the environment variables.

I could put everything I need in an .env file, install symfony/dotenv in prod but :

that would go against the good practice recommended by Symfony :

In production, it is recommended to configure the environment variables in your web server configuration.

https://symfony.com/doc/current/configuration/environments.html#executing-an-application-in-different-environments

I would have duplicated the same content across 2 files, which is a pain to maintain

Is there a way to keep within the best practices and not duplicate my config ?