summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 70bf46b)
raw | patch | inline | side by side (parent: 70bf46b)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 28 May 2010 14:23:19 +0000 (14:23 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 28 May 2010 14:23:19 +0000 (14:23 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18790 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_jsonRPC.inc | patch | blob | history |
index 54f98096ca7a8ed6d86a71b410b1802f883a41b5..eae33f9bd4ff6553f7b0157e18d1b68f598fa385 100644 (file)
private $url;
private $id;
- public function __construct($url,$debug = false) {
+ public function __construct($url,$debug = false)
+ {
$this->url = $url;
- $this->dbug = $debug;
- $this->id = 1;
+ $this->debug = $debug;
+ $this->id = 0;
// Init Curl handler
$this->curlHandler = curl_init($this->url);
curl_setopt($this->curlHandler, CURLOPT_HTTPHEADER , array('Content-Type: application/json'));
}
- public function __call($method,$params) {
+ public function __destruct()
+ {
+ curl_close($this->curlHandler);
+ }
+
+ public function __call($method,$params)
+ {
if (!is_scalar($method)) trigger_error('jsonRPC::__call requires a scalar value as first parameter!');
// Check responce id
if ($response['id'] != $this->id){
- trigger_error('jsonPRC returned incorrect response id (request id: '.$this->id.', response id: '.$response['id'].')');
+ trigger_error('jsonPRC returned incorrect response '.
+ 'id (request id: '.$this->id.', response id: '.$response['id'].')');
}
-
return($response['result']);
}
}