Added AurJSON code.

Added a JSON interface to the aur. This should make it easier for developers to integrate
command line utilities and poll against the AUR itself.
This commit is contained in:
eliott 2007-10-12 21:05:13 -07:00 committed by Dan McGee
parent 0cda12132d
commit 5e38e3d3d0
3 changed files with 168 additions and 0 deletions

22
web/html/rpc.php Normal file
View file

@ -0,0 +1,22 @@
<?php
set_include_path(get_include_path() . PATH_SEPARATOR . '../lib' . PATH_SEPARATOR . '../lang');
include("aur.inc");
include("aurjson.class.php");
$rpc_o = new AurJSON();
if ( $_SERVER['REQUEST_METHOD'] == 'GET' ) {
if ( isset($_GET['type']) ) {
echo $rpc_o->handle($_GET);
}
else {
echo '<html><body>';
echo $rpc_o->usage();
echo '</body></html>';
}
}
else {
echo 'POST NOT SUPPORTED';
}
?>