承接 gamenet/php-jabber-rpc 相关项目开发

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

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

gamenet/php-jabber-rpc

最新稳定版本:1.3.4

Composer 安装命令:

composer require gamenet/php-jabber-rpc

包简介

PHP wrapper for ejabberd xml-rpc module

README 文档

README

Build Status Latest Stable Version Code Coverage Scrutinizer Code Quality Latest Unstable Version License

About

mod_xmlrpc is a module for ejabberd, a XMPP/Jabber server written in Erlang. It starts a XML-RPC server and waits for external requests. Implemented calls include statistics and user administration. This allows external programs written in any language like websites or administrative tools to communicate with ejabberd to get information or to make changes without the need to know ejabberd internals.

One example usage is a corporate site in PHP that creates a Jabber user every time a new user is created on the website. Some benefits of interfacing with the Jabber server by XML-RPC instead of modifying directly the database are:

  • external programs are more simple and easy to develop and debug
  • can communicate with a server in a different machine, and even on Internet

This library is an simple wrapper above php xmlrpc module to simplify ejabberd mod_xmlrpc usage from php. PHP code based on mod_admin_extra.erl and mod_muc_admin.erl source files.

Requirements

PHP >= 5.4

Installation

Composer

The recommended way to install library is composer. You can see package information on Packagist.

{
	"require": {
		"gamenet/php-jabber-rpc": "*"
	}
}

Do not use composer?

Just clone the repository and take care about autoload for namespace GameNet.

Usage

Basic usage looks like this:

    $rpc = new \GameNet\Jabber\RpcClient([
        'server' => 'http://127.0.0.1:4560',
        'host' => 'j.gamenet.ru',
        'debug' => false,
    ]);

    //Create 2 new users with name `Ivan` and `Petr` with password `someStrongPassword`
    $rpc->createUser('Ivan', 'someStrongPassword');
    $rpc->createUser('Petr', 'someStrongPassword');

    // Add each other in the contact list with group 'Friend'
    $rpc->addRosterItem('Ivan', 'Petr', 'Petr Ivanov', 'Friend');
    $rpc->addRosterItem('Petr', 'Ivan', 'Ivan Petrov', 'Friend');

    // Get contact list Ivan
    $contacts = $rpc->getRoster($username);

统计信息

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

GitHub 信息

  • Stars: 19
  • Watchers: 4
  • Forks: 13
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-05-12