catapush/xmpp
Composer 安装命令:
composer require catapush/xmpp
包简介
A client library for talking to XMPP servers.
README 文档
README
Before creating this repository, I've evaluated following XMPP libraries for PHP:
- Nikita's fork, which was based on Alexander's code.
- XMPPHP. There is a better fork made by Charles.
- JAXL.
Unfortunately, none of above ships with what I need. That's the reason I'm creating this repository based on Nikita's work.
Features
- Following features were shipped already from Nikita's fork:
- Connects to and authenticates (using DIGEST-MD5) against XMPP servers (tested against Openfire and jabberd2)
- Supports SSL/TLS connections
- Allows joining of MUC rooms
- Sends messages to individuals and MUC rooms.
- Following features are added by me, plus various refactoring, etc:
- Connects to and authenticates using PLAIN.
- XEP-0045 (Multi-User Chat) related implementations, including to create chatroom, destroy chatroom, grant member, revoke member and get member list.
Sample Code
use Xmpp\Xep\Xep0045; $roomId = 'YourHouse'; $userId = 'Tom'; $options = array( 'username' => 'your_username', 'password' => 'your_password', 'host' => 'example.com', 'ssl' => false, 'port' => 5222, 'resource' => uniqid('', true), 'mucServer' => 'conference.example.com', ); $xmpp = new Xep0045($options, $logger); $xmpp->createRoom($roomId); // Create the room. $xmpp->grantMember($roomId, $userId); // Add a member to the room. $xmpp->getMemberList($roomId); // Get member list and there should be only one member. $xmpp->revokeMember($roomId, $userId); // Remove the only member out from the room. $xmpp->getMemberList($roomId); // Get member list and there should be nobody in the room. $xmpp->destroyRoom($roomId); // Destroy the room. $xmpp->disconnect(); // Disconnect from the server. Important for heavy-loaded servers.
Known Limitations
- Only part of XEP-0045 (Multi-User Chat) protocol extension have been implemented.
- Although code was refactored/written following FIG PSR standards, it was developped and tested for certain project under certain environment only.
Credits
- Nikita's fork.
- Valuable suggestions, helps on performance improments and tests from colleague Jose (known to all as Tachu), Jakub and Jerry.
License
MIT license.
catapush/xmpp 适用场景与选型建议
catapush/xmpp 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.81k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2019 年 08 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「xmpp」 「jabber」 「im」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 catapush/xmpp 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 catapush/xmpp 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 catapush/xmpp 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Allows XMPP connection with Firebase Cloud Messaging. It can listen upstream messages and send downstream ones.
Library for XMPP protocol (Jabber) connections
XMPP handler for Monolog
A client library for talking to XMPP servers.
Alfabank REST API integration
Library for XMPP protocol (Jabber) connections
统计信息
- 总下载量: 1.81k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 8
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-08-09