2008-05-21

XMPPHP Connect Google Talk!!

XMPPHP

URL : http://code.google.com/p/xmpphp/

XMPPHP is the successor to Class.Jabber.PHP that I've been promising for years. Taking advantage of PHP5, I believe it to be an elegant solution with a direct approach.

Some of the features include:

  • Connect to any XMPP 1.0 server (Google Talk, LJ Talk, jabber.org, etc)
  • Supports TLS encryption
  • Several XML processing approaches and supported styles (process indefinitely, processUntil an event, processTime for a number of seconds), waiting on events or map them, etc.
  • Persistent connections (AJAX Web client anyone?)

I don't host the SVN @ Google, so get it at svn://netflint.net/xmpphp . I encourage you to check out my python XMPP Library (SleekXMPP) at http://code.google.com/p/sleekxmpp .

Feel fee to IM me any time with questions, feature requests, etc. Don't be afraid to take a little bit of my time!

Jabber ID: fritzy AT netflint.net

Jabber MUC (Chatroom): xmpphp@conference.psi-im.org

Examples

A simple code example for sending messages:

include("xmpp.php");
$conn = new XMPP('talk.google.com', 5222, 'username', 'password', 'xmpphp', 'gmail.com', $printlog=False, $loglevel=LOGGING_INFO);
$conn->connect();
$conn->processUntil('session_start');
$conn->message('someguy@someserver.net', 'This is a test message!');
$conn->disconnect();
?>

To not use SSL/TLS encryption if available, set

$conn->use_encryption = False;

before calling connect()