-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample-status.php
57 lines (54 loc) · 1.75 KB
/
sample-status.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
$response = [
'api' => [
'version' => '1.0',
'result_from_cache' => true,
'cache_status' => [
'cached_at' => DateTime::createFromFormat( 'Y-m-d H:i:s', '2016-10-22 10:43:48' ),
'orig_ttl' => 300
],
],
'status' => [
'version' => '1.4.0',
'router_id' => '193.242.111.8',
'server_time' => DateTime::createFromFormat( 'Y-m-d H:i:s', '2016-10-22 10:43:48' ),
'last_reboot' => DateTime::createFromFormat( 'Y-m-d H:i:s', '2015-03-18 20:42:57' ),
'last_reconfig' => DateTime::createFromFormat( 'Y-m-d H:i:s', '2016-10-22 09:17:04' ),
'message' => 'Daemon is up and running'
]
];
echo json_encode( $response, JSON_PRETTY_PRINT ) . "\n\n";
// {
// "api": {
// "version": "1.0",
// "result_from_cache": true,
// "cache_status": {
// "cached_at": {
// "date": "2016-10-22 10:43:48.000000",
// "timezone_type": 3,
// "timezone": "UTC"
// },
// "orig_ttl": 300
// }
// },
// "status": {
// "version": "1.4.0",
// "router_id": "193.242.111.8",
// "server_time": {
// "date": "2016-10-22 10:43:48.000000",
// "timezone_type": 3,
// "timezone": "UTC"
// },
// "last_reboot": {
// "date": "2015-03-18 20:42:57.000000",
// "timezone_type": 3,
// "timezone": "UTC"
// },
// "last_reconfig": {
// "date": "2016-10-22 09:17:04.000000",
// "timezone_type": 3,
// "timezone": "UTC"
// },
// "message": "Daemon is up and running"
// }
// }