Skip to content
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

[HttpKernel] Added 'isDevEnvironment' method to Kernel class #15374

Closed
wants to merge 1 commit into from
Closed

[HttpKernel] Added 'isDevEnvironment' method to Kernel class #15374

wants to merge 1 commit into from

Conversation

aurimasniekis
Copy link
Contributor

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

I have worked with many symfony based projects which uses different/multiple environments and I hate when people are checking if current environment is dev by using statement like this:
->getEnvironment() === 'dev'
which breaks all other environment namings. By providing a kernel method which will tell you if you are in dev environment will help people like me to extend it for own project environment naming strategy.

Please support this common convention for detecting dev environment. This will help to stop hacking things.

@fabpot
Copy link
Member

fabpot commented Jul 27, 2015

👎 from me: Symfony does not care about the environment names. dev and prod just happen to be convention used by Symfony Standard Edition.

@aurimasniekis
Copy link
Contributor Author

I agree but the people who writes libraries/bundles uses it to detect dev without any way to change it to something else...

@fabpot
Copy link
Member

fabpot commented Jul 27, 2015

You should not check that. Most of the time, you are checking is the debug mode is enabled.

@aurimasniekis
Copy link
Contributor Author

That would be really cool if everybody would use isDebug instead getEnvironment() === 'dev'

@aurimasniekis aurimasniekis deleted the feature_isDevEnvironment branch July 27, 2015 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants