PHPackages                             kpacha/suricate-php-sdk - 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. kpacha/suricate-php-sdk

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

kpacha/suricate-php-sdk
=======================

sdk for the suricate service.

v1.0.6(11y ago)0741Apache-2.0PHPPHP &gt;=5.3.3

Since Oct 17Pushed 11y ago1 watchersCompare

[ Source](https://github.com/kpacha/suricate-php-sdk)[ Packagist](https://packagist.org/packages/kpacha/suricate-php-sdk)[ RSS](/packages/kpacha-suricate-php-sdk/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (8)Used By (1)

suricate-php-sdk
================

[](#suricate-php-sdk)

A suricate sdk for php

[![Build Status](https://camo.githubusercontent.com/2a2b8afa784c90c162a8ef332a1d2cb24012c644b141a89df50da8419a42137b/68747470733a2f2f7472617669732d63692e6f72672f6b70616368612f73757269636174652d7068702d73646b2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/kpacha/suricate-php-sdk)

\#Requirements

- git
- [suricate](https://github.com/kpacha/suricate) server (or any other [curator-x-discovery-service](http://curator.apache.org/curator-x-discovery-server/index.html))
- php 5.3.3+
- curl extension

\#Installation

\##Standalone

\###Git installation

Clone the repo

```
$ git clone https://github.com/kpacha/suricate-php-sdk.git

```

Install the php dependencies

```
$ cd suricate-php-sdk
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar install

```

\###Composer installation

Create a project with composer

```
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar create-project kpacha/suricate-php-sdk [directory]

```

Remeber to set the \[directory\] parameter or composer will create the project in your current path.

\##As a library

Include the `kpacha/suricate-php-sdk` package in your compose.json with all the dependencies of your project

```
"require":{
    "kpacha/suricate-php-sdk": "~1.0"
}

```

\#Usage

The suricate sdk comes with a simple client and several console commands bundled in a simple app.

\###Suricate client

The `Kpacha\Suricate\Suricate` constructor requires a rest client. The client must implement the `Guzzle\Http\ClientInterface` interface.

```
use Guzzle\Http\Client;
use Kpacha\Suricate\Suricate;
$suricateClient = new Suricate(new Client($suricateServerUrl));

```

Also, there is a builder to help you

```
use Kpacha\Suricate\SuricateBuilder;
$suricateClient = SuricateBuilder::build(suricateServerUrl);

```

And now the `$suricateClient` object is ready to work. Here you have some examples

```
try{
    $success = $suricateClient->putService($serviceName, $nodeId, $node);
    $serviceNames = $suricateClient->getAllNames();
    $nodes = $suricateClient->getAll($serviceName);
    $node = $suricateClient->get($serviceName, $nodeId);
    $success = $suricateClient->removeService($serviceName, $nodeId);
} catch (\Kpacha\Suricate\SuricateException $e) {
    // do something cleaver
}

```

Check the [test](tests/SuricateTest.php) for more details.

\###Suricate console app

Run the `suricate` script to trigger any console command. You can use them as a:

- simple manager limited to some basic interactions with your suricate service
- simple agent to send some heartbeats to suricate (it should be monitored by some external tool, restarting it periodically). This way, suricate will be aware of the status of your node.
- base for your more complex consumption patterns. Usually, you will also need to fetch all the available nodes registered under the services you are interested in.

Check out the `list` built-in command and get a list of all the available commands.

```
$ bin/suricate list

----------------------------------------------------------------------------
 .oooooo..o                       o8o                          .
d8P'    `Y8                       `"'                        .o8
Y88bo.      oooo  oooo  oooo d8b oooo   .ooooo.   .oooo.   .o888oo  .ooooo.
 `"Y8888o.  `888  `888  `888""8P `888  d88' `"Y8 `P  )88b    888   d88' `88b
     `"Y88b  888   888   888      888  888        .oP"888    888   888ooo888
oo     .d8P  888   888   888      888  888   .o8 d8(  888    888 . 888    .o
8""88888P'   `V88V"V8P' d888b    o888o `Y8bod8P' `Y888""8o   "888" `Y8bod8P'
----------------------------------------------------------------------------

Suricate version 0.0.1-Beta

Usage:
  [options] command [arguments]

Options:
  --help           -h Display this help message.
  --quiet          -q Do not output any message.
  --verbose        -v|vv|vvv Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
  --version        -V Display this application version.
  --ansi              Force ANSI output.
  --no-ansi           Disable ANSI output.
  --no-interaction -n Do not ask any interactive question.

Available commands:
  help                 Displays help for a command
  list                 Lists commands
suricate
  suricate:all         Get a list of all the registered nodes by a given service (getAll)
  suricate:get         Get a node by a given service and id (get)
  suricate:heartbeat   Put a node by in a service cluster and update it periodically
  suricate:names       Get a list of all the registered service names (getAllNames)
  suricate:put         Put a node in a service cluster (putService)
  suricate:remove      Remove a node by a given service and id (removeService)

```

Remember, you can also get more details about any command just adding the `--help` option.

```
$ bin/suricate suricate:heartbeat --help
Usage:
 suricate:heartbeat [-s|--service="..."] [-i|--id="..."] [--node="..."] [-t|--total="..."] [-w|--wait="..."] suricate-server

Arguments:
 suricate-server       the suricate server url

Options:
 --service (-s)        name of the servie
 --id (-i)             id of the node
 --node                the node in json format
 --total (-t)          the total heartbeats to send
 --wait (-w)           the sleep time between consecutive heartbeats in secs
 --help (-h)           Display this help message.
 --quiet (-q)          Do not output any message.
 --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
 --version (-V)        Display this application version.
 --ansi                Force ANSI output.
 --no-ansi             Disable ANSI output.
 --no-interaction (-n) Do not ask any interactive question.

```

Suricate only accepts payloads as `String`, so you should model your data with that in mind and, maybe, instead of seeing it as a limitation and send just plain texts, you would add some serializated info. Just remember, ZooKeeper is not a database, so use it with caution!

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~1 days

Total

7

Last Release

4216d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4539090b6fccb79399136821aba66f06d55284f01965fe36d0565af367a5f700?d=identicon)[kpacha](/maintainers/kpacha)

---

Top Contributors

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

---

Tags

service discoverysuricatezookeepercuratorcurator-x-discoverycurator-x-discovery-server

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kpacha-suricate-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/kpacha-suricate-php-sdk/health.svg)](https://phpackages.com/packages/kpacha-suricate-php-sdk)
```

###  Alternatives

[php-soap/wsdl

Deals with WSDLs

173.5M12](/packages/php-soap-wsdl)[phel-lang/phel-lang

Phel is a functional programming language that compiles to PHP

4743.5k10](/packages/phel-lang-phel-lang)[symfony/ai-bundle

Integration bundle for Symfony AI components

30282.3k6](/packages/symfony-ai-bundle)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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