Tweak README to include new configuration details for Symfony 4, tweak variable name
This commit is contained in:
62
README.md
62
README.md
@@ -28,30 +28,40 @@ ensures that application behaviour will not be affected by stateful services.
|
|||||||
FriendsOfBehat\SymfonyExtension: ~
|
FriendsOfBehat\SymfonyExtension: ~
|
||||||
```
|
```
|
||||||
|
|
||||||
**Symfony 3 configuration**
|
|
||||||
|
|
||||||
```
|
|
||||||
FriendsOfBehat\SymfonyExtension:
|
|
||||||
kernel:
|
|
||||||
bootstrap: 'var/bootstrap.php.cache'
|
|
||||||
path: app/AppKernel.php
|
|
||||||
class: 'AppKernel'
|
|
||||||
env: test
|
|
||||||
debug: true
|
|
||||||
```
|
|
||||||
|
|
||||||
**Symfony 4 configuration**
|
|
||||||
|
|
||||||
```
|
|
||||||
FriendsOfBehat\SymfonyExtension:
|
|
||||||
# .env.dist file will be used if .env file does not exist
|
|
||||||
env_file: .env
|
|
||||||
kernel:
|
|
||||||
class: 'MyTrip\Kernel'
|
|
||||||
path: src/Kernel.php
|
|
||||||
debug: true
|
|
||||||
```
|
|
||||||
|
|
||||||
Symfony 4 does not have bootstrap file anymore and the environment is configured in the .env file.
|
|
||||||
|
|
||||||
3. Good luck & have fun!
|
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:
|
||||||
|
kernel:
|
||||||
|
bootstrap: 'app/autoload.php' # you may want to use var/bootstrap.php.cache instead
|
||||||
|
path: app/AppKernel.php
|
||||||
|
class: 'AppKernel'
|
||||||
|
env: test
|
||||||
|
debug: true
|
||||||
|
```
|
||||||
|
|
||||||
|
**Default Symfony 4 configuration**
|
||||||
|
|
||||||
|
```
|
||||||
|
FriendsOfBehat\SymfonyExtension:
|
||||||
|
# .env.dist file will be used if .env file does not exist
|
||||||
|
env_file: .env
|
||||||
|
kernel:
|
||||||
|
bootstrap: ~
|
||||||
|
path: src/Kernel.php
|
||||||
|
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 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.
|
||||||
|
|
||||||
|
Of course, you can always change each of those settings.
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user