hello, thanx for help.
let's say that I have a class called Builder that builds web pages from a configuration file. The code is something like this:
class Builder {
function Builder($smap) {
$this->_doLog = false;
$this->_dbg = Debugger::getDebugger(DBG_STR);
set_error_handler($this->_dbg->getDebugHandler());
register_shutdown_function(array(& $this, '_endScript'));
// ...
}
// ...
function printDoc($err = false) {
if($err !== false) {
// print err doc and exit
} else {
print $this->doc(); // a generated document
$this->_doLog = true;
exit;
}
}
// ...
function _endScript() {
if($this->_dbg->hasErrors()) {
$this->_dbg->flushBuffer();
}
if($this->_logger !== null && $this->_doLog) {
$this->_logger->log();
}
}
}
This class is the basic class for the whole site.
If I call any page, by the time the function exits and calls the endScript function the page access never gets logged because the doLog variable is false even if no errors occurred and the printDoc() function set it to true just before calling the end of the script.
Now it get's event more strange, because if I comment the register_shutdown() function, and call the endScript() after printing the document the doLog variable has the propper value.
The thing is that on every class weird stuff like this is happening, forms don't get any post or get values, assigned variables default to initial settings, and on and on and on...in all documents, regardless of the way I exit the script!!!
I don't really if explained my self very well, but thanks for your support,