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
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,
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
> 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
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
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 = '/dev/shm/cache/';
6 matches
Mail list logo