2017 © Pedro Peláez
 

library xmpp

Library for XMPP protocol (Jabber) connections

image

fabiang/xmpp

Library for XMPP protocol (Jabber) connections

  • Tuesday, May 23, 2017
  • by fabiang
  • Repository
  • 19 Watchers
  • 151 Stars
  • 60,034 Installations
  • PHP
  • 7 Dependents
  • 0 Suggesters
  • 70 Forks
  • 42 Open issues
  • 11 Versions
  • 6 % Grown

The README.md

fabiang/xmpp

Library for XMPP protocol connections (Jabber) for PHP., (*1)

License Latest Stable Version Total Downloads Dependency Status Build Status Coverage Status Scrutinizer Quality Score SensioLabsInsight, (*2)

SYSTEM REQUIREMENTS

  • PHP minimum 5.6 or minimum 7.0
  • psr/log
  • (optional) psr/log-implementation - like monolog/monolog for logging

INSTALLATION

New to Composer? Read the introduction. Add the following to your composer file:, (*3)

composer require fabiang/xmpp

DOCUMENTATION

This library uses an object to hold options:, (*4)

use Fabiang\Xmpp\Options;
$options = new Options($address);
$options->setUsername($username)
    ->setPassword($password);

The server address must be in the format tcp://myjabber.com:5222.
If the server supports TLS the connection will automatically be encrypted., (*5)

You can also pass a PSR-2-compatible object to the options object:, (*6)

$options->setLogger($logger)

The client manages the connection to the Jabber server and requires the options object:, (*7)

use Fabiang\Xmpp\Client;
$client = new Client($options);
// optional connect manually
$client->connect();

For sending data you just need to pass a object that implements Fabiang\Xmpp\Protocol\ProtocolImplementationInterface:, (*8)

use Fabiang\Xmpp\Protocol\Roster;
use Fabiang\Xmpp\Protocol\Presence;
use Fabiang\Xmpp\Protocol\Message;

// fetch roster list; users and their groups
$client->send(new Roster);
// set status to online
$client->send(new Presence);

// send a message to another user
$message = new Message;
$message->setMessage('test')
    ->setTo('nickname@myjabber.com')
$client->send($message);

// join a channel
$channel = new Presence;
$channel->setTo('channelname@conference.myjabber.com')
    ->setPassword('channelpassword')
    ->setNickName('mynick');
$client->send($channel);

// send a message to the above channel
$message = new Message;
$message->setMessage('test')
    ->setTo('channelname@conference.myjabber.com')
    ->setType(Message::TYPE_GROUPCHAT);
$client->send($message);

After all you should disconnect:, (*9)

$client->disconnect();

DEVELOPING

If you like this library and you want to contribute, make sure the unit-tests and integration tests are running. Composer will help you to install the right version of PHPUnit and Behat., (*10)

composer install

After that:, (*11)

./vendor/bin/phpunit
./vendor/bin/behat

New features should always tested with Behat., (*12)

LICENSE

BSD-2-Clause. See the LICENSE., (*13)

TODO

  • Better integration of channels
  • Factory method for server addresses
  • improve documentation

The Versions

20/11 2014

0.6.1

0.6.1.0 https://github.com/fabiang/xmpp

Library for XMPP protocol (Jabber) connections

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

xmpp jabber

13/11 2014

0.6.0

0.6.0.0 https://github.com/fabiang/xmpp

Library for XMPP protocol (Jabber) connections

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

xmpp jabber

29/10 2014

0.5.0

0.5.0.0 https://github.com/fabiang/xmpp

Library for XMPP protocol (Jabber) connections

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

xmpp jabber

28/02 2014

0.4.0

0.4.0.0 https://github.com/fabiang/xmpp

Library for XMPP protocol (Jabber) connections

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

xmpp jabber

05/02 2014

0.3.0

0.3.0.0 https://github.com/fabiang/xmpp

Library for XMPP protocol connections (Jabber)

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

xmpp jabber

31/01 2014

dev-zlib

dev-zlib https://github.com/fabiang/xmpp

Library for XMPP protocol connections (Jabber)

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

xmpp jabber

27/01 2014

0.2.0

0.2.0.0 https://github.com/fabiang/xmpp

Library for XMPP protocol connections (Jabber)

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

xmpp jabber

23/01 2014

0.1.0

0.1.0.0 https://github.com/fabiang/xmpp

Library for XMPP protocol connections (Jabber)

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

xmpp jabber