PHP Classes > In-House PHP Classes > PHP Jabber Client

PHP Jabber Client
Feature-rich PHP Jabber client library
GZipped Archive
Download (36KB)
This is an event-driven, PHP-based Jabber client class implementation, allowing your script to connect to and interact with Jabber (XMPP) servers.  This script was originally based on class.jabber.php, but has been almost completely rewritten (with permission from Carlo Zottmann) using an event-driven model. 

How is this different than class.jabber.php (CJP)?

The original CJP operated on a "send, wait, read" model, in which the library would send a command to the Jabber server, wait for a given number of seconds, then look for a response.  There are a number of problems with this approach, but the most prominent issues are:
  • It's slow.  Even if you send a command to the Jabber server and the server responds immediately, your script must still wait for the entire duration of the delay.  When sending multiple commands in a row, this delay can add up and become quite significant.
  • If your Jabber server (or network connection) is a bit slow, you may end up missing the server's response entirely.  CJP always waits for a given number of seconds for a response.  If a response is not received in that period of time, it is assumed that an error has occurred, which is often not the case.
To overcome these limitations, this library operates using an event-driven model.  That is, you register callbacks in advance for all of the events you wish to be notified about.  When the library receives a response from a Jabber server, it immediately fires your callback function.  Thus, you are guaranteed to receive all events, regardless of your Jabber server's speed, with no unnecessary delay.

This class also implements countless new XMPP protocol features which were not present in the original class.jabber.php.

This class is used in Centova Messenger, my web-based Jabber instant messaging application.

Downloads: 24972
Added: Dec 13, 2005 11:48 PM
Last updated: Oct 15, 2007 01:40 AM