Library for XMPP protocol (Jabber) connections

Installs: 7 944

Dependents: 1

Stars: 42

Watchers: 12

Forks: 13

Open Issues: 13

Language: PHP

0.6.1 2014-11-20 08:59 UTC


Latest Stable Version Total Downloads Latest Unstable Version License
Build Status Scrutinizer Quality Score Coverage Status Dependency Status SensioLabsInsight

Library for XMPP protocol connections (Jabber) for PHP.


  • PHP >= 5.3.3
  • psr/log
  • psr/log-implementation - like monolog/monolog for logging (optional)


New to Composer? Read the introduction. Add the following to your composer file:

    "require": {
        "fabiang/xmpp": "*"


This library uses an object to hold options:

use Fabiang\Xmpp\Options;
$options = new Options($address);

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

You can also pass a PSR-2-compatible object to the options object:


The client manages the connection to the Jabber server and requires the options object:

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

For sending data you just need to pass a object that implements Fabiang\Xmpp\Protocol\ProtocolImplementationInterface:

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;

// join a channel
$channel = new Presence;

// send a message to the above channel
$message = new Message;

After all you should disconnect:



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.

composer install --dev

After that:

./vendor/bin/phpunit -c tests
./vendor/bin/behat --config=tests/behat.yml --strict

New features should allways tested with Behat.


BSD-2-Clause. See the LICENSE.


  • Better integration of channels
  • Factory method for server addresses
  • Add support von vCard
  • improve documentation