views:

27

answers:

2

In which file should I define application-wide constants that are specific to my cakephp app?

+4  A: 

I define them in app/config/bootstrap.php

Travis Leleu
Thanks.. the book says "This file is ideal for a number of common bootstrapping tasks... (including) registering global constants" so I guess this is the place!
Tomba
As a side note, it doesn't have to just be constants. For example, I use a dev/staging server, and so don't always want to trigger emails on certain actions. Frequently I'll write a var in the bootstrap file that I use to switch on/off features throughout the app.
Travis Leleu
A: 

@travis:

i think its better to use the configs file (and configure class) for such dev/staging stuff

the bootstrap is more like the "general" more hardcoded stuff - all app configs together the configs are the "variant" config arrays.

just my 5 cents.

mark