summaryrefslogtreecommitdiffstats
path: root/web/lib/aurjson.class.php
diff options
context:
space:
mode:
authoreliott <eliott@cactuswax.net>2007-10-13 21:27:35 +0200
committerDan McGee <dan@archlinux.org>2008-01-20 06:49:35 +0100
commit36dd7736c993cbcf61228f6e06466a6614939c97 (patch)
tree734bf633c46da10155bff6e8cb806c31e5493be7 /web/lib/aurjson.class.php
parent5e38e3d3d0eff20f8d46bad67c4944a6a1d92ea4 (diff)
downloadaur-36dd7736c993cbcf61228f6e06466a6614939c97.tar.gz
aur-36dd7736c993cbcf61228f6e06466a6614939c97.tar.xz
Moved usage documentation out of the class.
Fixed an issue in the handle class.
Diffstat (limited to 'web/lib/aurjson.class.php')
-rw-r--r--web/lib/aurjson.class.php22
1 files changed, 1 insertions, 21 deletions
diff --git a/web/lib/aurjson.class.php b/web/lib/aurjson.class.php
index ce59ed7d..d12f2b54 100644
--- a/web/lib/aurjson.class.php
+++ b/web/lib/aurjson.class.php
@@ -20,33 +20,13 @@ class AurJSON {
private $exposed_methods = array('search','info');
/**
- * Returns the usage data for the exposed json api.
- * @return string The usage data in plain format.
- **/
- public function usage() {
- $usage = 'The methods currently allowed are: <br />';
- $usage .= '<ul>';
- foreach ($this->exposed_methods as $methodname) {
- $usage .= "<li>{$methodname}</li>";
- }
- $usage .= '</ul><br />';
- $usage .= 'Each method requires the following HTTP GET syntax:<br />';
- $usage .= '&nbsp;&nbsp; type=_methodname_&arg=_data_ <br /><br />';
- $usage .= 'Where _methodname_ is the name of an exposed method, and _data_ is the data supplied as part of the call.<br />';
- $usage .= 'The _ characters are included only in this example as placeholders. Do not use them in an actual query.<br /><br />';
- $usage .= 'If you need jsonp type callback specification, you can provide an additional variable "callback".<br />';
- $usage .= 'Example URL: <br />&nbsp;&nbsp; http://aur-url/rpc.php?type=search&args=foobar&callback=jsonp1192244621103';
- return $usage;
- }
-
- /**
* Handles post data, and routes the request.
* @param string $post_data The post data to parse and handle.
* @return string The JSON formatted response data.
**/
public function handle($http_data) {
// set content type header to json
- //header('content-type: application/json');
+ header('content-type: application/json');
// set up db connection.
$this->dbh = db_connect();