0
votes

I've got a Symfony 1.4 project I'm developing on locally. I also have a live production copy of the code and database, and another copy of the code and database running on the same server for testing new features. I want to keep the same local copy of the code and be able to push code to the live server to either environment.

So I've done this by setting up a new frontend controller called "frontend_test.php". This sets the "test" environment, and I've made this the default entry point for this test environment. My production environment uses the default "index.php" entry point, so I can have the exact same code base for both (pushed at different times depending on completeness of new code) and control access to each using Apache config.

I have set the environment in "frontend_test.php" to "test". I would expect therefore that it would use the "test" configuration in the databases.yml file, but it's not. For some reason, it continues to use the "prod" database configuration. I cannot work out why!

Can anyone explain this?

1
I realised what the issue was. "frontend.php" was actually being called - it was an issue with .htaccess overriding Apache site setup. So not Symfony at all.user700774

1 Answers

0
votes

Test environment is only for automatic testing! So you don't have to create frontend_test.php because it's useless.

Source: http://symfony.com/legacy/doc/getting-started/1_4/en/06-Environments