drinks-it/esb-client
最新稳定版本:2.31
Composer 安装命令:
composer require drinks-it/esb-client
包简介
ESB client.
README 文档
README
A PHP client library for interacting with an ESB (Enterprise Service Bus) API. This library provides a set of request classes and a configurable API client for seamless integration with various ESB endpoints.
Features
- Simple API client for ESB integration
- Request classes for different ESB operations (orders, products, reports, etc.)
- Factory pattern for client instantiation
- Guzzle HTTP client support
Requirements
- PHP 7.4 or higher
- Composer
Installation
Install via Composer:
composer require your-vendor/esb-client
Usage
Basic Example
use EsbClient\ApiClient; use EsbClient\ApiConfig; use EsbClient\Request\OrderRequest; $config = new ApiConfig([ 'base_uri' => 'https://api.example.com', 'api_key' => 'your-api-key', ]); $client = new ApiClient($config); $request = new OrderRequest(/* ...parameters... */); $response = $client->send($request); // Handle $response
Using the Factory
use EsbClient\Factory\EsbClientFactory; $client = EsbClientFactory::create([ 'base_uri' => 'https://api.example.com', 'api_key' => 'your-api-key', ]);
Project Structure
src/ApiClient.php- Main API client classsrc/ApiConfig.php- API configurationsrc/Factory/- Factories for client and HTTP clientsrc/Request/- Request classes for various ESB operations
Extending
You can add new request types by creating new classes in the src/Request/ directory, following the existing request class structure.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
统计信息
- 总下载量: 5.14k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-03-23