Re: question about defining constants and pear coding standards
| From: | Pierre | Date: | Sat, 23 Sep 2006 16:37:04 +0000 |
| Subject: | Re: question about defining constants and pear coding standards | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-44014@lists.php.net to get a copy of this message | ||
On Sat, 23 Sep 2006 10:18:33 -0500
terrafrost@gmail.com (Terra Frost) wrote:
> <?
> define('SOME_OBJECT_MODE',SOME_OBJECT_PHP);
>
> $a = new Some_Object();
>
> echo $a->toString();
> ?>
>
> If SOME_OBJECT_MODE wasn't specified, a default mode could be used,
> by (in Some_Object.php) doing something like...
>
> if ( !defined('SOME_OBJECT_MODE') ) {
> define('SOME_OBJECT_MODE',SOME_OBJECT_PHP);
> }
>
> Anyway, the only thing I'm wondering is... would this be okay, per
> the Pear coding standards?
It is. I would name the constant SOME_OBJECT_DEFAULT_MODE though.
--Pierre