承接 candy-chat/xmpp-prebind-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

candy-chat/xmpp-prebind-php

Composer 安装命令:

composer require candy-chat/xmpp-prebind-php

包简介

This class is for prebinding a XMPP Session with PHP.

README 文档

README

This class is for prebinding a XMPP Session with PHP.

Usage

  • Clone the repo
  • In your file where you want to do the prebinding:
/**
 * Comment here for explanation of the options.
 *
 * Create a new XMPP Object with the required params
 *
 * @param string $jabberHost Jabber Server Host
 * @param string $boshUri    Full URI to the http-bind
 * @param string $resource   Resource identifier
 * @param bool   $useSsl     Use SSL (not working yet, TODO)
 * @param bool   $debug      Enable debug
 */
$xmppPrebind = new XmppPrebind('your-jabber-host.tld', 'http://your-jabber-host/http-bind/', 'Your XMPP Clients resource name', false, false);
$xmppPrebind->connect($username, $password);
$xmppPrebind->auth();
$sessionInfo = $xmppPrebind->getSessionInfo(); // array containing sid, rid and jid
  • If you use Candy, change the Candy.Core.Connect() line to the following:
Candy.Core.attach('<?php echo $sessionInfo['jid'] ?>', '<?php echo $sessionInfo['sid'] ?>', '<?php echo $sessionInfo['rid'] ?>');
  • You should now have a working prebinding with PHP

Debugging

If something doesn't work, you can enable Debug. Debug output is logged to FirePHP, so you have to install that first.

Other Languages

There exist other projects for other languages to support a prebind. Go googling :)

Be aware

This class is in no way feature complete. There may also be bugs. I'd appreciate it if you contribute or submit bug reports.

Thanks.

统计信息

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

GitHub 信息

  • Stars: 63
  • Watchers: 17
  • Forks: 43
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-02-26