source: src/webapp/webservice/inc/GnuBoat/Service.php@ 89c510f

0.5 debian/bullseye debian/jessie
Last change on this file since 89c510f was 008bce9, checked in by Joachim Langenbach <joachim.langenbach@…>, 9 years ago

First more or less working version of visualising logfiles on the map

  • Property mode set to 100644
File size: 1.5 KB
RevLine 
[c455d7b]1<?php
2/*
3 Copyright (C) 2017 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19namespace GnuBoat;
20
21/**
22 * @brief Base class to handle provides Services
23 */
24abstract class Service
25{
26 function __construct($debug = 0)
27 {
28 $this->setDebug($debug);
29 }
30
31 public function setDebug($debug)
32 {
33 $this->_debug = $debug;
34 }
35
36 public function debug()
37 {
38 return $this->_debug;
39 }
40
[1ba85cf]41 public function processRequest($debug)
42 {
43 $this->setDebug($debug);
44 $this->process();
45 }
[008bce9]46
47 public static function error($message)
48 {
49 Service::output(["error" => 1, "errormessage" => $message]);
50 }
51
52 public static function output($content)
53 {
54 header('Content-Type: application/json');
55 echo json_encode($content);
56 }
[1ba85cf]57
[c455d7b]58 /**
59 * @brief Function used to process and generate the needed output
60 */
[1ba85cf]61 abstract protected function process();
[c455d7b]62
63 private $_debug;
64}
65
66?>
Note: See TracBrowser for help on using the repository browser.