PHPackages                             deepstreamcentral/deepstream.io-client-curl-php - 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. [API Development](/categories/api)
4. /
5. deepstreamcentral/deepstream.io-client-curl-php

ActiveLibrary[API Development](/categories/api)

deepstreamcentral/deepstream.io-client-curl-php
===============================================

the php client for deepstreamCentral

0202↓100%[3 PRs](https://github.com/Ayush1959/deepstreamhub/pulls)PHP

Since Mar 3Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Ayush1959/deepstreamhub)[ Packagist](https://packagist.org/packages/deepstreamcentral/deepstream.io-client-curl-php)[ RSS](/packages/deepstreamcentral-deepstreamio-client-curl-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

deepstream.io-client-php
========================

[](#deepstreamio-client-php)

PHP Client using the dsh HTTP API

Installing &amp; running tests
==============================

[](#installing--running-tests)

Running the tests is a bit trickier as it requires a two-node deepstream cluster, consisting of a Websocket deepstream with a test-provider that answers RPCs and listens for events and a HTTP deepstream that the actual tests are run against:

[![Diagram](diagram.png)](diagram.png)

- Install PHP - you can get it from e.g.  for windows
- Add the folder with the executables (e.g. php.exe, php-cli.exe) to your path
- Download PHP Unit from
- Move the `phpunit-6.2.1.phar` file to your `deepstream.io-client-php` folder
- Make it executable via

```
chmod +x phpunit.phar
```

- Download a local version of Redis and run it on its default port
- Download the latest deepstream version and unzip it
- run `git clone git@github.com:deepstreamIO/dsx-connection-http.git` in its lib directory
- install the plugin via `yarn install`
- copy the configs in `ds-conf` into your deepstream's conf directory
- install the redis msg connector using `./deepstream.exe install msg redis`
- start two deepstream instances with

```
./deepstream.exe start -c conf/config-http.yml
```

and

```
./deepstream.exe start -c conf/config-ws.yml
```

- install the test provider in the `deepstream.io-client-php`

```
cd test-provider
yarn install
```

- run the test provider

```
node test-provider.js
```

- run the tests using

```
php phpunit-6.2.1.phar --bootstrap src\DeepstreamClient.php test\client-test.php

```

If it all works it looks like this [![Screenshot](screenshot.png)](screenshot.png)

API
---

[](#api)

### `new DeepstreamClient( $url, $authData )`

[](#new-deepstreamclient-url-authdata-)

Creates the deepstream client

```
$client = new DeepstreamClient(
  'https://api.deepstreamcentral.com/api/v1',
  array(
    'token' => 'xxxx-xxxx-xxxx-xxxx'
  )
);
```

### `setRecord( $recordName, [$path], $data )`

[](#setrecord-recordname-path-data-)

Writes full or partial data to a record

```
# Writing full data
$client->setRecord('user/johndoe', array(
  'firstname' => 'John',
  'lastname' => 'Doe',
  'age' => 32,
  'pets' => array('hamster', 'cat')
));

# Writing partial data
$client->setRecord('user/johndoe', 'age', '33');
```

### `$client->getRecord( $recordName )`

[](#client-getrecord-recordname-)

Reads the data for a given record

```
$firstname = $client->getRecord('user/johndoe')->firstname;
```

### `$client->deleteRecord( $recordName )`

[](#client-deleterecord-recordname-)

Deletes a record

```
$client->deleteRecord('user/johndoe');
```

### `$client->getRecordVersion( $recordName )`

[](#client-getrecordversion-recordname-)

Retrieves the current version of a record

```
$version = $client->getRecordVersion('user/johndoe');
```

### `$client->makeRpc( $rpcName, [$data] )`

[](#client-makerpc-rpcname-data-)

Executes a Remote Procedure Call

```
#with data
$twentyfour = $client->makeRpc('multiply-by-two', 12);

#without data
$client->makeRpc('logout');
```

### `$client->emitEvent( $eventName, [$data] )`

[](#client-emitevent-eventname-data-)

Emits an event

```
#with data
$client->emitEvent('new-message', 'hey, what\'s up?');

#without data
$client->emitEvent('ping');
```

### `$client->startBatch()`

[](#client-startbatch)

Starts a set of batch operations that will be executed as a single request

### `$client->executeBatch()`

[](#client-executebatch)

Executes an existing set of batch operations

```
    $client->startBatch()
    $client->emitEvent( 'new-message', 'hey, what\'s up?' );
    $client->getRecord( 'user/johndoe' );
    $client->setRecord( 'user/mike', 'age', 12 );
    $client->executeBatch();
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

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://www.gravatar.com/avatar/57d5386c437852806d72b3a76b2b473b34d39e2446943050663a3d7b3be60376?d=identicon)[Ayush](/maintainers/Ayush)

### Embed Badge

![Health badge](/badges/deepstreamcentral-deepstreamio-client-curl-php/health.svg)

```
[![Health](https://phpackages.com/badges/deepstreamcentral-deepstreamio-client-curl-php/health.svg)](https://phpackages.com/packages/deepstreamcentral-deepstreamio-client-curl-php)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M475](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M186](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M33](/packages/facebook-php-business-sdk)[microsoft/microsoft-graph

The Microsoft Graph SDK for PHP

65723.5M95](/packages/microsoft-microsoft-graph)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)

PHPackages © 2026

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