-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexample.php
33 lines (29 loc) · 1.13 KB
/
example.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
<?php
/**
* This file is part of https://github.com/jpereira/php-dhcpdleases/
*
* php-dhcpdleases is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesse General Public License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* php-dhcpdleases is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesse General Public License for more details.
*
* You should have received a copy of the GNU Lesse General Public License
* along with php-dhcpdleases.
* If not, see <http://www.gnu.org/licenses/>.
*
* Copyright (C) 2014, Jorge Pereira <[email protected]>
*/
require_once("class.DhcpdLeases.php");
// main()
$dl = new DhcpdLeases("dhcpd.leases.sample");
header("Content-Type: application/json");
if ($dl->process() < 1) {
header("HTTP/1.0 404 Not Found", true, 404);
echo "{ \"status\": \"error\", \"msg\": \"not found\" }";
} else {
echo $dl->GetResultJson();
}
?>