Garbage collection shouldn't be that frequent. Not that it should make any difference.
Mind you, I also don't see why we shouldn't just move the loading and initial getInstance() calls from loadDatabase and stuff them directly in index.php and SSI.php...
Posted: November 9th, 2012, 10:38 PM
OK, so I'm seeing it too though not on local :/
Seriously, try moving the loading of Class-DB out of Load.php and into index.php and SSI.php, just in case it's something really banal like scoping.
Nope... Didn't work a bit. Reproduced the bug, moved loadDatabase() to index.php, even manually added the wesql::getInstance() before loadDatabase(), and it STILL gave me the same error. And it's always caused by Load.php::sessionWrite(). It doesn't seem to remember the wesql class at all... Although it DOES remember $user_info and other globals. That's quite odd.
There may be a hint though: it looks like sometimes, the sessionWrite function is executed twice at the end of the flow... (?)
And it only generates the error on the second call.
But sometimes it's also only executed once, and then generates the error.
Posted: November 10th, 2012, 03:58 PM
Forget what I said, it's never executed twice...
So, I did a get_declared_classes() when $user_info['is_admin'] is on.
Normal execution:
...
[103] => wetemItem
[104] => wetem
[105] => wesql
[106] => westr_foundation
[107] => westr_entity
[108] => westr_mb
[109] => westr
Failed execution:
...
[103] => westr_entity
[104] => westr_mb
[105] => westr
So... It's interesting that both wetem and wesql are seen 'differently' and don't always remain in scope while westr is always seen.
Any clues, Pete...?
Also, very very oddly, it seems like IE9 NEVER shows me the error... (Which is why I thought it couldn't be reproduced.) Chrome does.
Posted: November 10th, 2012, 04:05 PM
Meh... I really don't see any differences between how westr and wesql are declared.
I've removed a couple of globals that are declared but never used in __construct and getInstance, but I don't think it's got anything to do with it eh...
- I don't think APC is installed or at least enabled. It doesn't show up in the phpinfo stuff.
- Hmm yeah, westr_foundation doesn't show up when the error happens, it's not that I forgot to paste it or anything. (The 102 first entries are regular PHP classes.)
Posted: November 10th, 2012, 06:03 PM
Could the main difference between westr_foundation and wesql/wetem be that it doesn't have a __construct() magic function..?
I don't know.
It's indeed quite odd that westr_foundation itself isn't registered, but its descendants are... :-/
Still, it's a server-related problem, I'm pretty sure. Must be somethin' with the PHP version... I don't know.