Ignore:
Timestamp:
Aug 29, 2017, 6:19:00 PM (9 years ago)
Author:
Joachim Langenbach <joachim.langenbach@…>
Branches:
0.5, debian/bullseye, debian/jessie, master
Children:
89c510f
Parents:
fc63b30
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/webapp/webservice/inc/GnuBoat/Webservice.php

    rfc63b30 r008bce9  
    2323class WebService
    2424{
    25         function __construct()
     25        function __construct($debug)
    2626        {
    2727                $this->_requests = array();
    … …  
    3030                $this->_requests["logfiles"] = "GnuBoat\ServiceLogFiles";
    3131                $this->_requests["map"] = "GnuBoat\ServiceMap";
     32                $this->_requests["replay"] = "GnuBoat\ServiceReplay";
     33               
     34                $this->_debug = $debug;
    3235        }
    3336
    3437        public function process()
    3538        {
    36                 $debug = 0;
    37                 if(is_array($_GET) && array_key_exists("debug", $_GET))
    38                         $debug = $_GET["debug"];
    39 
    4039                $request = array_keys($this->_requests)[0];
    4140                if(is_array($_GET) && array_key_exists("request", $_GET)){
    … …  
    4443
    4544                if(!array_key_exists($request, $this->_requests)){
    46                         $result["error"] = 1;
    47                         $result["errormessage"] = "Request ". $request ." not implemented";
    48                        
    49                         header('Content-Type: application/json');
    50                         echo json_encode($result) ."\n";
    51                         return;
     45                        return Service::error("Request ". $request ." not implemented");
    5246                }
    53 
    54                 call_user_func(array(new $this->_requests[$request], "processRequest"), $debug);
     47               
     48                call_user_func(array(new $this->_requests[$request], "processRequest"), $this->_debug);
    5549        }
    5650
    5751        private $_requests;
     52        private $_debug;
    5853}
    5954
Note: See TracChangeset for help on using the changeset viewer.