Ignore:
Timestamp:
Dec 10, 2017, 4:32:57 PM (9 years ago)
Author:
Joachim Langenbach <joachim.langenbach@…>
Branches:
debian/bullseye, debian/jessie
Children:
ce5244e
Parents:
c810990 (diff), 8ef59a1 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'debian/jessie' of ​https://svn.engsas.de/gnuboat into debian/jessie

File:
1 edited

Legend:

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

    rc810990 r8fd7454  
    4444                $this->process();
    4545        }
     46       
     47        public static function errorStatic($message, $additionalContent = array(), $debug)
     48        {
     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);
     54        }
     55       
     56        public static function outputStatic($content, $debug)
     57        {
     58                header('Content-Type: application/json');
     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());
     75        }
    4676
    4777        /**
Note: See TracChangeset for help on using the changeset viewer.