2017 © Pedro Peláez
 

library php-couchdb

Library for easily talking to CouchDB from PHP

image

ibm-watson-data-lab/php-couchdb

Library for easily talking to CouchDB from PHP

  • Friday, April 6, 2018
  • by lornajane
  • Repository
  • 6 Watchers
  • 9 Stars
  • 107 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 7 Open issues
  • 8 Versions
  • 5 % Grown

The README.md

Build Status, (*1)

PHP CouchDB

:warning: This project is under early and active development. Comments, experimentation and feedback all gratefully received., (*2)

A lightweight library to make it very easy to work with CouchDB from PHP. Uses Guzzle, requires PHP 7+., (*3)

Installation

It's recommended to install this library using Composer:, (*4)

composer require ibm-watson-data-lab/php-couchdb

Usage

Here's the tl;dr of how to begin. For more detailed examples, see the wiki and/or generate the API docs with composer docs, (*5)

<?php

require "vendor/autoload.php";

// connect to CouchDB (does make a call to check we can connect)
$server = new \PHPCouchDB\Server(["url" => "http://localhost:5984"]);

// get a list of databases; each one is a \PHPCouchDB\Database object
$databases = $server->getAllDbs();

// work with the "test" database (also a \PHPCouchDB\Database object)
$test_db = $server->useDb(["name" => "test", "create_if_not_exists" => true]);

// add a document - you may specify the "id" here if you like
$doc = $test_db->create(["name" => "Alice", "interests" => ["eating", "wondering"]]);

// inspect the document
print_r($doc);

// update the document - a NEW document is returned by this operation, showing the server representation of the document
$doc->friends[] = "Cheshire Cat";
$updated_doc = $doc->update();

// done?  Delete the doc
$updated_doc->delete();

For more examples, conflict handling and really everything else, see more detailed documentation on the wiki., (*6)

For Developers

Contributions and issues are all very welcome on this project - and of course we'd love to hear how you're using the library in your own projects., (*7)

For information about working with the project locally or opening pull requests, see [[CONTRIBUTING]]., (*8)

The Versions

06/04 2018

dev-master

9999999-dev

Library for easily talking to CouchDB from PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Lorna Jane Mitchell

09/03 2018

0.1.2

0.1.2.0

Library for easily talking to CouchDB from PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Lorna Jane Mitchell

09/03 2018

dev-class-constants

dev-class-constants

Library for easily talking to CouchDB from PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Lorna Jane Mitchell

20/02 2018

0.1.1

0.1.1.0

Library for easily talking to CouchDB from PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Lorna Jane Mitchell

20/02 2018

dev-add-user-agent

dev-add-user-agent

Library for easily talking to CouchDB from PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Lorna Jane Mitchell

29/12 2017

dev-docs-no-docs

dev-docs-no-docs

Library for easily talking to CouchDB from PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Lorna Jane Mitchell

27/11 2017

dev-remove-extra-request

dev-remove-extra-request

Library for easily talking to CouchDB from PHP

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Lorna Jane Mitchell

11/08 2017

v0.1.0

0.1.0.0

Library for easily talking to CouchDB from PHP

  Sources   Download

Apache

The Requires

 

The Development Requires

by Lorna Jane Mitchell