Re: Re: class const versus define

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 24, 2008 at 7:35 AM, Richard Lynch <rlynch@xxxxxxxxx> 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 constant strings.


no, but you could select a class on the fly from globally defined constants.

So, in fact, I'd LIKE to use the class const properly for what it is mean
> for, but cannot do that because its value depends upon the environment.


i tend to agree w/ Jocheem here, if the value is something that will vary,
perhaps it is best implemented as an instance variable rather than a
constant.  a factory method which took $path, or $env (something like that)
could easily select an appropriate concrete class to instantiate.

-nathan

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux