Kohana 3 includes environment constants, specifically PRODUCTION, STAGING, TESTING & DEVELOPMENT (discussion here).
It's been suggested that you set those constants using SetEnv in your .htaccess file (discussion here).
For Example:
PRODUCTION .htaccess:
SetEnv KOHANA_ENV PRODUCTION
SetEnv BASE_URL http://www.domain.com
DEVELOPMENT .htaccess:
SetEnv KOHANA_ENV DEVELOPMENT
SetEnv BASE_URL http://127.0.0.1/domain/
I've been looking for ways to manage the different version of the .htaccess file in Git. I looked at branching, but VonC submitted a great answer, suggesting it might not be the best approach.
VonC further suggested .gitattributes filter driver as a solution (Pro Git explanation).
I like the idea of using the .gitattributes filter driver, but I've struggled to find "how to" examples that I can understand (the Pro Git examples were a little above me).
I'm using PHPFog to deploy. They require you to do clone and push to deploy your application.
So here are my questions:
- Is this the right approach for setting environment variables in Kohana?
- Can I use the .gitattributes filter driver with PHPFog?
- How do I create the filter to add the environment variables to the .htaccess file?