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

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

socalnick/orchestrate-php-client
================================

A PHP client for Orchestrate.io

0.6.0(10y ago)311.2k5[4 issues](https://github.com/SocalNick/orchestrate-php-client/issues)BSD 3-ClausePHPPHP &gt;=5.5.0

Since Mar 17Pushed 8y ago4 watchersCompare

[ Source](https://github.com/SocalNick/orchestrate-php-client)[ Packagist](https://packagist.org/packages/socalnick/orchestrate-php-client)[ RSS](/packages/socalnick-orchestrate-php-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (2)Versions (8)Used By (0)

[Orchestrate is no longer a service](https://news.ycombinator.com/item?id=12936031)
===================================================================================

[](#orchestrate-is-no-longer-a-service)

Orchestrate PHP Client
======================

[](#orchestrate-php-client)

A PHP client for [Orchestrate.io](http://orchestrate.io).

[![Build Status](https://camo.githubusercontent.com/5c458dd8f2c303486544ccbb2bfe004ad1cc26a9a0de43f7cc1b0c5433454e08/68747470733a2f2f7472617669732d63692e6f72672f536f63616c4e69636b2f6f726368657374726174652d7068702d636c69656e742e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/SocalNick/orchestrate-php-client)[![Latest Stable Version](https://camo.githubusercontent.com/9482b3f83ad77f463f06a36a0d086752524b5ed0580acc332da5e93586abfe35/68747470733a2f2f706f7365722e707567782e6f72672f736f63616c6e69636b2f6f726368657374726174652d7068702d636c69656e742f762f737461626c652e737667)](https://packagist.org/packages/socalnick/orchestrate-php-client) [![Total Downloads](https://camo.githubusercontent.com/c744e9632d95651608425f9f0b9d24d2eab80152731da1e08d417ffbfe1e4a58/68747470733a2f2f706f7365722e707567782e6f72672f736f63616c6e69636b2f6f726368657374726174652d7068702d636c69656e742f646f776e6c6f6164732e737667)](https://packagist.org/packages/socalnick/orchestrate-php-client) [![Latest Unstable Version](https://camo.githubusercontent.com/1956878e6f9b1c29904216e9a9d932f93bc14726fe22436a8561eb22efbc7353/68747470733a2f2f706f7365722e707567782e6f72672f736f63616c6e69636b2f6f726368657374726174652d7068702d636c69656e742f762f756e737461626c652e737667)](https://packagist.org/packages/socalnick/orchestrate-php-client) [![License](https://camo.githubusercontent.com/03f60cfed8c4cf76fb2fcc1c7b906ab344f9a759700d1555a66527836bd85655/68747470733a2f2f706f7365722e707567782e6f72672f736f63616c6e69636b2f6f726368657374726174652d7068702d636c69656e742f6c6963656e73652e737667)](https://packagist.org/packages/socalnick/orchestrate-php-client)

**Table of Contents**

- [Installation](#installation)
- [Creating a Client](#creating-a-client)
- [Key / Value Operations](#key--value-operations)
- [Search](#search)
- [Events](#events)
- [Graph](#graph)

Installation
============

[](#installation)

```
$ composer require socalnick/orchestrate-php-client

```

Creating a Client
=================

[](#creating-a-client)

Default to Amazon US East
-------------------------

[](#default-to-amazon-us-east)

```
use SocalNick\Orchestrate\Client;
$client = new Client('your-api-key');
```

Use Amazon EU West
------------------

[](#use-amazon-eu-west)

```
use SocalNick\Orchestrate\Client;
$client = new Client('your-api-key', 'https://api.aws-eu-west-1.orchestrate.io/v0/');
```

Key / Value Operations
======================

[](#key--value-operations)

Put (also used to create a collection)
--------------------------------------

[](#put-also-used-to-create-a-collection)

```
use SocalNick\Orchestrate\KvPutOperation;
$kvPutOp = new KvPutOperation("first_collection", "first_key", json_encode(array("name" => "Nick")));
$kvObject = $client->execute($kvPutOp);
$ref = $kvObject->getRef(); // 741357981fd7b5cb
```

Put if-match
------------

[](#put-if-match)

```
use SocalNick\Orchestrate\KvPutOperation;
$kvPutOp = new KvPutOperation("first_collection", "second_key", json_encode(array("name" => "Terry")), array('if-match' => '741357981fd7b5cb'));
$kvObject = $client->execute($kvPutOp);
$ref = $kvObject->getRef(); // 0d1f15ab524a5c5a
```

Put if-none-match
-----------------

[](#put-if-none-match)

```
use SocalNick\Orchestrate\KvPutOperation;
$kvPutOp = new KvPutOperation("first_collection", "second_key", json_encode(array("name" => "Bill")), array('if-none-match' => '*'));
$kvObject = $client->execute($kvPutOp); // null
```

Post (auto-generated key)
-------------------------

[](#post-auto-generated-key)

```
use SocalNick\Orchestrate\KvPostOperation;
$kvPostOp = new KvPostOperation("first_collection", json_encode(array("name" => "Nick")));
$kvObject = $client->execute($kvPostOp);
$ref = $kvObject->getRef(); // 741357981fd7b5cb
$key = $kvObject->getKey(); // 05fb279bc820dd05
```

Patch (partial update - operations)
-----------------------------------

[](#patch-partial-update---operations)

```
use SocalNick\Orchestrate\KvPatchOperationsOperation;
$kvPatchOperationsOp = new KvPatchOperationsOperation('first_collection', 'third_key');
$kvPatchOperationsOp
  ->add('birth_place.city', 'New York')
  ->remove('birth_place.country')
  ->replace('birth_place.state', 'New York')
  ->copy('full_name', 'name')
  ->test('age', 28)
  ->inc('age', 1)
  ->inc('years_until_death', -1);
$result = $client->execute($kvPatchOperationsOp);
```

Patch (partial update - merge)
------------------------------

[](#patch-partial-update---merge)

```
use SocalNick\Orchestrate\KvPatchMergeOperation;
$partial = [
  'birth_place' => [
    'city' => 'New York',
    'country' => null,
    'state' => 'New York',
  ],
  'first_name' => null,
  'deprecated_first_name' => 'John',
  'name' => 'John Foster',
  'age' => 29,
  'years_until_death' => 39,
];
$kvPatchMergeOp = new KvPatchMergeOperation('first_collection', 'third_key', json_encode($partial));
$result = self::$client->execute($kvPatchMergeOp);
```

Get
---

[](#get)

```
use SocalNick\Orchestrate\KvFetchOperation;
$kvFetchOp = new KvFetchOperation("films", "the_godfather");
$kvObject = $client->execute($kvFetchOp);
$ref = $kvObject->getRef(); // 9c1bc18e60d93848
```

Get a previous version by ref
-----------------------------

[](#get-a-previous-version-by-ref)

```
use SocalNick\Orchestrate\KvFetchOperation;
$kvFetchOp = new KvFetchOperation("first_collection", "second_key", "741357981fd7b5cb");
$kvObject = $client->execute($kvFetchOp);
$ref = $kvObject->getRef(); // 741357981fd7b5cb
```

Delete
------

[](#delete)

```
use SocalNick\Orchestrate\KvDeleteOperation;
$kvDeleteOp = new KvDeleteOperation("first_collection", "first_key");
$result = $client->execute($kvDeleteOp); // true
```

Delete with purge
-----------------

[](#delete-with-purge)

```
use SocalNick\Orchestrate\KvDeleteOperation;
$kvDeleteOp = new KvDeleteOperation("first_collection", "first_key", true);
$result = $client->execute($kvDeleteOp); // true
```

List
----

[](#list)

```
use SocalNick\Orchestrate\KvListOperation;
$kvListOp = new KvListOperation("films");
$kvListObject = $client->execute($kvListOp);
$count = $kvListObject->count(); // 10
$link = $kvListObject->getLink(); // /v0/films?limit=10&afterKey=the_godfather_part_2
```

List with inclusive start key
-----------------------------

[](#list-with-inclusive-start-key)

```
use SocalNick\Orchestrate\KvListOperation;
$kvListOp = new KvListOperation("films", 5, 'anchorman');
$kvListObject = $client->execute($kvListOp);
$count = $kvListObject->count(); // 5
$link = $kvListObject->getLink(); // /v0/films?limit=5&afterKey=pulp_fiction
```

List with exclusive after key
-----------------------------

[](#list-with-exclusive-after-key)

```
use SocalNick\Orchestrate\KvListOperation;
$kvListOp = new KvListOperation("films", 5, null, 'anchorman');
$kvListObject = $client->execute($kvListOp);
$count = $kvListObject->count(); // 5
$link = $kvListObject->getLink(); // /v0/films?limit=5&afterKey=shawshank_redemption
```

Delete collection
-----------------

[](#delete-collection)

```
use SocalNick\Orchestrate\CollectionDeleteOperation;
$cDeleteOp = new CollectionDeleteOperation("first_collection");
$result = $client->execute($cDeleteOp); // true
```

Search
======

[](#search)

Default Search
--------------

[](#default-search)

```
use SocalNick\Orchestrate\SearchOperation;
$searchOp = new SearchOperation("films");
$searchResult = $client->execute($searchOp);
$count = $searchResult->count(); // 10
$total = $searchResult->totalCount(); // 12
```

Search with query, limit, offset, and sort
------------------------------------------

[](#search-with-query-limit-offset-and-sort)

```
use SocalNick\Orchestrate\SearchOperation;
$searchOp = new SearchOperation("films", "Genre:*Crime*", 2, 2, 'value.Title:asc');
$searchResult = $client->execute($searchOp);
$count = $searchResult->count(); // 2
$total = $searchResult->totalCount(); // 8
$firstKey = $searchResult->getValue()['results'][0]['path']['key']; // lock_stock_and_two_smoking_barrels
```

Search aggregate
----------------

[](#search-aggregate)

```
use SocalNick\Orchestrate\SearchAggregateOperation;
$searchOp = new SearchAggregateOperation("films", 'value.imdbRating:stats');
$searchResult = $client->execute($searchOp);
$min = $searchResult->getValue()['aggregates'][0]['statistics']['min']; // 5.9
$max = $searchResult->getValue()['aggregates'][0]['statistics']['max']; // 9.3
```

Events
======

[](#events)

Post defaults to now
--------------------

[](#post-defaults-to-now)

```
use SocalNick\Orchestrate\EventPostOperation;
$evPostOp = new EventPostOperation("films", "pulp_fiction", "comment", json_encode(array("message" => "This is my favorite movie!")));
$evPostResult = $client->execute($evPostOp); // instance_of SocalNick\Orchestrate\EventUpsertResult
```

Post with timestamp
-------------------

[](#post-with-timestamp)

```
use SocalNick\Orchestrate\EventPostOperation;
$evPostOp = new EventPostOperation("films", "pulp_fiction", "comment", json_encode(array("message" => "This is my favorite movie!")), 1395029140000);
$evPostResult = $client->execute($evPostOp); // instance_of SocalNick\Orchestrate\EventUpsertResult
```

Get (an individual event)
-------------------------

[](#get-an-individual-event)

```
use SocalNick\Orchestrate\EventFetchOperation;
$evFetchOp = new EventFetchOperation("films", "pulp_fiction", "comment", $evPostResult->getTimestamp(), $evPostResult->getOrdinal());
$evObject = $client->execute($evFetchOp);
$message = $evObject->getValue()['value']['message']; // This is my favorite movie!
```

Put (update an existing event)
------------------------------

[](#put-update-an-existing-event)

```
use SocalNick\Orchestrate\EventPutOperation;
$evPutOp = new EventPutOperation("films", "pulp_fiction", "comment", json_encode(array("message" => "This is still my favorite movie!")), $evPostResult->getTimestamp(), $evPostResult->getOrdinal());
$evPutResult = $client->execute($evPutOp); // instance_of SocalNick\Orchestrate\EventUpsertResult
```

Put with ref (update an existing event if ref matches)
------------------------------------------------------

[](#put-with-ref-update-an-existing-event-if-ref-matches)

```
use SocalNick\Orchestrate\EventPutOperation;
$evPutOp = new EventPutOperation("films", "pulp_fiction", "comment", json_encode(array("message" => "Seriously, this is still my favorite movie!")), $evPostResult->getTimestamp(), $evPostResult->getOrdinal(), $evPutResult->getRef());
$evPutResult = $client->execute($evPutOp); // instance_of SocalNick\Orchestrate\EventUpsertResult
```

Delete
------

[](#delete-1)

```
use SocalNick\Orchestrate\EventDeleteOperation;
$evDeleteOp = new EventDeleteOperation("films", "pulp_fiction", "comment", $evPutResult->getTimestamp(), $evPutResult->getOrdinal(), true);
$result = $client->execute($evDeleteOp); // true
```

Delete with ref (only delete if ref matches)
--------------------------------------------

[](#delete-with-ref-only-delete-if-ref-matches)

```
use SocalNick\Orchestrate\EventDeleteOperation;
$evDeleteOp = new EventDeleteOperation("films", "pulp_fiction", "comment", $evPutResult->getTimestamp(), $evPutResult->getOrdinal(), true, $evPutResult->getRef());
$result = $client->execute($evDeleteOp); // true
```

List
----

[](#list-1)

```
use SocalNick\Orchestrate\EventListOperation;
$evListOp = new EventListOperation("films", "pulp_fiction", "comment");
$evListObject = $client->execute($evListOp);
$evListObject->count(); // 10
```

List with limit
---------------

[](#list-with-limit)

```
use SocalNick\Orchestrate\EventListOperation;
$evListOp = new EventListOperation("films", "pulp_fiction", "comment", 20);
$evListObject = $client->execute($evListOp);
$evListObject->count(); // 20
```

List with range queries
-----------------------

[](#list-with-range-queries)

The range parameters are formatted as "$timestamp/$ordinal" where $ordinal is optional. The timestamp value should be formatted as described in [timestamps](https://orchestrate.io/docs/apiref#events-timestamps).

```
use SocalNick\Orchestrate\EventListOperation;
$evListOp = new EventListOperation("films", "pulp_fiction", "comment", 20, $startEvent, $afterEvent, $beforeEvent, $endEvent);
$evListObject = $client->execute($evListOp);
```

Graph
=====

[](#graph)

Put
---

[](#put)

```
use SocalNick\Orchestrate\GraphPutOperation;
$graphPutOp = new GraphPutOperation("films", "the_godfather", "sequel", "films", "the_godfather_part_2");
$result = $client->execute($graphPutOp); // true

$graphPutOp = new GraphPutOperation("films", "the_godfather_part_2", "sequel", "films", "the_godfather_part_3");
$result = $client->execute($graphPutOp); // true
```

Get
---

[](#get-1)

```
use SocalNick\Orchestrate\GraphFetchOperation;
$graphFetchOp = new GraphFetchOperation("films", "the_godfather", "sequel/sequel");
$graphObject = $client->execute($graphFetchOp);
$count = $graphObject->count(); // 1
```

Get with limit and offset
-------------------------

[](#get-with-limit-and-offset)

```
use SocalNick\Orchestrate\GraphFetchOperation;
$graphFetchOp = new GraphFetchOperation("directors", "francis_ford_coppola", "films_directed", 1, 1);
$graphObject = $client->execute($graphFetchOp);
$count = $graphObject->count(); // 1
$next = $graphObject->getNext(); // /v0/directors/francis_ford_coppola/relations/films_directed?limit=1&offset=2
$prev = $graphObject->getPrev(); // /v0/directors/francis_ford_coppola/relations/films_directed?limit=1&offset=0
```

Delete
------

[](#delete-2)

```
use SocalNick\Orchestrate\GraphDeleteOperation;
$graphDeleteOp = new GraphDeleteOperation("films", "the_godfather", "sequel", "films", "the_godfather_part_2");
$result = $client->execute($graphDeleteOp); // true

$graphDeleteOp = new GraphDeleteOperation("films", "the_godfather_part_2", "sequel", "films", "the_godfather_part_3");
$result = $client->execute($graphDeleteOp); // true

use SocalNick\Orchestrate\GraphFetchOperation;
$graphFetchOp = new GraphFetchOperation("films", "the_godfather", "sequel");
$graphObject = $client->execute($graphFetchOp);
$count = $graphObject->count(); // 0

$graphFetchOp = new GraphFetchOperation("films", "the_godfather_part_2", "sequel");
$graphObject = $client->execute($graphFetchOp);
$count = $graphObject->count(); // 0
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.5% 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.

###  Release Activity

Cadence

Every ~101 days

Recently: every ~77 days

Total

7

Last Release

3825d ago

PHP version history (2 changes)0.1.0PHP &gt;=5.4.0

0.6.0PHP &gt;=5.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/7cb543257e5a5ba4b42cc774c8e6a920803590a722d08b5cf92a6659d6ae4161?d=identicon)[SocalNick](/maintainers/SocalNick)

---

Top Contributors

[![SocalNick](https://avatars.githubusercontent.com/u/294123?v=4)](https://github.com/SocalNick "SocalNick (67 commits)")[![dizzyd](https://avatars.githubusercontent.com/u/20146?v=4)](https://github.com/dizzyd "dizzyd (1 commits)")

---

Tags

clientGuzzleorchestrate

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/socalnick-orchestrate-php-client/health.svg)

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

###  Alternatives

[eightpoints/guzzle-bundle

Integrates Guzzle 6.x, a PHP HTTP Client, into Symfony. Comes with easy and powerful configuration options and optional plugins.

45912.1M55](/packages/eightpoints-guzzle-bundle)[amphp/http-client-guzzle-adapter

Guzzle adapter for Amp's HTTP client.

1523.6k1](/packages/amphp-http-client-guzzle-adapter)[facile-it/crossbar-http-publisher-bundle

This bundle allows to submit PubSub events via HTTP/POST requests to a Crossbar HTTP Publisher.

1114.4k](/packages/facile-it-crossbar-http-publisher-bundle)[opgg/riotquest

RiotQuest, PHP RiotAPI client library that focused on multi request from OP.GG

172.6k](/packages/opgg-riotquest)

PHPackages © 2026

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