cxalloy/haystack-php
Composer 安装命令:
composer require 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.
README 文档
README
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
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:
- 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:
src/: Contains the source code with the main classes for haystack-php objects, error handling, JSON/Zinc reading & 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
- 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 & JSON formated strings for transmission via the API. There is also support for decoding Zinc & 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
Requirements
- PHP 8.2 or later
- Composer for managing PHP dependencies
Quickstart
- Install Dependencies: Run
composer require cxalloy/haystack-phpto install the required packages, including GuzzleHTTP. - Usage: Use one of these classes:
HJsonWriter,HJsonReader,HZincReader&HZincWriterto 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
Copyright (c) 2024.
This project is proprietary and not open source.
cxalloy/haystack-php 适用场景与选型建议
cxalloy/haystack-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 37 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 05 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 cxalloy/haystack-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 cxalloy/haystack-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 37
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-05-13