aurweb/web/html/rpc.php
Lukas Fleischer 9d8345d4e0 rpc.php: Display generated documentation
Instead of hardcoding the RPC interface documentation in rpc.php,
include the HTML code of the documentation page generated by AsciiDoc.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-10-04 11:40:38 +02:00

17 lines
354 B
PHP

<?php
set_include_path(get_include_path() . PATH_SEPARATOR . '../lib');
include_once("aurjson.class.php");
if ( $_SERVER['REQUEST_METHOD'] != 'GET' ) {
header('HTTP/1.1 405 Method Not Allowed');
exit();
}
if ( isset($_GET['type']) ) {
$rpc_o = new AurJSON();
echo $rpc_o->handle($_GET);
}
else {
echo file_get_contents('../../doc/rpc.html');
}
?>