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