ocolin/tarana-tcs
Composer 安装命令:
composer require ocolin/tarana-tcs
包简介
PHP Rest client for Tarana TSC API
README 文档
README
What is it?
This is a lightweight PHP REST client for the Tarana TCS API services.
Requirements
- PHP >=8.3
- guzzlehttp/guzzle ^7.10
- ocolin/global-type ^2.0
Installation
composer require ocolin/tarana-tcs
Configuration
Configuration can be done either through environment settings or constructor arguments. Only properties are needed for configuration. Your API token and the URL of the TSC server. The TSC hostname is also optional as Tarana's API is sell established. However, should that ever change, the hostname can be configured.
Configuration Properties
| Environment | Argument | type | Description |
|---|---|---|---|
| TARANA_TCS_API_TOKEN | $token | string | API Key assigned by Tarana |
| TARANA_TCS_API_HOST | $host | string | Tarana TSC hostname |
| -- | $options | array|object | Optional guzzle properties |
Environment Variables
// Manual for demonstration $_ENV['TARANA_TCS_API_TOKEN'] = 'abcdefg'; $_ENV['TARANA_TCS_API_HOST'] = 'https://api.tcs.taranawireless.com'; $taranaTCS = new Ocolin\TaranaTCS\TaranaTCS();
Constructor Arguments
$taranaTCS = new Ocolin\TaranaTCS\TaranaTCS( host: 'https://api.tcs.taranawireless.com', token: 'abcdefg' );
Options
Optional guzzle parameters can be set using the options argument.
$taranaTcs = new Ocolin\TaranaTCS\TaranaTCS( options: [ 'verify' => false ] );
HTTP Defaults
| Option | Default | Description |
|---|---|---|
| timeout | 20 | Seconds to give HTTP attempt |
| verify | true | Verify SSL credentials |
Response
The client returns a response object with the payload as well as HTTP data. Tarana TCS returns an object with a property for data, and a property for error on all calls. This client body payload will be either the error content or data content depending on whether the call was successful or not.
| Parameter | Type | Description |
|---|---|---|
| status | integer | HTTP status code |
| statusMessage | string | HTTP status message |
| headers | array | HTTP response headers |
| body | object | TSC payload. Data or error content |
Path interpolation
The TSC client will interpolate any path variable tokens with value in any matching keys or properties in the $query parameter. See the GET method example to see a path token being replaced.
Method functions
GET
Get a resource(s)
// End point will be /v2/network/radios/abcdefg $output = $taranaTCS->get( endpoint: '/v2/network/radios/{serialNumber}', query: [ 'serialNumber' => 'abcdefg' ] );
POST
Create a resource.
$output = $taranaTCS->post( endpoint: '/v1/network/regions', body: [ 'name' => 'RegionName' ] );
PATCH
Update a resource.
$output = $taranaTCS->patch( endpoint: '/v1/network/regions/{regionName}', query: [ 'regionName' => 'RegionName' ], body: [ 'notes' => 'My new notes' ] );
PUT
Complete update of resource.
$output = $taranaTCS->put( endpoint: '/v1/users/{email}', query: [ 'email' => 'email@address.com' ], body: [ ... ] );
DELETE
Remove resource
$output = $taranaTCS->delete( endpoint: '/v1/users/{email}', query: [ 'email' => 'email@address.com' ] );
REQUEST
Generic HTTP request function.
$output = $taranaTCS->request( endpoint: '/v1/network/regions/{regionName}', method: 'PATCH', query: [ 'regionName' => 'RegionName' ], body: [ 'notes' => 'My new notes' ] );
ocolin/tarana-tcs 适用场景与选型建议
ocolin/tarana-tcs 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 ocolin/tarana-tcs 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ocolin/tarana-tcs 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-03