Re: [PHP] Re: class const versus define

2008-09-24 Thread Jochem Maas
Richard Lynch schreef: Richard Lynch schrieb: Is there any reason why the logic behind define() couldn't be pushed down to class const? Code like this is kinda fugly: //It's okay here, but not in a class? define('CACHE_DIR_LONG', CONFIG_ROOT_PATH . '/cache/'); class Cache { const CACHE_DIR

RE: [PHP] Re: class const versus define

2008-09-24 Thread Richard Lynch
24, 2008 11:14 AM To: Richard Lynch Cc: [EMAIL PROTECTED]; php-general@lists.php.net Subject: Re: [PHP] Re: class const versus define On Wed, Sep 24, 2008 at 7:35 AM, Richard Lynch <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>> wrote: I need the PATH to differ in development,

Re: [PHP] Re: class const versus define

2008-09-24 Thread Nathan Nobbe
On Wed, Sep 24, 2008 at 7:35 AM, Richard Lynch <[EMAIL PROTECTED]> wrote: > I need the PATH to differ in development, staging, and production due to > mixed environments. factory *cough* > Unfortunately, I CANNOT construct a class const "on the fly" from global > define'd constants and constan

RE: [PHP] Re: class const versus define

2008-09-24 Thread Richard Lynch
> Richard Lynch schrieb: > > Is there any reason why the logic behind define() couldn't be pushed > down to class const? > > > > Code like this is kinda fugly: > > > > //It's okay here, but not in a class? > > define('CACHE_DIR_LONG', CONFIG_ROOT_PATH . '/cache/'); > > class Cache { > > const CA

Re: [PHP] Re: class const versus define

2008-09-24 Thread Chris
the define function is to be used on the global scope of your application. This is helpful to assign Configurations Options and other data that you do not will move. For the Class Constants you define the Constant only fo the Class where you are working. Please read the documentation about th