-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DependencyInjection] Added option ignore_errors: not_found
for imported config files
#31310
[DependencyInjection] Added option ignore_errors: not_found
for imported config files
#31310
Conversation
3d94650
to
5ab59f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanks for the PR, it looks like a good idea to me.
About the implementation, I made my review into a patch, see pulzarraider#1
ignore_not_found
for imported config filesignore_not_found
for imported config files
ignore_not_found
for imported config filesignore_not_found
for imported config files
c7916cf
to
9c7fc7b
Compare
src/Symfony/Component/Routing/Loader/Configurator/RoutingConfigurator.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/DependencyInjection/Loader/Configurator/ContainerConfigurator.php
Outdated
Show resolved
Hide resolved
6632ba8
to
8ecb133
Compare
8ecb133
to
ecc0e7e
Compare
ignore_not_found
for imported config filesignore_not_found
for imported config files
Thank you @nicolas-grekas, I've merged your MR and did some more small improvements. |
@pulzarraider If I am correct, this must now go into I already did this for the corresponding Docs-PR symfony/symfony-docs#11647 |
dee7d76
to
cddf68c
Compare
I think this feature is finished. @nicolas-grekas @stof @sstok please review it again. |
ignore_not_found
for imported config filesignore_errors: not_found
for imported config files
18c039e
to
419a9b5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've rebased the PR and changed the logic to make it local to the DI component only.
(fabbot failure is unrelated - patch to be applied globally starting from 3.4)
…mporting config files
419a9b5
to
e0ee01c
Compare
Thank you @nicolas-grekas for your changes. |
Thank you @pulzarraider. |
…_found` for imported config files (pulzarraider) This PR was merged into the 4.4 branch. Discussion ---------- [DependencyInjection] Added option `ignore_errors: not_found` for imported config files | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | symfony/symfony-docs#11647 If someone want to add optional config file. The only available choice was to add `ignore_errors: true` option e.g. ``` imports: - { resource: parameters.yml, ignore_errors: true } ``` But this will hide all errors in imported file. We ran in many situations that broke our Symfony applications because we had a typo in this imported files. This PR introduce new possible value `not_found` for `ignore_errors` option. It can be used for optional config files like the `ignore_errors: true`, but it will ignore only the file non-existence, not the possible syntax errors inside. Usage: ``` imports: - { resource: parameters.yml, ignore_errors: not_found} ``` Commits ------- e0ee01c [DependencyInjection] Added option `ignore_errors: not_found` while importing config files
…_found` for imported config files (pulzarraider) This PR was merged into the 4.4 branch. Discussion ---------- [DependencyInjection] Added option `ignore_errors: not_found` for imported config files <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Related merge request: symfony/symfony#31310 Commits ------- 0a6873d [Configuration] Add documentation about `ignore_errors: not_found` option.
If someone want to add optional config file. The only available choice was to add
ignore_errors: true
optione.g.
But this will hide all errors in imported file. We ran in many situations that broke our Symfony applications because we had a typo in this imported files.
This PR introduce new possible value
not_found
forignore_errors
option. It can be used for optional config files like theignore_errors: true
, but it will ignore only the file non-existence, not the possible syntax errors inside.Usage: