Ignore:
File:
1 edited

Legend:

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

    r0662b2d r1ba85cf  
    2323class WebService
    2424{
    25         function __construct($debug)
     25        function __construct()
    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;
    3532        }
    3633
    3734        public function process()
    3835        {
     36                $debug = 0;
     37                if(is_array($_GET) && array_key_exists("debug", $_GET))
     38                        $debug = $_GET["debug"];
     39
    3940                $request = array_keys($this->_requests)[0];
    4041                if(is_array($_GET) && array_key_exists("request", $_GET)){
    … …  
    4344
    4445                if(!array_key_exists($request, $this->_requests)){
    45                         return Service::errorStatic("Request ". $request ." not implemented", $this->_debug);
     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;
    4652                }
    47                
    48                 call_user_func(array(new $this->_requests[$request], "processRequest"), $this->_debug);
     53
     54                call_user_func(array(new $this->_requests[$request], "processRequest"), $debug);
    4955        }
    5056
    5157        private $_requests;
    52         private $_debug;
    5358}
    5459
Note: See TracChangeset for help on using the changeset viewer.