PHPackages                             riverside/head-couch - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. riverside/head-couch

ActiveLibrary[Database &amp; ORM](/categories/database)

riverside/head-couch
====================

CouchDB PHP Client

1.0.1(6y ago)1219[1 issues](https://github.com/riverside/HeadCouch/issues)MITPHPPHP &gt;=7.0CI failing

Since Jul 6Pushed 3y ago1 watchersCompare

[ Source](https://github.com/riverside/HeadCouch)[ Packagist](https://packagist.org/packages/riverside/head-couch)[ Docs](https://github.com/riverside/HeadCouch)[ RSS](/packages/riverside-head-couch/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (1)Versions (3)Used By (0)

HeadCouch
=========

[](#headcouch)

CouchDB PHP client

BuildStableLicense[![CI](https://github.com/riverside/HeadCouch/actions/workflows/test.yml/badge.svg)](https://github.com/riverside/HeadCouch/actions/workflows/test.yml)[![Latest Stable Version](https://camo.githubusercontent.com/a6de992725568c73d4a14767ff5e9a3a1d840a8a8c4678c6f877eccee309e835/68747470733a2f2f706f7365722e707567782e6f72672f7269766572736964652f686561642d636f7563682f762f737461626c65)](https://packagist.org/packages/riverside/head-couch)[![License](https://camo.githubusercontent.com/bc74db40a2d926a69c3807c306469ead075d4dd336379546eed7be07f5a77759/68747470733a2f2f706f7365722e707567782e6f72672f7269766572736964652f686561642d636f7563682f6c6963656e7365)](https://packagist.org/packages/riverside/head-couch)#### Loading

[](#loading)

```
require __DIR__ . '/vendor/autoload.php';
```

#### Transport

[](#transport)

- cURL

```
$transport = \HeadCouch\Curl::newInstance('127.0.0.1', 5984)
	->setUsername('my_username')
	->setPassword('my_password');
```

- Socket

```
$transport = \HeadCouch\Socket::newInstance('127.0.0.1', 5984)
	->setUsername('my_username')
	->setPassword('my_password');
```

- File

```
$transport = \HeadCouch\File::newInstance('127.0.0.1', 5984)
	->setUsername('my_username')
	->setPassword('my_password');
```

#### Server

[](#server)

```
$server = \HeadCouch\Server::newInstance($transport);

// Accessing the root of a CouchDB instance
$response = $server->ping();

// Requests a Universally Unique Identifier from the CouchDB instance
$response = $server->uuid();

// Returns a list of all the databases
$response = $server->allDbs();

// List of running tasks
$response = $server->activeTasks();

// Returns a list of all database events in the CouchDB instance
$response = $server->dbUpdates();

// Gets the CouchDB log
$response = $server->log();

// Restarts the CouchDB instance
$response = $server->restart();

// Returns the statistics for the running server
$response = $server->stats();
```

#### Database

[](#database)

```
try {
    $database = \HeadCouch\Database::newInstance($transport, 'db_name');
} catch (\HeadCouch\Exception $e) {
    echo $e->getMessage();
}

// Create database
$response = $database->create();

// Delete database
$response = $database->delete();

// Gets information about the specified database
$response = $database->get();

// Returns the HTTP Headers about the specified database
$response = $database->head();

// Creates a new document in the specified database
$response = $database->post(array(
    'key1' => 'val1',
    'key2' => 'val2'
));
```

#### Document

[](#document)

```
try {
    $document = \HeadCouch\Document::newInstance($transport, 'db_name', 'doc_name');
} catch (\HeadCouch\Exception $e) {
    echo $e->getMessage();
}

// Creates a new document
$response = $document->create(array(
    'key1' => 'val1',
    'key2' => 'val2'
));

// Deletes the specified document from the database
$response = $document->delete();

// Returns document
$response = $document->get();

// Returns document's revision token
$response = $document->getRevision();

// Returns the HTTP Headers about the specified document
$response = $document->head();
```

#### Response

[](#response)

```
$result = $response->toArray();
// print_r($result);

$result = $response->toObject();
// get_object_vars($result);

$result = $response->toString();
// echo $result;
```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1831 days

Total

2

Last Release

2548d ago

Major Versions

0.1.1 → 1.0.12019-07-12

PHP version history (2 changes)0.1.1PHP &gt;=5.0

1.0.1PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/17dd08ce9964258b22baca5a0a36d0dcf17d5cfb992462e40e6877e64c4fb453?d=identicon)[riverside](/maintainers/riverside)

---

Top Contributors

[![riverside](https://avatars.githubusercontent.com/u/43607?v=4)](https://github.com/riverside "riverside (48 commits)")

---

Tags

apacheapache-couchdbclientcouchdbcouchdb-clientlibrarynosqlphpphp-clientphp-libraryphpclientnosqlcouchdbheadcouch

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/riverside-head-couch/health.svg)

```
[![Health](https://phpackages.com/badges/riverside-head-couch/health.svg)](https://phpackages.com/packages/riverside-head-couch)
```

###  Alternatives

[basho/riak

Official Riak client for PHP

158248.3k7](/packages/basho-riak)[dready92/php-on-couch

CouchDB NoSQL database access in PHP

24455.7k1](/packages/dready92-php-on-couch)[php-on-couch/php-on-couch

CouchDB NoSQL database access in PHP

108199.9k4](/packages/php-on-couch-php-on-couch)[tbolier/php-rethink-ql

A clean and solid RethinkDB driver for PHP.

5211.7k](/packages/tbolier-php-rethink-ql)[f21/paradox

Paradox is an elegant Object Document Mananger (ODM) to use with the ArangoDB Document/Graph database server.

256.8k](/packages/f21-paradox)[mroosz/php-cassandra

A pure-PHP client for Apache Cassandra and ScyllaDB with support for CQL binary protocol v3, v4 and v5 (Cassandra 2.1+ incl. 3.x-5.x; ScyllaDB 6.2 and 2025.x), synchronous and asynchronous APIs, prepared statements, batches, result iterators, object mapping, SSL/TLS, and LZ4 compression.

217.4k3](/packages/mroosz-php-cassandra)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
