private function talkToDB($url, $method = COUCH_GET, $data = null) { $fullURL = "http://" . $this->host . ":" . $this->port . "/" . $this->db . $url; $request = new CouchRequest($fullURL, $method, $data, $this->username, $this->password); $resp = $request->send(); if ($resp->getStatusCode() >= 400 && !in_array($resp->getStatusCode(), self::$okStatus)) { throw new Exception("CouchDB-HTTP Error: " . $resp->getBody(), $resp->getStatusCode()); } $response = $resp->getBody(); if ('application/json' == $resp->getContentType()) { $response = json_decode($response); } return $response; }
public function __construct($id, $parameters = array(), CouchData $data = null) { parent::__construct("GET", $id, $parameters, $data); }