Changeset 0662b2d for src/webapp/webservice/inc/GnuBoat/Service.php
- Timestamp:
- Aug 30, 2017, 2:45:37 PM (9 years ago)
- Branches:
- 0.5, debian/bullseye, debian/jessie, master
- Children:
- a50c18f
- Parents:
- 89c510f
- File:
-
- 1 edited
-
src/webapp/webservice/inc/GnuBoat/Service.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/webapp/webservice/inc/GnuBoat/Service.php
r89c510f r0662b2d 45 45 } 46 46 47 public static function error ($message)47 public static function errorStatic($message, $additionalContent = array(), $debug) 48 48 { 49 Service::output(["error" => 1, "errormessage" => $message]); 49 error_log($message); 50 if($debug > 0) 51 print $message ."\n"; 52 $result = ["error" => 1, "errormessage" => $message]; 53 Service::outputStatic(array_merge($result, $additionalContent), $debug); 50 54 } 51 55 52 public static function output ($content)56 public static function outputStatic($content, $debug) 53 57 { 54 58 header('Content-Type: application/json'); 55 echo json_encode($content); 59 if($debug > 0){ 60 echo json_encode($content, JSON_PRETTY_PRINT) ."\n"; 61 } 62 else{ 63 echo json_encode($content) ."\n"; 64 } 65 } 66 67 protected function error($message, $additionalContent = array()) 68 { 69 Service::errorStatic($message, $additionalContent, $this->debug()); 70 } 71 72 protected function output($content) 73 { 74 Service::outputStatic($content, $this->debug()); 56 75 } 57 76
Note:
See TracChangeset
for help on using the changeset viewer.
