setDebugging(true/false); * * subclasser-side: $o->debug($msg) and $o->error($msg); * */ class DebuggableObject { function DebuggableObject() { $this->debugging = false; } function setDebug($state) { $this->setDebugging($state); } function setDebugging($state) { $this->debugging = $state; } function inspect($val) { echo "
";
			print_r($val);
			echo "
"; } function debug($msg) { if ($this->debugging) { echo htmlspecialchars($msg)."
\n"; flush(); for ($i = 0; $i < 2048; $i++) echo "\n"; flush(); // $class = get_class($this); // $f = @fopen("/tmp/debug-log.txt", "a"); // @fwrite($f, "DEBUG ($class): $msg
\n"); // @fclose($f); } } function error($msg, $func = false, $line = false, $file = false, $extra_body = false) { error_die($msg, $func, $line, $file, $extra_body); } } ?>