PHPackages                             php-on-couch/php-on-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. php-on-couch/php-on-couch

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

php-on-couch/php-on-couch
=========================

CouchDB NoSQL database access in PHP

4.0.2(2y ago)103190.3k—7.7%33[7 issues](https://github.com/PHP-on-Couch/PHP-on-Couch/issues)[1 PRs](https://github.com/PHP-on-Couch/PHP-on-Couch/pulls)3LGPL-3.0-or-laterPHPPHP &gt;=5.6.0

Since Mar 14Pushed 2y ago12 watchersCompare

[ Source](https://github.com/PHP-on-Couch/PHP-on-Couch)[ Packagist](https://packagist.org/packages/php-on-couch/php-on-couch)[ Docs](https://github.com/PHP-on-Couch/PHP-on-Couch)[ RSS](/packages/php-on-couch-php-on-couch/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (30)Used By (3)

[![Latest Stable Version](https://camo.githubusercontent.com/6800a85acf57b44d18c7771b42889320cf33c861eb109c992e8a25ff625100f2/68747470733a2f2f706f7365722e707567782e6f72672f7068702d6f6e2d636f7563682f7068702d6f6e2d636f7563682f76657273696f6e)](https://packagist.org/packages/php-on-couch/php-on-couch)[![Latest Unstable Version](https://camo.githubusercontent.com/7aa78f71a43af3c23afcd5831528be276199b071354b1ce24622c7d9059f5830/68747470733a2f2f706f7365722e707567782e6f72672f7068702d6f6e2d636f7563682f7068702d6f6e2d636f7563682f762f756e737461626c65)](//packagist.org/packages/php-on-couch/php-on-couch)[![Build Status](https://camo.githubusercontent.com/24d91e9b228ef42715f7298a1d436f1ea8ad73d6ae3866bd2c84b764eeef1969/68747470733a2f2f7472617669732d63692e6f72672f5048502d6f6e2d436f7563682f5048502d6f6e2d436f7563682e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/PHP-on-Couch/PHP-on-Couch)[![Documentation Status](https://camo.githubusercontent.com/497e37e3b13481bea3c28e3b07a5f7d18aca82d8c7c4a09544be26c6d6aa6baf/68747470733a2f2f72656164746865646f63732e6f72672f70726f6a656374732f7068702d6f6e2d636f7563682f62616467652f3f76657273696f6e3d6c6174657374)](http://php-on-couch.readthedocs.io/en/latest/?badge=latest)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/82d8aa6bebae5e4286b4db5e84d40bf45eb7173426c8c62709b460610bcaa5fb/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f5048502d6f6e2d436f7563682f5048502d6f6e2d436f7563682f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/PHP-on-Couch/PHP-on-Couch/?branch=master)[![codecov](https://camo.githubusercontent.com/c917ed701ff1407472c572387737b69758ec648c11ee981921f08475b63e37c5/68747470733a2f2f636f6465636f762e696f2f67682f5048502d6f6e2d436f7563682f5048502d6f6e2d436f7563682f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/PHP-on-Couch/PHP-on-Couch)[![License](https://camo.githubusercontent.com/3bee22390491833fb509dda0db34c3f11ef3ddda3dc9fe6c192a4c7f4e427ccc/68747470733a2f2f706f7365722e707567782e6f72672f7068702d6f6e2d636f7563682f7068702d6f6e2d636f7563682f6c6963656e7365)](https://packagist.org/packages/php-on-couch/php-on-couch)

🔥For the complete documentation, visit  🔥

Table of content
----------------

[](#table-of-content)

- [Introduction](#introduction)
- [What's new](#whats-new)
- [Changes](#changes)
- [Installation and testing](#installation-and-testing)
- [Components and documentation](#components-and-documentation)
- [Quick-start guide](#quick-start-guide)
- [Example](#example)
- [Community](#community)
    - [Contributions](#contributions)
    - [Feedback](#feedback)

Introduction
------------

[](#introduction)

[PHP On Couch](http://github.com/PHP-on-Couch/PHP-on-Couch/) provides an easy way to work with your [CouchDB](http://couchdb.apache.org) [documents](http://docs.couchdb.org/) with [PHP](http://php.net).

Supports PHP 5.6 and higher 🚀

Recent changes
--------------

[](#recent-changes)

For the complete change list, head over [here](http://php-on-couch.readthedocs.io/en/latest/overview/changelist/index.html)

Installation and testing
------------------------

[](#installation-and-testing)

Install the library using composer : `composer require php-on-couch/php-on-couch`. You can find more detailed informations about installation [here](http://php-on-couch.readthedocs.io/en/latest/quickstart/installation.html).

To test the the application, see [this topic](http://php-on-couch.readthedocs.io/en/latest/quickstart/testing.html).

Components and documentation
----------------------------

[](#components-and-documentation)

For the full API document, please visite [this link](http://php-on-couch.readthedocs.io/en/latest/api/index.html)

Example
-------

[](#example)

For full examples, refer to the [database example](examples/01_databases.php) or the [document example](examples/02_documents_basics.php).

At first, you need to import the main components through their namespace. If you use composer, I suggest you to use their autoload wich is easy to setup. Otherwise, you can use your own autoload function or a basic require with some namespace escaping.

```
use  PHPOnCouch\CouchClient; //The CouchDB client object
```

Here's an example for basic operations

```
// Set a new connector to the CouchDB server
$client = new CouchClient('http://my.couch.server.com:5984', 'my_database');

// document fetching by ID
$doc = $client->getDoc('some_doc_id');
// updating document
$doc->newproperty = array("hello !", "world");
try {
    $client->storeDoc($doc);
} catch (Exception $e) {
    echo "Document storage failed : " . $e->getMessage() . "\n";
}
```

Here's a quick example of how to fetch a view

```
// view fetching, using the view option limit
try {
    $view = $client->limit(100)->getView('orders', 'by-date');
} catch (Exception $e) {
    echo "something weird happened: " . $e->getMessage() . "\n";
}
```

Finally, how to use the CouchDocument class.

```
//using couch_document class :
$doc = new CouchDocument($client);
$doc->set(array('_id' => 'JohnSmith', 'name' => 'Smith', 'firstname' => 'John')); //create a document and store it in the database
echo $doc->name; // should echo "Smith"
$doc->name = "Brown"; // set document property "name" to "Brown" and store the updated document in the database
```

Community
---------

[](#community)

### Contributions

[](#contributions)

Feel free to make any contributions. All contributions must follow the [code style](http://php-on-couch.readthedocs.io/en/latest/quickstart/codestyle.html) and must also comes with valid and complete tests.

Help is really appreciated to complete add more tests.

### Feedback

[](#feedback)

[![Gitter chat](https://camo.githubusercontent.com/fad7c80e3e60da9c11b54693192e57c20f3dc78022487655994bc74d7c4e14f8/68747470733a2f2f6261646765732e6769747465722e696d2f67697474657248512f6769747465722e706e67)](https://gitter.im/PHP-on-Couch/PHP-on-Couch)

Don't hesitate to submit feedback, bugs and feature requests ! Our contact address is [phponcouch@gmail.com](mailto:phponcouch@gmail.com?subject=Feedback)

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity50

Moderate usage in the ecosystem

Community34

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 51.7% 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 ~201 days

Recently: every ~344 days

Total

20

Last Release

980d ago

Major Versions

1.6.1 → 2.0.12017-01-31

1.6.1.x-dev → 2.0.22017-03-19

2.0.9 → 3.0.02019-12-04

3.0.2 → 4.0.02022-01-31

PHP version history (2 changes)1.0.1-p1PHP &gt;=5.2.0

2.0.4PHP &gt;=5.6.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/2f51a63f0a2f61fcb64a1462a8f816453633f3ed498cde4f0c8351ca38cd3aec?d=identicon)[ClemensSahs](/maintainers/ClemensSahs)

![](https://avatars.githubusercontent.com/u/99866?v=4)[Mickael Bailly](/maintainers/dready92)[@dready92](https://github.com/dready92)

![](https://www.gravatar.com/avatar/2bc1c9e194a9cdefecaf3503a003b409a7d2bac10f6623e3269a1e153fe97ade?d=identicon)[popojargo](/maintainers/popojargo)

---

Top Contributors

[![popojargo](https://avatars.githubusercontent.com/u/9197078?v=4)](https://github.com/popojargo "popojargo (123 commits)")[![dready92](https://avatars.githubusercontent.com/u/99866?v=4)](https://github.com/dready92 "dready92 (73 commits)")[![ClemensSahs](https://avatars.githubusercontent.com/u/423633?v=4)](https://github.com/ClemensSahs "ClemensSahs (15 commits)")[![danikp](https://avatars.githubusercontent.com/u/3479747?v=4)](https://github.com/danikp "danikp (5 commits)")[![kl3sk](https://avatars.githubusercontent.com/u/2953145?v=4)](https://github.com/kl3sk "kl3sk (3 commits)")[![Linutux](https://avatars.githubusercontent.com/u/435352?v=4)](https://github.com/Linutux "Linutux (2 commits)")[![drlinux](https://avatars.githubusercontent.com/u/954041?v=4)](https://github.com/drlinux "drlinux (2 commits)")[![shr3k](https://avatars.githubusercontent.com/u/1295107?v=4)](https://github.com/shr3k "shr3k (2 commits)")[![SunMar](https://avatars.githubusercontent.com/u/8324268?v=4)](https://github.com/SunMar "SunMar (2 commits)")[![fabriziomorroia](https://avatars.githubusercontent.com/u/89778294?v=4)](https://github.com/fabriziomorroia "fabriziomorroia (1 commits)")[![EcoFreak](https://avatars.githubusercontent.com/u/3418386?v=4)](https://github.com/EcoFreak "EcoFreak (1 commits)")[![nicolaisi](https://avatars.githubusercontent.com/u/2225781?v=4)](https://github.com/nicolaisi "nicolaisi (1 commits)")[![czukowski](https://avatars.githubusercontent.com/u/186792?v=4)](https://github.com/czukowski "czukowski (1 commits)")[![robsonala](https://avatars.githubusercontent.com/u/4273567?v=4)](https://github.com/robsonala "robsonala (1 commits)")[![rpl](https://avatars.githubusercontent.com/u/11484?v=4)](https://github.com/rpl "rpl (1 commits)")[![tm1000](https://avatars.githubusercontent.com/u/564256?v=4)](https://github.com/tm1000 "tm1000 (1 commits)")[![sujeetpillai](https://avatars.githubusercontent.com/u/1405711?v=4)](https://github.com/sujeetpillai "sujeetpillai (1 commits)")[![waffle-iron](https://avatars.githubusercontent.com/u/6912981?v=4)](https://github.com/waffle-iron "waffle-iron (1 commits)")[![fluffis](https://avatars.githubusercontent.com/u/2949679?v=4)](https://github.com/fluffis "fluffis (1 commits)")[![FredericoGauz](https://avatars.githubusercontent.com/u/18327882?v=4)](https://github.com/FredericoGauz "FredericoGauz (1 commits)")

---

Tags

adaptercomposercouchcouchdbphpnosqldbcouchdbdriverapachecouch

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/php-on-couch-php-on-couch/health.svg)

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

###  Alternatives

[dready92/php-on-couch

CouchDB NoSQL database access in PHP

24555.3k1](/packages/dready92-php-on-couch)[datastax/php-driver

DataStax PHP Driver for Apache Cassandra

437521.5k19](/packages/datastax-php-driver)[basho/riak

Official Riak client for PHP

159246.7k7](/packages/basho-riak)[tbolier/php-rethink-ql

A clean and solid RethinkDB driver for PHP.

5211.7k](/packages/tbolier-php-rethink-ql)[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.

205.6k2](/packages/mroosz-php-cassandra)

PHPackages © 2026

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