I haven't had those two files in over 2 years or so. Thanks for performance link as well, though require() is fastest, it does cause a white page when the file is missing, so it's not always the best to use (esp for cache file!) Also, there's the file() function, (and I think another similar one) where the contents to be read don't have to be a PHP file, so you're not parsing the file as PHP, you're just reading the contents and then can use explode() or some other function to turn the contents into an array or variable.qspypl wrote:performance of include, include_once, require, require_once:
http://blog.arh.cc/index.php?/archives/ ... n-PHP.html
found benchmark like this but not sure if its valuable, my question is this, if we should remove number of files in phpbb by remove'ing include'ing for example:
We can hardcore db/mysql4.php in include/db.php instead of include too if ofcourse it will give notice'able speed gain. I read somwhere, when you use'ing opcode cachce, then include'ing of files is used only when recompile.open file
index.php
find
include($phpbb_root_path . 'extension.inc');
replace it by
$phpEx = "php";
$starttime = 0;
delete file extension.inc
There are more too include files which can be removed, such as the template .cfg files. And regarding the whole template system, I've completely removed all logical management of templates, such as database tables/entries or those .cfg files. As far as my template engine is concerned, "Here is where my .tpl files are located!" and that's that. Some speed-up, plus critical errors (rare, yes, but still nice to have tpl) can now use the full template instead of a user-unfriendly white page. Requirement: must use only one template! Another nice thing is that since I removed all the user-facing graphics and other files from the tpl dir, I've chmod'ed the directory to disallow access, so only my template engine can get to the files. Later, they will be moved below the web dir.
Also, there's the file() function, (and I think another similar one) where the contents to be read don't have to be a PHP file, so you're not parsing the file as PHP, you're just reading the contents and then can use explode() or some other function to turn the contents into an array or variable.
Update on Multitable Post Distribution
Ok, I released an almost complete version of the doc a page or two back, and I started writing the working demo, which is a forum where you can post new topics/replies, and obviously it uses the methods discussed in the article. There's no authentication or template or any of that nonsense; just a bare-bones demonstration of the concept. It's about 70% complete, and is built and tested on MySQL 5.0.67 and PHP 5.2.4.
This is coming soon; hopefully next week!