i made a
apps/frontend/config/security.yml
dev:
default:
is_secure: false
prod:
default:
is_secure: true
but it is not working, am i missing something ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As steve says, is_secure can’t be configured on a per environment basis.
My guess is that you are trying to password protect your entire dev environment? I’d suggest that you use .htaccess/.htpasswd protection or equivalent to protect a site in this way.
If you can’t or for whatever reason want to do it in symfony, you could make symfony accept configuration in this way by creating a custom sfSecurityConfigHandler.class.php
Config handlers have a method in them called getConfiguration – this is in charge of getting the values set in the various yml files and creating an array of the final values after all over-rides etc have been applied.
sfSecurityConfigHander.class.php has a getConfiguration like this:
whilst a configuration that depends on environment, such as sfDatabaseConfigHandler.class.php has one like this:
The key difference here is the use of self::flattenConfigurationWithEnvironment over self::flattenConfiguration. I think if you extend sfSecurityConfigHandler with:
and then create a config_handlers.yml file in your config telling symfony to use this class:
You should then be able to use the yml as per the question to configure security per environment.