2008-04-02 08:09:28 +01:00
|
|
|
<?php
|
2008-04-28 23:05:31 +01:00
|
|
|
|
|
|
|
// activate full error reporting
|
2008-07-17 00:07:01 +01:00
|
|
|
//error_reporting(E_ALL & E_STRICT);
|
2008-04-28 23:05:31 +01:00
|
|
|
|
2010-03-07 19:38:11 +00:00
|
|
|
include dirname(dirname(__FILE__)).'/XMPPHP/XMPP.php';
|
2008-05-01 15:29:33 +01:00
|
|
|
|
2008-07-17 00:07:01 +01:00
|
|
|
#Use XMPPHP_Log::LEVEL_VERBOSE to get more logging for error reports
|
|
|
|
#If this doesn't work, are you running 64-bit PHP with < 5.2.6?
|
2008-05-05 19:35:48 +01:00
|
|
|
$conn = new XMPPHP_XMPP('talk.google.com', 5222, 'username', 'password', 'xmpphp', 'gmail.com', $printlog=false, $loglevel=XMPPHP_Log::LEVEL_INFO);
|
2008-05-05 20:50:02 +01:00
|
|
|
|
|
|
|
try {
|
|
|
|
$conn->connect();
|
|
|
|
$conn->processUntil('session_start');
|
|
|
|
$conn->presence();
|
2008-08-29 00:07:45 +01:00
|
|
|
$conn->message('someguy@someserver.net', 'This is a test message!');
|
2008-05-05 20:50:02 +01:00
|
|
|
$conn->disconnect();
|
|
|
|
} catch(XMPPHP_Exception $e) {
|
|
|
|
die($e->getMessage());
|
2008-07-17 00:07:01 +01:00
|
|
|
}
|