A CouchDB Client for >=PHP 5.5 with event system.
Inspired by Doctrine/MongoDB and Doctrine/CouchDB
Composer (recommend)
You can install CouchDB Client over composer. Add the following line into your composer.json
file.
$ composer require baachi/couchdb
Git
You can clone the repository:
git clone https://github.com/Baachi/CouchDB.git
or if you already use git in your project
git submodule add https://github.com/Baachi/CouchDB.git
$client = new \GuzzleHttp\Client(['base_uri' => 'http://localhost:5984', 'http_errors' => false]);
$connection = new \CouchDB\Connection($client);
$database = $conn->createDatabase('foobar');
// or with magic method
$database = $conn->foobar;
$database = $conn->selectDatabase('foobar');
// or with magic method
$database = $conn->foobar;
if (true === $conn->hasDatabase('foobar')) {
$conn->dropDatabase('foobar');
}
// or with magic methods
if (isset($conn->foobar)){
unset($conn->foobar);
}
The testsuite can you find in the tests
folder.
Run the testsuite:
phpunit
It is green?
- Markus Bachmann markus.bachmann@bachi.biz
- [All contributors] (https://github.com/Baachi/CouchDB/contributors)
CouchDB Client is released under the MIT License. See the bundled LICENSE file for details.