summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4a64f06)
raw | patch | inline | side by side (parent: 4a64f06)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 4 Jun 2010 12:22:06 +0000 (12:22 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 4 Jun 2010 12:22:06 +0000 (12:22 +0000) |
-
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18845 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18845 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_jsonRPC.inc | patch | blob | history |
index 98c0d0bf1c919b5582e11764c31c8ef184ae76e0..91f1c2b0a82a57e33ec49432f96151e968317203 100644 (file)
private $config;
private $id;
private $lastStats = array();
+ private $lastAction = "none";
public function __construct($config, $debug = false)
{
public function __destruct()
{
- curl_close($this->curlHandler);
+ if($this->curlHandler){
+ curl_close($this->curlHandler);
+ }
}
public function __call($method,$params)
{
// Check if handle is still valid!
- if(! $this->curlHandler) $this->__login();
+ if(!$this->curlHandler && $this->lastAction != 'login'){
+ $this->__login();
+ }
+
+ $response = $this->request($method,$params);
+ return($response['result']);
+ }
+
+
+ private function request($method, $params)
+ {
+ // Set last action
+ $this->lastAction = $method;
// Reset stats of last request.
$this->lastStats = array();
// Set current result stats.
$this->lastStats = curl_getinfo($this->curlHandler);
- return($response['result']);
+
+ return($response);
}
-
+
public static function getHttpStatusCodeMessage($code)
{