PHPackages                             moon/couchbaserestclient - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. moon/couchbaserestclient

ActiveLibrary[HTTP &amp; Networking](/categories/http)

moon/couchbaserestclient
========================

v0.1(8y ago)012PHP

Since Feb 19Pushed 7y ago1 watchersCompare

[ Source](https://github.com/moon0326/php-couchbase-rest-api-client)[ Packagist](https://packagist.org/packages/moon/couchbaserestclient)[ RSS](/packages/moon-couchbaserestclient/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

Couchbase REST API Client
=========================

[](#couchbase-rest-api-client)

Couchbase REST API wrapper to easily access view and n1ql queries without installing Couchbase C and PHP SDK.

Installation
------------

[](#installation)

```
composer require moon/couchbaserestclient

```

Advantages
----------

[](#advantages)

- Access Couchbase wihtout installing C and PHP SDK.
- Supports parallel query processing by using multi-curl.

Accessing Couchbase without installing C and PHP SDK is nice, but it is really not a big advantage as you don't really uninstall C and PHP SDKs once you install them. Couchbase has batch operations ([https://developer.couchbase.com/documentation/server/current/sdk/php/document-operations.html#topic\_eqq\_rmd\_yv\_\_batching](https://developer.couchbase.com/documentation/server/current/sdk/php/document-operations.html#topic_eqq_rmd_yv__batching)), which let you insert/get multiple docs even in PHP. However, You can't send multiple n1ql queries in parallel in the PHP SDK. One thing I find very useful with Couchbase REST API approach is that you can send multiple update requests in parallel, which is not possible (or hard) with the official PHP SDK.

Disadvantage
------------

[](#disadvantage)

- Couchbase Rest API endpoint may not perform as good as its official SDK, which takes advantage of its optimized protocol.

Setup
-----

[](#setup)

### Usage

[](#usage)

Create an instance of `CouchbaseRestApiClient`

```
$client = new CouchbaseRestApiClient("http://couchbase:8091", "username", "password");
$client->setN1qlHost("http://couchbase:8093/service/query");
```

#### Querying View

[](#querying-view)

```
$paginator = $client->createViewPaginator('designDocumentName', 'viewName');
$paginator->setStartKey("startKey");
foreach ($paginator as $page) {
    var_dump($page);
}
```

#### Querying N1QL

[](#querying-n1ql)

##### Synchronous Query

[](#synchronous-query)

```
$query = "select * from testBucket use keys ['testKey']";
$response = $client->queryN1ql($query);
var_dump($response);
```

##### Parallel Query

[](#parallel-query)

You can send multiple queries to Couchbase by using `ParallelQueryQueue`.

```
// Let's send 30 queries at once
$parallelQueryQueue = $client->createParallelQueryQueue(30);

// queue 90 queries
for($i=0; $iqueue("update myBucket use keys ['{$key}'] set index=$i";
}

// run
while($responses = $parallelQueryQueue->next()) {

}
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

3007d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/737453219c222a6a34e24e2883c2225d19753a1032b38f4b13eab490b928079e?d=identicon)[moon0326](/maintainers/moon0326)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/moon-couchbaserestclient/health.svg)

```
[![Health](https://phpackages.com/badges/moon-couchbaserestclient/health.svg)](https://phpackages.com/packages/moon-couchbaserestclient)
```

###  Alternatives

[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[omniphx/forrest

A Laravel library for Salesforce

2724.4M8](/packages/omniphx-forrest)[akamai-open/edgegrid-client

Implements the Akamai {OPEN} EdgeGrid Authentication specified by https://developer.akamai.com/introduction/Client\_Auth.html

482.5M6](/packages/akamai-open-edgegrid-client)[muhammadhuzaifa/telescope-guzzle-watcher

Telescope Guzzle Watcher provide a custom watcher for intercepting http requests made via guzzlehttp/guzzle php library. The package uses the on\_stats request option for extracting the request/response data. The watcher intercept and log the request into the Laravel Telescope HTTP Client Watcher.

98239.8k1](/packages/muhammadhuzaifa-telescope-guzzle-watcher)[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34170.2k2](/packages/onesignal-onesignal-php-api)[ory/hydra-client-php

Documentation for all of Ory Hydra's APIs.

1710.8k](/packages/ory-hydra-client-php)

PHPackages © 2026

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