/* * Debuggable object, the base for all of our other objects. * * user-side $o->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)."