- File:
-
- 1 edited
-
src/webapp/webservice/inc/GnuBoat/Webservice.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/webapp/webservice/inc/GnuBoat/Webservice.php
r1ba85cf r0662b2d 23 23 class WebService 24 24 { 25 function __construct( )25 function __construct($debug) 26 26 { 27 27 $this->_requests = array(); … … 30 30 $this->_requests["logfiles"] = "GnuBoat\ServiceLogFiles"; 31 31 $this->_requests["map"] = "GnuBoat\ServiceMap"; 32 $this->_requests["replay"] = "GnuBoat\ServiceReplay"; 33 34 $this->_debug = $debug; 32 35 } 33 36 34 37 public function process() 35 38 { 36 $debug = 0;37 if(is_array($_GET) && array_key_exists("debug", $_GET))38 $debug = $_GET["debug"];39 40 39 $request = array_keys($this->_requests)[0]; 41 40 if(is_array($_GET) && array_key_exists("request", $_GET)){ … … 44 43 45 44 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::errorStatic("Request ". $request ." not implemented", $this->_debug); 52 46 } 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); 55 49 } 56 50 57 51 private $_requests; 52 private $_debug; 58 53 } 59 54
Note:
See TracChangeset
for help on using the changeset viewer.
