broadcastt/broadcastt-php-http
Composer 安装命令:
composer require broadcastt/broadcastt-php-http
包简介
PHP library for Broadcastt HTTP API
关键字:
README 文档
README
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 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 broadcastt/broadcastt-php-http 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Talk is a Laravel based realtime messaging, chatting and conversation system. It helps to develop users messaging, chatting and conversations in easy way.
Библиотека для реализаций паттерна Pub/Sub
Wireless Cross-Component Communication
A powerful event calendar Tool for Laravel's Nova 5.
Boxalino Real Time User Experience (RTUX) Magento2 plugin
A PSR-7 compatible library for making CRUD API endpoints
统计信息
- 总下载量: 2k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 10
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-04-05