定制 broadcastt/broadcastt-php-http 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

broadcastt/broadcastt-php-http

Composer 安装命令:

composer require broadcastt/broadcastt-php-http

包简介

PHP library for Broadcastt HTTP API

README 文档

README

codecov

Realtime web applications are the future. Broadcastt provides tools to help developers create realtime applications.

PHP HTTP Library

Be aware that this library is still in beta and not reached the first MAJOR version.

Semantic Versioning 2.0.0

Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable.

This library is compatible with PHP 7.1+

This is a PHP library to interact with the Broadcastt API. If you are looking for a client library or a different server library please check out our list of libraries.

For tutorials and more in-depth documentation, visit the official site.

Documentation

First steps

Require this package, with Composer

composer require broadcastt/broadcastt-php-http

Configuration

$appId = 'YOUR_APP_ID';
$appKey = 'YOUR_APP_KEY';
$appSecret = 'YOUR_APP_SECRET';
$appCluster = 'YOUR_APP_CLUSTER';

$client = new Broadcastt\BroadcasttClient( $appId, $appKey, $appSecret, $appCluster );
// or
$client = Broadcastt\BroadcasttClient::fromUri("http://{$appKey}:{$appSecret}@{$appCluster}.broadcastt.xyz/apps/{$appId}");

appId (Integer)

The id of the application

appKey (String)

The key of the application

appSecret (String)

The secret of the application

appCluster (String) Optional

The cluster of the application

Default value: eu

Modifiers

scheme (String)

E.g. http or https

Default value: http

host (String)

The host e.g. cluster.broadcastt.xyz. No trailing forward slash

Default value: eu.broadcasttapp.xyz If the cluster is not set during initialization

port (String)

The http port

Default value: 80

basePath (String)

The base of the path what the request will call. {appId} can be used to automatically parse the app ID in the base path.

Default value: /apps/{appId}

timeout (String)

The http timeout

Default value: 30

guzzleClient (Mixed[])

Guzzle Client for sending HTTP requests

If not set it will be initialized without any parameters on the first request

Helpers

fromUri($uri)

Instantiate a new client from the given uri.

These are methods which help you modify the instance

useCluster($cluster)

Modifies the host value for given cluster

encrypted()

Short way to change scheme to https and port to 443

Usage

trigger($channels, $name, $data, $socketId = null, $jsonEncoded = false)

Trigger an event by providing event name and payload.

Optionally provide a socket ID to exclude a client (most likely the sender).

triggerBatch($batch = [], $encoded = false)

Trigger multiple events at the same time.

get($path, $params = [])

GET arbitrary REST API resource using a synchronous http client.

All request signing is handled automatically.

Contributing

Everyone is welcome who would help to make this library "Harder, Better, Faster, Stronger".

broadcastt/broadcastt-php-http 适用场景与选型建议

broadcastt/broadcastt-php-http 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2019 年 04 月 05 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「rest」 「real-time」 「events」 「publish」 「messaging」 「push」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 broadcastt/broadcastt-php-http 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 broadcastt/broadcastt-php-http 我们能提供哪些服务?
定制开发 / 二次开发

基于 broadcastt/broadcastt-php-http 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 2k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 10
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-04-05