Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Symfony] Try to get env parameter from container before throwing an exception #587

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

Closed
wants to merge 1 commit into from

Conversation

Steveb-p
Copy link
Contributor

In regard to an issue raised on gitter.

image

@makasim
Copy link
Member

makasim commented Oct 26, 2018

The issue was properly fixed in 0.9 version. Unfortunately, it is not possible to fix it in 0.8 version.
There is another attempt to do it #533

@@ -161,7 +162,11 @@ private function resolveDSN(ContainerBuilder $container, $dsn)
$matches = [];
if (preg_match('/%env\((.*?)\)/', $dsn, $matches)) {
if (false === $realDsn = getenv($matches[1])) {
throw new \LogicException(sprintf('The env "%s" var is not defined', $matches[1]));
try {
$realDsn = $container->getParameter($matches[1]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't it be $dsn instead of $matches[1]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Steveb-p ping ^^

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take a look at it tonight :)

@makasim
Copy link
Member

makasim commented Nov 15, 2018

@Steveb-p is there any news?

@makasim
Copy link
Member

makasim commented Nov 16, 2018

The issue is properly fixed in 0.9 version which is soon to be released.

@makasim makasim closed this Nov 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants