2017 © Pedro PelĂĄez
 

library php-on-couch

CouchDB NoSQL database access in PHP

image

php-on-couch/php-on-couch

CouchDB NoSQL database access in PHP

  • Wednesday, June 13, 2018
  • by ClemensSahs
  • Repository
  • 11 Watchers
  • 47 Stars
  • 5,281 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 90 Forks
  • 5 Open issues
  • 14 Versions
  • 23 % Grown

The README.md

Latest Stable VersionLatest Unstable VersionBuild StatusDocumentation StatusScrutinizer Code QualitycodecovLicense, (*1)

:fire:For the complete documentation, visit http://php-on-couch.readthedocs.io :fire:, (*2)

Table of content

Introduction

PHP On Couch provides an easy way to work with your CouchDB documents with PHP., (*3)

Supports PHP 5.6 and higher 🚀, (*4)

Recent changes

For the complete change list, head over here, (*5)

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., (*6)

To test the the application, see this topic., (*7)

Components and documentation

For the full API document, please visite this link, (*8)

Example

For full examples, refer to the database example or the document example., (*9)

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., (*10)

use  PHPOnCouch\CouchClient; //The CouchDB client object

Here's an example for basic operations, (*11)

// 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() . "<BR>\n";
}

Here's a quick example of how to fetch a view, (*12)

// 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() . "<BR>\n";
}

Finally, how to use the CouchDocument class., (*13)

//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

Contributions

Feel free to make any contributions. All contributions must follow the code style and must also comes with valid and complete tests., (*14)

Help is really appreciated to complete add more tests., (*15)

Feedback

Gitter chat, (*16)

Don't hesitate to submit feedback, bugs and feature requests ! Our contact address is phponcouch@gmail.com, (*17)

The Versions

13/06 2018

dev-feature/scheduler

dev-feature/scheduler https://github.com/PHP-on-Couch/PHP-on-Couch

CouchDB NoSQL database access in PHP

  Sources   Download

GPL-3.0-or-later

The Requires

 

The Development Requires

nosql couchdb driver apache db couch

17/05 2018

dev-master

9999999-dev https://github.com/PHP-on-Couch/PHP-on-Couch

CouchDB NoSQL database access in PHP

  Sources   Download

GPLv3 GPL-3.0-or-later

The Requires

 

The Development Requires

nosql couchdb driver apache db couch

17/05 2018

2.0.6a

2.0.6.0-alpha https://github.com/PHP-on-Couch/PHP-on-Couch

CouchDB NoSQL database access in PHP

  Sources   Download

GPLv3

The Requires

 

The Development Requires

nosql couchdb driver apache db couch

27/11 2017

2.0.5

2.0.5.0 https://github.com/PHP-on-Couch/PHP-on-Couch

CouchDB NoSQL database access in PHP

  Sources   Download

GPLv3

The Requires

 

The Development Requires

nosql couchdb driver apache db couch

27/11 2017

dev-feature/change_couchdb_docker

dev-feature/change_couchdb_docker https://github.com/PHP-on-Couch/PHP-on-Couch

CouchDB NoSQL database access in PHP

  Sources   Download

GPLv3

The Requires

 

The Development Requires

nosql couchdb driver apache db couch

01/10 2017

2.0.4

2.0.4.0 https://github.com/PHP-on-Couch/PHP-on-Couch

CouchDB NoSQL database access in PHP

  Sources   Download

GPLv3

The Requires

 

The Development Requires

nosql couchdb driver apache db couch

24/05 2017

2.0.3

2.0.3.0 https://github.com/PHP-on-Couch/PHP-on-Couch

CouchDB NoSQL database access in PHP

  Sources   Download

GPLv3

The Requires

  • php >=5.2.0

 

The Development Requires

nosql couchdb driver apache db couch

19/03 2017

2.0.2

2.0.2.0 https://github.com/PHP-on-Couch/PHP-on-Couch

CouchDB NoSQL database access in PHP

  Sources   Download

GPLv3

The Requires

  • php >=5.2.0

 

The Development Requires

nosql couchdb driver apache db couch

15/02 2017

1.6.1.x-dev

1.6.1.9999999-dev https://github.com/popojargo/PHP-on-Couch

CouchDB NoSQL database access in PHP

  Sources   Download

GPLv3

The Requires

  • php >=5.2.0

 

The Development Requires

nosql couchdb driver apache db couch

31/01 2017

2.0.1

2.0.1.0 https://github.com/popojargo/PHP-on-Couch

CouchDB NoSQL database access in PHP

  Sources   Download

GPLv3

The Requires

  • php >=5.2.0

 

The Development Requires

nosql couchdb driver apache db couch

31/01 2017

1.6.1

1.6.1.0 https://github.com/popojargo/PHP-on-Couch

CouchDB NoSQL database access in PHP

  Sources   Download

GPLv3

The Requires

  • php >=5.2.0

 

The Development Requires

nosql couchdb driver apache db couch

15/10 2013

dev-forked_master

dev-forked_master https://github.com/dready92/PHP-on-Couch

CouchDB NoSQL database access in PHP

  Sources   Download

GPLv3

The Requires

  • php >=5.2.0

 

nosql couchdb driver apache db couch

03/04 2013

1.0.1-p2

1.0.1.0-patch2 https://github.com/dready92/PHP-on-Couch

CouchDB NoSQL database access in PHP

  Sources   Download

GPLv3

The Requires

  • php >=5.2.0

 

nosql couchdb driver apache db couch

14/03 2013

1.0.1-p1

1.0.1.0-patch1 https://github.com/dready92/PHP-on-Couch

CouchDB NoSQL database access in PHP

  Sources   Download

GPLv3

The Requires

  • php >=5.2.0

 

nosql couchdb driver apache db couch