PHPackages                             cxalloy/haystack-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. cxalloy/haystack-php

ActiveLibrary[API Development](/categories/api)

cxalloy/haystack-php
====================

Haystack-php is a PHP library designed to facilitate seamless communication with Skyspark servers via REST API, leveraging the Project Haystack specifications for IoT time series data management in building intelligence systems.

v0.1.2(1y ago)037MITPHPPHP ^8.2

Since May 13Pushed 1y ago1 watchersCompare

[ Source](https://github.com/phunnicutt1/haystack-php)[ Packagist](https://packagist.org/packages/cxalloy/haystack-php)[ RSS](/packages/cxalloy-haystack-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (2)Versions (9)Used By (0)

Haystack-PHP
============

[](#haystack-php)

Haystack-PHP is a PHP library designed to facilitate communication with Skyspark servers through REST API, adhering to the Project Haystack specifications. This library leverages PHP 8.2 and the GuzzleHTTP package for efficient HTTP requests, focusing on the integration and manipulation of IoT time series data for building intelligence systems.

Overview
--------

[](#overview)

This library provides functionalities to encode and decode Zinc and JSON encoded strings, creating library specific objects in PHP from these strings. This setup ensures a robust and extensible codebase for easy integration 3rd party software systems interfacing with Skyspark or other haystack compatible servers. This library has been scaled back to simply be an implmentation of the Project Haystack spec in PHP. This library supports all the custom haystack datatypes, the filtering and the full haystack specifications for defs, tagging, taxonomy and ontology.

### Technologies Used:

[](#technologies-used)

- **PHP 8.2**: The core scripting language for the project.
- **Composer**: Dependency Manager for PHP, used for managing external packages.
- **guzzlehttp/guzzle**: A PHP HTTP client utilized for making HTTP requests and integrating with web services.

### Project Structure:

[](#project-structure)

- `src/`: Contains the source code with the main classes for haystack-php objects, error handling, JSON/Zinc reading &amp; writing.
- `tests/`: Includes unit tests for testing the functionality of the classes.
- `docs/`: Documentation on the encoding algorithm and Zinc format research.
- `composer.json`: Manages project dependencies.

Features
--------

[](#features)

- **REST API Communication**: Enables sending requests to and receiving responses from Skyspark servers via REST API.
- **Data Encoding and Decoding**: Supports encoding the custom data objects provided by this library into the Zinc &amp; JSON formated strings for transmission via the API. There is also support for decoding Zinc &amp; JSON formatted strings back into PHP Haystack HGrid objects that have support for all Haystack custom data types. This is a PHP implmentation of the Project Haystack datatypes, adhering to the Project Haystack specifications.
- **Extensible Design**: The library is designed for easy extension and integration with other systems or applications requiring Skyspark server communication or that has a Project Haystack compatible API.
- **Error Handling**: Implements robust error handling mechanisms for request failures and data encoding/decoding issues.

Getting Started
---------------

[](#getting-started)

### Requirements

[](#requirements)

- PHP 8.2 or later
- Composer for managing PHP dependencies

### Quickstart

[](#quickstart)

1. **Install Dependencies**: Run `composer require cxalloy/haystack-php` to install the required packages, including GuzzleHTTP.
2. **Usage**: Use one of these classes: `HJsonWriter`, `HJsonReader`, `HZincReader` &amp; `HZincWriter` to consume an encoded string or create an encoded string representing a haystack-php HGrid object to send requests to your Skyspark server. This HGrid object can contain all other haystack-php objects including nested HGrids, HLists and HDicts.

### License

[](#license)

Copyright (c) 2024.

This project is proprietary and not open source.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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.

###  Release Activity

Cadence

Every ~11 days

Recently: every ~5 days

Total

8

Last Release

656d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/41b4946c78d6ec3dfeeaf7cff445cb7cea7c2847b8c03784d13b73aed9ae3e02?d=identicon)[phunnicutt](/maintainers/phunnicutt)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cxalloy-haystack-php/health.svg)

```
[![Health](https://phpackages.com/badges/cxalloy-haystack-php/health.svg)](https://phpackages.com/packages/cxalloy-haystack-php)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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