views:

44

answers:

3

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 these .

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 .

Thanks

Hari K T

A: 

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.

Iznogood
Thanks @Iznogood . But I was not asking how to set environment variables.The case is like what @David says in his first para. So I have already set different DB in application.ini . Now I want to access the single code base for two guys. One for tester and one for developers . So something like index_dev.php , index_test.php , index.php :) .So everything is set on the index_Xxx what ever environment it is .
Hari K T
A: 

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'.

David Weinraub
A: 

@Iznogood I was not talking about setting as you told in the htaccess and all :) .

I was asking whether I can give the same url for developers and testers , like @David says . ie Single host with different DB . Is that possible ?

According to what I remember symfony has front_dev.php and developement.php ( something like that , not correct ) . So can we make something like that ?

I mean replicating the index.php to index_dev.php , index_test.php and set the environment variables in the index file ?

If so the issue is we need to point to index_dev.php on every request like index_dev.php/module/controller/action/key/values else it may be looking index.php itself right ?

Anyway I want to try these, so I don't want to copy the codes for testing and development :) . I can make use of the same code and it will not break backward compatibility as we start using TDD development :) .

Thanks for your replies

Hari K T
@HariKT: These should probably be moved from an Answer to Comments on the individual responses. Then delete this answer. We can continue the discussion under those comments. In general, your setup is a bit unusual. But it sounds like you could hack something into your public/index.php that checks a query string param, as you originally suggested.
David Weinraub
@David the problem here is I replied from another yahoo mail id which I have not created an account . I tried to associate it with my account now . But seems a failure . Sorry for this :(
Hari K T