C PHP C++ Other
Pull request Compare This branch is 49 commits ahead, 5 commits behind brett19:master.
Latest commit 36a12c0 Jul 18, 2016 @avsej avsej PCBC-414: return $this from N1qlQuery methods
Change-Id: I7d316b09fe82b1d4d757610e814bf0469a42c1b1
Reviewed-on: http://review.couchbase.org/65892
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Failed to load latest commit information.
examples PCBC-394: expose CAS as a string May 17, 2016
fastlz PCBC-366: Correct issue with legacy transcoder compression. Nov 4, 2015
stub PCBC-414: return $this from N1qlQuery methods Jul 18, 2016
tests PCBC-407: encode fields for N1QL index as JSON array Jun 25, 2016
.gitignore PCBC-394: expose CAS as a string May 17, 2016
.travis.yml Initial Commit Apr 24, 2014
LICENSE Initial Commit Apr 24, 2014
README.md Updated README to reflect work on PHP7. Mar 8, 2016
bucket.c PCBC-393: Add support for enhanced durability Jul 6, 2016
bucket.h PCBC-380: support AT_PLUS consistency Jun 27, 2016
cas.c Update library to v3 LCB API May 24, 2016
cas.h Update library to v3 LCB API May 24, 2016
cbft.c PCBC-381: support for Full Text Search queries Jun 25, 2016
cluster.c Update library to v3 LCB API May 24, 2016
cluster.h Update library to v3 LCB API May 24, 2016
config.m4 PCBC-380: support AT_PLUS consistency Jun 27, 2016
config.w32 PCBC-380: support AT_PLUS consistency Jun 27, 2016
couchbase.c PCBC-380: support AT_PLUS consistency Jun 27, 2016
couchbase.h PCBC-381: support for Full Text Search queries Jun 25, 2016
counter.c PCBC-380: support AT_PLUS consistency Jun 27, 2016
datainfo.h Update library to v3 LCB API May 24, 2016
docfrag.c PCBC-380: support AT_PLUS consistency Jun 27, 2016
docfrag.h PCBC-380: support AT_PLUS consistency Jun 27, 2016
durability.c PCBC-380: support AT_PLUS consistency Jun 27, 2016
exception.c Update library to v3 LCB API May 24, 2016
exception.h Update library to v3 LCB API May 24, 2016
genphpfile.sh PCBC-381: support for Full Text Search queries Jun 25, 2016
get.c PCBC-380: support AT_PLUS consistency Jun 27, 2016
http.c Do not include datainfo.h everywhere to avoid symbol duplicates Jun 8, 2016
metadoc.c PCBC-380: support AT_PLUS consistency Jun 27, 2016
metadoc.h PCBC-380: support AT_PLUS consistency Jun 27, 2016
n1ix_create.c Do not include datainfo.h everywhere to avoid symbol duplicates Jun 8, 2016
n1ix_drop.c Do not include datainfo.h everywhere to avoid symbol duplicates Jun 8, 2016
n1ix_list.c Do not include datainfo.h everywhere to avoid symbol duplicates Jun 8, 2016
n1ix_spec.c PCBC-385 N1QL index management May 24, 2016
n1ix_spec.h PCBC-385 N1QL index management May 24, 2016
n1ql.c Do not include datainfo.h everywhere to avoid symbol duplicates Jun 8, 2016
opcookie.c Update library to v3 LCB API May 24, 2016
opcookie.h Update library to v3 LCB API May 24, 2016
package2.xml Release 2.2.0 GA Jul 6, 2016
paramparser.c Fix jenkins build May 25, 2016
paramparser.h Update library to v3 LCB API May 24, 2016
php_couchbase.h Release 2.2.0 GA Jul 6, 2016
phpstubstr.h PCBC-414: return $this from N1qlQuery methods Jul 18, 2016
remove.c Do not include datainfo.h everywhere to avoid symbol duplicates Jun 8, 2016
store.c PCBC-393: Add support for enhanced durability Jul 6, 2016
subdoc.c PCBC-380: support AT_PLUS consistency Jun 27, 2016
token.c PCBC-380: support AT_PLUS consistency Jun 27, 2016
token.h PCBC-380: support AT_PLUS consistency Jun 27, 2016
touch.c Do not include datainfo.h everywhere to avoid symbol duplicates Jun 8, 2016
transcoding.c Update library to v3 LCB API May 24, 2016
transcoding.h Update library to v3 LCB API May 24, 2016
unlock.c PCBC-380: support AT_PLUS consistency Jun 27, 2016
zap.h Update library to v3 LCB API May 24, 2016

README.md

Couchbase PHP Client

This library allows you to connect to a Couchbase cluster from PHP. It is a native PHP extension and uses the very fast libcouchbase library to handle communicating to the cluster over the Couchbase binary protocol.

Build Status

Useful Links

Source - http://github.com/couchbaselabs/php-couchbase

Bug Tracker - http://www.couchbase.com/issues/browse/PCBC

Couchbase PHP Community - http://couchbase.com/communities/php

Installing

This iteration of the Couchbase PHP client is not currently available via PECL, and as such must be compiled manually in order to be used. The extension will become available via PECL once it leaves the DP phase. Until then, you may install by downloading a prebuilt binary of the DP available on couchbase.com for the Windows platform, or by checking out the repository and building it directly:

phpize
./configure --enable-couchbase
make && make install

Introduction

Connecting to a Couchbase bucket is as simple as creating a new Connection instance. Once you are connect, you may execute any of Couchbases' numerous operations against this connection.

Here is a simple example of instantiating a connection, setting a new document into the bucket and then retrieving its contents:

  $cluster = new CouchbaseCluster('192.168.7.26');
  $db = $cluster->openBucket('default');
  $db->upsert('testdoc', array('name'=>'Frank'));
  $res = $db->get('testdoc');
  var_dump($res->value);
  // array(1) {
  //   ["name"]=>
  //   string(5) "Frank"
  // }

Version Support

As of March 2016, this extension supports PHP 5.x releases and is being ported to PHP 7. Contributions toward that update are welcome! The work in progress is posted at http://review.couchbase.org/#/c/58547/

Documentation

An extensive documentation is available on the Couchbase website. Visit our PHP Community on the Couchbase website for the documentation as well as numerous examples and samples.

Source Control

The source code is available at https://github.com/couchbaselabs/php-couchbase.

To execute our test suite, simply install and execute phpunit against your checked out source code.

License

Copyright 2016 Couchbase Inc.

Licensed under the Apache License, Version 2.0.

See LICENSE for further details.