2 set_include_path(get_include_path() . PATH_SEPARATOR
. '../lib');
3 include_once("aurjson.class.php");
5 if ( $_SERVER['REQUEST_METHOD'] != 'GET' ) {
6 header('HTTP/1.1 405 Method Not Allowed');
10 if ( isset($_GET['type']) ) {
11 $rpc_o = new AurJSON();
12 echo $rpc_o->handle($_GET);
15 // dump a simple usage output for people to use.
16 // this could be moved to an api doc in the future, or generated from
17 // the AurJSON class directly with phpdoc. For now though, just putting it
21 <p
>The methods currently allowed are
:</p
>
23 <li
><tt
>search
</tt
></li
>
24 <li
><tt
>info
</tt
></li
>
25 <li
><tt
>multiinfo
</tt
></li
>
26 <li
><tt
>msearch
</tt
></li
>
28 <p
>Each method requires the following HTTP GET syntax
:</p
>
29 <pre
>type
=<em
>methodname
</em
>&
;arg
=<em
>data
</em
></pre
>
30 <p
>Where
<em
>methodname
</em
> is the name of an allowed method
, and <em
>data
</em
> is the argument to the call
.</p
>
31 <p
>If you need jsonp type callback specification
, you can provide an additional variable
<em
>callback
</em
>.</p
>
32 <p
>Example URL
: <tt
>http
://aur-url/rpc.php?type=search&arg=foobar&callback=jsonp1192244621103</tt></p>