Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[HttpKernel] added check of default extension alias convention
- Loading branch information
1 parent
7dfe286
commit 97f66e9
Showing
1 changed file
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97f66e9
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.
@kriswallsmith why does Symfony enforce that the extension's alias matches the result of
Container::underscore
? We would like to to override this alias, but theLogicException
prevents us from doing so. Which parts of Symfony rely on the alias being exactly the same as the underscored version of our bundle name?I have discovered that I can work around the exception by overriding
Bundle::getContainerExtension()
, but I obviously want to be sure that this doesn't introduce any unexpected side-effects.In my case, our bundle name (
ODMediaFooBundle
) results in the aliasod_media_foo
, and we would like to change that toodmedia_foo
, removing the underscore between 'od' and 'media'.97f66e9
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.
@jrobeson thanks. I was hoping that Kris would get the message since I tagged him. Are you sure that overriding
Bundle::getContainerExtension()
doesn't introduce unwanted side-effects?97f66e9
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 cannot find it anywhere in the documentation, though... nor can I find a reason why the naming convention is being enforced in this way. But I'll just try it, and see if I'm getting any problems with it.
97f66e9
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.
Thanks! Are you referring to this pull request?
97f66e9
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 also personally have always wondered why we enforced this so rigidly :). Obviously, @nicwortel you have a workaround, but this also don't know the answer to the "why" here.
97f66e9
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.
Let's find out why: #11684