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...