Tweak README to include new configuration details for Symfony 4, tweak variable name

This commit is contained in:
Adrian Zmenda
2018-03-18 17:27:11 +01:00
parent 09c6530115
commit 141074a24e
2 changed files with 38 additions and 28 deletions

View File

@@ -28,30 +28,40 @@ ensures that application behaviour will not be affected by stateful services.
FriendsOfBehat\SymfonyExtension: ~ FriendsOfBehat\SymfonyExtension: ~
``` ```
**Symfony 3 configuration** 3. Good luck & have fun!
## Configuration
SymfonyExtension provides kind of autoconfiguration feature.
When none explicit configuration is set, we will set for You sane default that will get you running fast.
**Default Symfony 3 configuration**
``` ```
FriendsOfBehat\SymfonyExtension: FriendsOfBehat\SymfonyExtension:
kernel: kernel:
bootstrap: 'var/bootstrap.php.cache' bootstrap: 'app/autoload.php' # you may want to use var/bootstrap.php.cache instead
path: app/AppKernel.php path: app/AppKernel.php
class: 'AppKernel' class: 'AppKernel'
env: test env: test
debug: true debug: true
``` ```
**Symfony 4 configuration** **Default Symfony 4 configuration**
``` ```
FriendsOfBehat\SymfonyExtension: FriendsOfBehat\SymfonyExtension:
# .env.dist file will be used if .env file does not exist # .env.dist file will be used if .env file does not exist
env_file: .env env_file: .env
kernel: kernel:
class: 'MyTrip\Kernel' bootstrap: ~
path: src/Kernel.php path: src/Kernel.php
debug: true class: 'App\Kernel'
env: test # When explicitly set, will override APP_ENV loaded from env_file file
debug: true # When explicitly set, will override APP_DEBUG loaded from env_file file
``` ```
Symfony 4 does not have bootstrap file anymore and the environment is configured in the .env file. Symfony 4 is detected, based on the existence of `src/Kernel.php` file, so if you did not migrate to new Symfony structure yet; you need to set those values yourself.
3. Good luck & have fun! Of course, you can always change each of those settings.

View File

@@ -169,8 +169,8 @@ final class SymfonyExtension implements Extension
$defaults = self::SYMFONY_DEFAULTS; $defaults = self::SYMFONY_DEFAULTS;
$symfonyFlexKernelPath = sprintf('%s/%s', $container->getParameter('paths.base'), self::SYMFONY_4_DEFAULTS['kernel']['path']); $symfony4KernelPath = sprintf('%s/%s', $container->getParameter('paths.base'), self::SYMFONY_4_DEFAULTS['kernel']['path']);
if (file_exists($symfonyFlexKernelPath)) { if (file_exists($symfony4KernelPath)) {
$defaults = self::SYMFONY_4_DEFAULTS; $defaults = self::SYMFONY_4_DEFAULTS;
} }