Search found 4 matches

by jakobgt
Sat Jan 07, 2012 4:54 pm
Forum: General Development Discussion
Topic: Why is include favored over include_once?
Replies: 12
Views: 16215

Re: Why is include favored over include_once?

We can change unguarded includes to guarded includes in phpBB 3.0.x if absolutely necessary. In 3.1.x we have autoloading anyway, so new code will probably be autoloaded instead of manually loaded. Nice, but isn't __autoload a problem both for performance* and interoperability** reasons? *: some ye...
by jakobgt
Fri Jan 06, 2012 9:26 pm
Forum: General Development Discussion
Topic: Why is include favored over include_once?
Replies: 12
Views: 16215

Re: Why is include favored over include_once?

And until that, if you need to use a function in an include file that is included (unguarded in the core) after you need it, I guess you could submit a bug report asking the include to be changed to a guarded included for that reason. Okay, no worries. I'll just submit a bug report about it. I'll s...
by jakobgt
Fri Jan 06, 2012 7:51 pm
Forum: General Development Discussion
Topic: Why is include favored over include_once?
Replies: 12
Views: 16215

Re: Why is include favored over include_once?

Thanks for the quick reply! IIRC, include_once() creates unnecessary overhead that can be avoided by instead using something like: if (!function_exists('some_fairly_common_function')) {     include('path/to/file'); }  I agree that using include_once (and require_once) induces a speed penalty over th...
by jakobgt
Thu Jan 05, 2012 10:13 pm
Forum: General Development Discussion
Topic: Why is include favored over include_once?
Replies: 12
Views: 16215

Why is include favored over include_once?

Hi PHPBB! First thanks for doing a great job on making an awesome piece of software. I'm in the process of integrating authentication from a web site into PHPBB3 and during this process I have read quite a few lines of the PHP code. One thing that struck me is that include(…) are preferred over incl...