. */ namespace GnuBoat; /** * @brief Base class to handle provides Services */ abstract class Service { function __construct($debug = 0) { $this->setDebug($debug); } public function setDebug($debug) { $this->_debug = $debug; } public function debug() { return $this->_debug; } public function processRequest($debug) { $this->setDebug($debug); $this->process(); } public static function error($message) { Service::output(["error" => 1, "errormessage" => $message]); } public static function output($content) { header('Content-Type: application/json'); echo json_encode($content); } /** * @brief Function used to process and generate the needed output */ abstract protected function process(); private $_debug; } ?>