-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathserver.php
29 lines (23 loc) · 835 Bytes
/
server.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
header('Content-type: application/json; charset=utf-8');
// load the shared functions into the global scope
// these happen to be the functions related to specification examples
// but normally you would load your custom functions here
require_once('spec_functions.php');
// load the base jsonrpc2 processing class
require_once('jsonrpc2.class.php');
// load the transport processing layer, extends base class
require_once('transport_http.class.php');
// create a instance of the transport layer, with method maps
$server = new transport_http(
array(
'subtract' => 'subtract',
'sum' => 'sum',
'notify_hello' => 'notify_hello',
'notify_sum' => 'notify_sum',
'get_data' => 'get_data'
)
);
// add additional query string keys to check, if so desired
$server->keys[] = 'msg';
print $server->process();