public function handleErrors($enabled) { if ($enabled) { set_error_handler(array($this, 'handleError')); set_exception_handler(array($this, 'handleException')); } else { restore_error_handler(); restore_exception_handler(); } }