Hi Christian,

https://github.com/markizano/markizano/blob/master/application/setup.php
https://github.com/markizano/markizano/blob/master/htdocs/.htaccess

I use a combination of .htaccess and $_ENV for setting up the application
environment.
You can create a bash wrapper (ENVIRONMENT="staging"), or create something
like cli.php in the webroot, (checking to make sure PHP_SAPI == 'cli' before
doing anything). The wrapper could setup the application environment for CLI
scripts and .htaccess would assign an environment variable that can be used
for the web.

For a more centralized approach, you can set the $_ENV var in the apache
config for that virtualhost (or any vhosts to which this may apply) and it
will be effective on a server level instead of maintaining the environment
in a .htaccess.
The same can be done for /etc/environment (linux) or sysdm.cpl (windows).

Hope this helps,
//-----
Mark Harris
Information Security
[email protected]
http://markizano.net/

On Wed, Jun 8, 2011 at 9:12 AM, Cristian Bichis <[email protected]> wrote:

> Hello,
>
> I am interested how you guys are setting the APPLICATION_ENV for staging.
>
> For httpd is easy to set APPLICATION_ENV in vhost. For CLI can be used OS
> environment variable.
>
> But for cli scripts is much harder, especially if the same machine is going
> to be used for multiple projects, some running production and running
> staging at same time... How you guys are setting APPLICATION_ENV for this
> cases ?
>
> Cristian
>
> --
> List: [email protected]
> Info: http://framework.zend.com/archives
> Unsubscribe: [email protected]
>
>
>

Reply via email to