Re: [SMARTY-DEV] Question regarding constants

[email protected] (Robert Amos)
Newsgroups php.smarty.dev
Message-ID <[email protected]>
> Thanks. I am not tampering with them. I only questioned why there are
> not checked to be have been already defined before defining them. You
> have one of them that has a check at the top, but the next 4 are not.
> 
> So, was curious. I already added a check like this in place on my local
> copy but this app runs on a few machines and until I get a chance to
> work on the code that calls smarty again, was wondering if possible to
> add these checks to future versions. ;-)
> 
> Would it affect the load time of a smarty object/file?

Theres no need really, if you use require_once() they'll never get
called again. Like boots says its strange that the Smarty class
redefinition doesnt bring up an error, because it should be impossible
to include the file more than once anyway.

The reason the check is on the first one is so that you can specify a
SMARTY_DIR _before_ you load the smarty class, and I'm pretty sure I'm
not the only person who uses this behaviour.

-bok
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.