summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2015-10-04 10:43:38 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2015-10-04 11:40:38 +0200
commit9d8345d4e09a16f0d4067638560e2e8318727d03 (patch)
tree2d890448bee8474fb4134898d90e1a4af0689284
parenta99c0fe5d33101a2c4753a350f5bf63f8c93dc68 (diff)
downloadaur-9d8345d4e09a16f0d4067638560e2e8318727d03.tar.gz
aur-9d8345d4e09a16f0d4067638560e2e8318727d03.tar.xz
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>
-rw-r--r--web/html/rpc.php29
1 files changed, 1 insertions, 28 deletions
diff --git a/web/html/rpc.php b/web/html/rpc.php
index 415dcb82..64c95622 100644
--- a/web/html/rpc.php
+++ b/web/html/rpc.php
@@ -12,33 +12,6 @@ if ( isset($_GET['type']) ) {
echo $rpc_o->handle($_GET);
}
else {
- // dump a simple usage output for people to use.
- // this could be moved to an api doc in the future, or generated from
- // the AurJSON class directly with phpdoc. For now though, just putting it
- // here.
-?>
-<html><body>
-<h2>Allowed methods</h2>
-<ul>
- <li><tt>search</tt></li>
- <li><tt>info</tt></li>
- <li><tt>multiinfo</tt></li>
- <li><tt>msearch</tt></li>
-</ul>
-<p>Each method requires the following HTTP GET syntax:</p>
-<pre>type=<em>methodname</em>&amp;arg=<em>data</em></pre>
-<p>Where <em>methodname</em> is the name of an allowed method, and <em>data</em> is the argument to the call.</p>
-<p>If you need jsonp type callback specification, you can provide an additional variable <em>callback</em>.</p>
-<h2>Examples</h2>
-<dl>
- <dt><tt>search</tt></dt><dd><tt>http://aur-url/rpc.php?type=search&amp;arg=foobar</tt></li></dd>
- <dt><tt>info</tt></dt><dd><tt>http://aur-url/rpc.php?type=info&amp;arg=foobar</tt></dd>
- <dt><tt>multiinfo</tt></dt><dd><tt>http://aur-url/rpc.php?type=multiinfo&amp;arg[]=foo&amp;arg[]=bar</tt></dd>
- <dt><tt>msearch</tt></dt><dd><tt>http://aur-url/rpc.php?type=msearch&amp;arg=john</tt></li></dd>
- <dt>Callback</dt><dd><tt>http://aur-url/rpc.php?type=search&amp;arg=foobar&amp;callback=jsonp1192244621103</tt></dd>
-</dl>
-</body></html>
-<?php
-// close if statement
+ echo file_get_contents('../../doc/rpc.html');
}
?>