Hi,
I created a test case with the same pathern as modx calls the executeParse functions, but allas, it just works!
Lots of "hello worlds" printed.
So, somehow the problem isn’t about include’s either, though, it shows up under a certain (include) condition. I’m getting lost actually, it would be much better if I’d have access to the server, so there would be the possibility to get more information.
While I was looking at the code, I saw few stuff left there par my advice ;-)
Perhaps, it makes sense to remove it, or well, clear it up.
Performance is always an issue, and in the etomite days, a request was made to stress test the system.
So I did, and one thing which hurted performance were included files.
It turned out that having the code from an included file hardcoded in for example index.php (or everything in index.php for that matter) significantly reduced total time spent in php.
One such included file which was moved to index.php was the config.inc.php
I still see the option around in index.php to hardcode the configuration settings, but config.inc.php has more in there (the startCMSSession()) so it doesn’t make sense to predefine variables anymore in index.php, or move all code from config.inc.php into index.php ;-) (So you have to again specify the configuration by hand in index.php)
For that very reason, the log() function was also moved into index.php, which has now moved to document.parser.class.inc.php
Putting all code into one file speeds up page generation, but has one major drawback, it uses _much_ more memory for each instance!!
As long as your server has enough memory, no problem. But as soon as memory gets low, page generation time degrades enormously, due well, out of memory problems... (page swapping to hard disk, etc)
Of course, when you use a php accelerator, having a number of included files has much less impact then it will have _without_ an php accelrator, but it wouldn’t hurt to measure the tradeoff between page generation time and memory consumption by having rather large php files or splitting into more php files and include on demand (document.parser.class.inc.php is quite large!)
Oh, just thought about another thing.
These work both:
include_once $this->config["base_path"]."manager/includes/extenders/getuserdata.extender.php";
include_once "manager/includes/extenders/getuserdata.extender.php";
So, the current path is taken from index.php....
I wonder if it makes sense to use base_path configuration at all then?
Anyway, the cache files are included by the second way, so if the idea was to move everything to teh first way of doing includes, it has to be changed
Thanks for your time, and hopefully my include problems will vanish somehow!
Best wishes,
Remon