| | |
| | | $ret->code = $code; |
| | | $ret->message = $message; |
| | | $ret->response = $data; |
| | | header('Content-Type: application/x-json; charset="utf-8"'); |
| | | |
| | | header('Content-Type: application/json; charset="utf-8"'); |
| | | print json_encode($ret); |
| | | exit; |
| | | } |
| | | |
| | | public function run() { |
| | | |
| | | $method = reset(array_keys($_GET)); |
| | | if(!isset($_GET) || !is_array($_GET) || count($_GET) < 1) { |
| | | $this->_return_json('invalid_method', 'Method not provided in json call'); |
| | | } |
| | | $keys = array_keys($_GET); |
| | | $method = reset($keys); |
| | | $params = array(); |
| | | |
| | | if(is_array($_POST)) { |