Question regarding constants
[email protected] (Robby Russell)
| Newsgroups | php.smarty.dev |
|---|---|
| Organization | PLANET ARGON |
| Message-ID | <1093989425.4549.46.camel@vacant> |
At the top of Smarty.class.php you set a few constants.
Well, I have an app that now calls Smarty once typically, but there is a
scenario where it calls another instance of Smarty within a function
that might take a bit of work to get the code built to pass the object
into this other process.
We were getting an error with the constants being redefined and I
changed them to:
> if (!defined('SMARTY_DIR')) {
> define('SMARTY_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR);
> }
>
> if (!defined('SMARTY_PHP_PASSTHRU')) {
> define('SMARTY_PHP_PASSTHRU', 0);
> }
>
> if (!defined('SMARTY_PHP_QUOTE')) {
> define('SMARTY_PHP_QUOTE', 1);
> }
>
> if (!defined('SMARTY_PHP_REMOVE')) {
> define('SMARTY_PHP_REMOVE', 2);
> }
>
> if (!defined('SMARTY_PHP_ALLOW')) {
> define('SMARTY_PHP_ALLOW', 3);
> }
to get around this. Is there any reason why we wouldn't just have the constants set to have these checks on them regardless in the default Smarty package?
Just seems like we should typically check if something exists (function, class, constant, etc) prior to setting them.
just a curious geek,
-Robby
--
/***************************************
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON | www.planetargon.com
* Portland, OR | [email protected]
* 503.351.4730 | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
****************************************/
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQBBNPQx0QaQZBaqXgwRAmc8AJ4+5xy6AYmPGSBeok+4r51dRxIEjwCgj5lJ +HICE6mEruDfBRRxabFhrHQ= =zA1I -----END PGP SIGNATURE-----