|
23 | 23 | */ |
24 | 24 | final class DefaultConfiguration extends AbstractConfiguration |
25 | 25 | { |
26 | | - // properties are defined as private so the developer don't see them when using |
| 26 | + // variables starting with an underscore are for internal use only |
| 27 | + private $_symfonyEnvironmentEnvVarName; // SYMFONY_ENV or APP_ENV |
| 28 | + |
| 29 | + // properties are defined as private so the developer doesn't see them when using |
27 | 30 | // their IDE autocompletion. To simplify things, the builder defines setter |
28 | 31 | // methods named the same as each option. |
29 | 32 | private $symfonyEnvironment = 'prod'; |
@@ -364,19 +367,22 @@ protected function getReservedServerProperties(): array |
364 | 367 | private function setDefaultConfiguration(int $symfonyMajorVersion, $symfonyMinorVersion): void |
365 | 368 | { |
366 | 369 | if (2 === $symfonyMajorVersion) { |
| 370 | + $this->_symfonyEnvironmentEnvVarName = 'SYMFONY_ENV'; |
367 | 371 | $this->setDirs('app', 'app/config', 'app/cache', 'app/logs', 'src', 'app/Resources/views', 'web'); |
368 | 372 | $this->controllersToRemove(['web/app_*.php']); |
369 | 373 | $this->sharedFiles = ['app/config/parameters.yml']; |
370 | 374 | $this->sharedDirs = ['app/logs']; |
371 | 375 | $this->writableDirs = ['app/cache/', 'app/logs/']; |
372 | 376 | $this->dumpAsseticAssets = true; |
373 | 377 | } elseif (3 === $symfonyMajorVersion && 4 < $symfonyMinorVersion) { |
| 378 | + $this->_symfonyEnvironmentEnvVarName = 'SYMFONY_ENV'; |
374 | 379 | $this->setDirs('bin', 'app/config', 'var/cache', 'var/logs', 'src', 'app/Resources/views', 'web'); |
375 | 380 | $this->controllersToRemove(['web/app_*.php']); |
376 | 381 | $this->sharedFiles = ['app/config/parameters.yml']; |
377 | 382 | $this->sharedDirs = ['var/logs']; |
378 | 383 | $this->writableDirs = ['var/cache/', 'var/logs/']; |
379 | 384 | } elseif (4 === $symfonyMajorVersion || (3 === $symfonyMajorVersion && 4 >= $symfonyMinorVersion)) { |
| 385 | + $this->_symfonyEnvironmentEnvVarName = 'APP_ENV'; |
380 | 386 | $this->setDirs('bin', 'config', 'var/cache', 'var/log', 'src', 'templates', 'public'); |
381 | 387 | $this->controllersToRemove([]); |
382 | 388 | $this->sharedDirs = ['var/log']; |
|
0 commit comments