Page 1 of 1

general php question: include_once vs setting flags

Posted: Tue Oct 09, 2007 9:45 am
by gregfuller
Hi folks,

I've been enjoying s9y, looks like a solid product with great features.

I noticed that in several places the system sets a constant (like S9Y_FRAMEWORK) and checks it to make sure a program is included only once.

Would anyone be so kind as to explain why "include_once" is not used?

My PHP experience is very limited, so the above is a real question about coding and not an underhanded attempt to question anyone's coding practices. Just trying to learn.

Thanks a bunch! --Greg

Re: general php question: include_once vs setting flags

Posted: Tue Oct 09, 2007 10:40 am
by garvinhicking
Hi!

We tried to avoid include_once because some developer mentioned that using this would make Bytecode caches like APC work a bit slower.

Also, the Constants make it easier for plugins to check whether certain code includes are loaded for some probing routines.

In the end, however, it doesn't really matter and is just a simple preference of us developers. :)

HTH,
Garvin

Posted: Tue Oct 09, 2007 3:21 pm
by gregfuller
HTH? YID !

Makes total sense. Thanks !

-- Greg