On 3 Feb 2009, at 05:14, Rolando Espinoza La Fuente wrote:

On Mon, Feb 2, 2009 at 11:59 PM, howard chen <[email protected]> wrote:
Hello,

1. The tutorial encourage the use of "APPLICATION_ENVIRONMENT", but
where should I define this variable? in index.php or bootstrap.php?

Afaik, bootstrap.php use a conditional define:

defined('APPLICATION_ENVIRONMENT') or define(...) // define to default env

in index.php, usually doesn't define any envinroment. But an use case
could be creating a dev.php that defines app env to 'development'
and index.php defines app env to 'production'.

You can search for some zend projects out there to see how they use
the bootstrap file. (e.g.: bugapp, pastebin, jotbug, etc)


There are many many ways ;)

Personally, I use an environment variable set in the httpd.conf file using the SetEnv Apache statement and then use getenv() to collect it in the PHP. I then fall back to a define if an environment variable can't be found.

Regards,

Rob...

Reply via email to