Skip to content

Commit

Permalink
Adding <stubs> for env() and param() (#297)
Browse files Browse the repository at this point in the history
Info is taken from #292 (comment)
  • Loading branch information
ThomasLandauer authored and seferov committed Dec 23, 2022
1 parent 88d6324 commit 53ec806
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ This file path may change based on your Symfony version, file structure and envi
Default files are:
- Symfony 3: `var/cache/dev/srcDevDebugProjectContainer.xml`
- Symfony 4: `var/cache/dev/srcApp_KernelDevDebugContainer.xml`
- Symfony 5: `var/cache/dev/App_KernelDevDebugContainer.xml`
- Symfony 5+: `var/cache/dev/App_KernelDevDebugContainer.xml`

Multiple container files can be configured. In this case, the first valid file is taken into account.
If none of the given files is valid, a configuration exception is thrown.
Expand All @@ -80,6 +80,14 @@ If you're using PHP config files for Symfony 5.3+, you also need this for auto-l
</extraFiles>
```

If you're using Symfony's `env()` or `param()` functions in your PHP config files, you also need this for auto-loading them:

```xml
<stubs>
<file name="vendor/symfony/dependency-injection/Loader/Configurator/ContainerConfigurator.php" />
</stubs>
```

If you're getting the following error

> MissingFile - config/preload.php - Cannot find file ...var/cache/prod/App_KernelProdContainer.preload.php to include
Expand Down

0 comments on commit 53ec806

Please sign in to comment.