summaryrefslogtreecommitdiffstats
path: root/web/html/rpc.php
diff options
context:
space:
mode:
authoreliott <eliott@cactuswax.net>2007-10-13 06:05:13 +0200
committerDan McGee <dan@archlinux.org>2008-01-20 06:49:35 +0100
commit5e38e3d3d0eff20f8d46bad67c4944a6a1d92ea4 (patch)
treec23cb38182971c201a4f797bcf3f8fde43787be8 /web/html/rpc.php
parent0cda12132d5b28b3a10a27bcad56bc823116817b (diff)
downloadaur-5e38e3d3d0eff20f8d46bad67c4944a6a1d92ea4.tar.gz
aur-5e38e3d3d0eff20f8d46bad67c4944a6a1d92ea4.tar.xz
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.
Diffstat (limited to 'web/html/rpc.php')
-rw-r--r--web/html/rpc.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/web/html/rpc.php b/web/html/rpc.php
new file mode 100644
index 00000000..30813912
--- /dev/null
+++ b/web/html/rpc.php
@@ -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';
+}
+?>