|
@@ 1073-1082 (lines=10) @@
|
| 1070 |
|
* @retval string The document's revision. |
| 1071 |
|
* @see http://docs.couchdb.org/en/latest/api/document/common.html#db-doc |
| 1072 |
|
*/ |
| 1073 |
|
public function getDocEtag($dbName, $docId) { |
| 1074 |
|
$this->validateAndEncodeDocId($docId); |
| 1075 |
|
|
| 1076 |
|
$path = "/".rawurlencode($dbName)."/".$docId; |
| 1077 |
|
|
| 1078 |
|
$request = new Request(Request::HEAD_METHOD, $path); |
| 1079 |
|
|
| 1080 |
|
// CouchDB ETag is included between quotation marks. |
| 1081 |
|
return trim($this->send($request)->getHeaderFieldValue(Response::ETAG_HF), '"'); |
| 1082 |
|
} |
| 1083 |
|
|
| 1084 |
|
|
| 1085 |
|
/** |
|
@@ 1448-1456 (lines=9) @@
|
| 1445 |
|
* @retval array An associative array |
| 1446 |
|
* @see http://docs.couchdb.org/en/latest/api/ddoc/common.html#get--db-_design-ddoc-_info |
| 1447 |
|
*/ |
| 1448 |
|
public function getDesignDocInfo($dbName, $docName) { |
| 1449 |
|
$this->validateAndEncodeDocId($docName); |
| 1450 |
|
|
| 1451 |
|
$path = "/".rawurlencode($dbName)."/".self::DESIGN_DOC_PATH.$docName."/_info"; |
| 1452 |
|
|
| 1453 |
|
$request = new Request(Request::GET_METHOD, $path); |
| 1454 |
|
|
| 1455 |
|
return $this->send($request)->getBodyAsArray(); |
| 1456 |
|
} |
| 1457 |
|
|
| 1458 |
|
|
| 1459 |
|
/** |