PHPackages                             bee/client - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. bee/client

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

bee/client
==========

PHP client for Bee.

18PHP

Since Sep 14Pushed 8y ago1 watchersCompare

[ Source](https://github.com/wprayudo/client)[ Packagist](https://packagist.org/packages/bee/client)[ RSS](/packages/bee-client/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHP client for Bee
==================

[](#php-client-for-bee)

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

[](#installation)

The recommended way to install the library is through [Composer](http://getcomposer.org):

```
$ composer require bee/client:@dev
```

Usage
-----

[](#usage)

```
use Bee\Client\Client;
use Bee\Client\Connection\StreamConnection;
use Bee\Client\Packer\PurePacker;

$conn = new StreamConnection();
// or
// $conn = new StreamConnection('tcp://127.0.0.1:3301', [
//     'socket_timeout' => 5.0,
//     'connect_timeout' => 5.0,
//     'tcp_nodelay' => true,
// ]);
// or
// $conn = new StreamConnection('unix:///tmp/bee_instance.sock');

$client = new Client($conn, new PurePacker());
// or
// $client = new Client($conn, new PeclPacker());

// if authentication credentials are required
// $client->authenticate('username', 'userpass');

$space = $client->getSpace('my_space');

// Selecting all data
$result = $space->select();
var_dump($result->getData());

// Result: inserted tuple { 1, 'foo', 'bar' }
$space->insert([1, 'foo', 'bar']);

// Result: inserted tuple { 2, 'baz', 'qux'}
$space->upsert([2, 'baz', 'qux'], [['=', 1, 'BAZ'], ['=', 2, 'QUX']]);

// Result: updated tuple { 2, 'baz', 'qux'} with { 2, 'BAZ', 'QUX' }
$space->upsert([2, 'baz', 'qux'], [['=', 1, 'BAZ'], ['=', 2, 'QUX']]);

$result = $client->evaluate('return ...', [42]);
var_dump($result->getData());

$result = $client->call('box.stat');
var_dump($result->getData());
```

> *Note*
>
> Using packer classes provided by the library require to install additional dependencies, which are not bundled with the library directly. Therefore, you have to install them manually. For example, if you plan to use PurePacker, install the [rybakit/msgpack](https://github.com/rybakit/msgpack.php#installation) package. See the "[suggest](composer.json#L21-L22)" section of composer.json for other alternatives.

Tests
-----

[](#tests)

To run unit tests:

```
$ phpunit --testsuite Unit
```

To run integration tests:

```
$ phpunit --testsuite Integration
```

> Make sure to start [client.lua](tests/Integration/client.lua) first.

To run all tests:

```
$ phpunit
```

If you already have Docker installed, you can run the tests in a docker container. First, create a container:

```
$ ./dockerfile.py | docker build -t client -
```

The command above will create a container named `client` with PHP 7.1 runtime. You may change the default runtime by defining the `IMAGE` environment variable:

```
$ IMAGE='php:7.0-cli' ./dockerfile.py | docker build -t client -
```

> See a list of various images [here](.travis.yml#L9-L26).

Then run Bee instance (needed for integration tests):

```
$ docker network create bee-php
$ docker run -d --net=bee-php --name=bee -v `pwd`:/client \
    bee/bee:1.7 bee /client/tests/Integration/client.lua
```

And then run both unit and integration tests:

```
$ docker run --rm --net=bee-php --name client -v $(pwd):/client -w /client client
```

License
-------

[](#license)

WTF license

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1198588?v=4)[wprayudo](/maintainers/wprayudo)[@wprayudo](https://github.com/wprayudo)

---

Top Contributors

[![wprayudo](https://avatars.githubusercontent.com/u/1198588?v=4)](https://github.com/wprayudo "wprayudo (4 commits)")

### Embed Badge

![Health badge](/badges/bee-client/health.svg)

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

###  Alternatives

[cshaptx4869/html2word

html to word

131.0k](/packages/cshaptx4869-html2word)

PHPackages © 2026

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