Accessing development , testing sites using different DB in Zend framework
Hi Zend framework guys,
I have a question for you :
There is production , development , testing etc that we can set .
I assume we have 3 different db for t开发者_StackOverflow社区hese .
But I have a doubt how do we access the url for testers and developers ?
Do we need to pass as a GET value and set whether its development , or for testing ? Or is there any other way ?
http://localhost/ is the url and I am the developer who uses it, How do we give the url for testers ? I am not a server admin , so if you guys have some other techniques using the same code base ?
Or do I want to have 3 code base itself for testing , development , production etc . For production its OK :) , but just an example .
The question was asked by some of my friends when I introduced them #ZF , but I was not sure whether I am right when passing it as a GET value and setting it .
ie like site/?version=dev or something like that :) . If you have an answer I love to hear .
Edit :
I was looking for a way like @David Weinraub says "Are you saying you want to use a single virtual host, a single location, but be able to force the execution context into dev, testing, production mode? That's kind of unusual."
Answer by @Iznogood is also right . But I was looking for a way @David Weinraub says . So marking it as correct for its a kind of unusual.
Thank you guys for your helps.
Are you saying you want to use a single virtual host, a single location, but be able to force the execution context into dev, testing, production mode? That's kind of unusual.
If not, that is, if you will deploy dev, testing, production to different servers and (which strikes me as the more common arrangement), I agree with @izogood: Issue your SetEnv
directive either in .htaccess or upstream at the vhost level.
Since many of my projects don't have a formal "build process" - just a straight FTP upload, often to shared hosting; kind of basic, I know - I prefer to keep my .htaccess free of deployment-specific content. As a result, I tend to issue the SetEnv
directive at the vhost level on my local dev machine, and then let the APP_ENVIRONMENT
constant - defined in public/index.php
- default to 'production'
.
in your .htaccess if you use one thereshould be
SetEnv APPLICATION_ENV production
Wich is where you would switch between the different environment. So on your stagin server its
SetEnv APPLICATION_ENV staging
on your dev server
SetEnv APPLICATION_ENV development
etc... Assuming you setup your db in application.ini.
精彩评论