* @revision 05 * @license http://creativecommons.org/licenses/by-sa/3.0/de/ Creative Commons Attribution-Share Alike 3.0 Germany * @homepage http://oss.tiggerswelt.net/xmpp * @copyright Copyright © 2008 tiggersWelt.net */ /** * XMPP COMPONENT DEMO * * This programm illustrates how to use our XMPP-Class to * create some XMPP-Components that are linked as whole * Domain to an XMPP-Server via XEP-114 * * It uses the phOSCAR class (available at http://oss.tiggerswelt.net/oscar) * to create a very simple bridge between OSCAR and XMPP */ // Override include-path set_include_path ("../../../" . PATH_SEPARATOR . "../../" . PATH_SEPARATOR . PATH_SEPARATOR . get_include_path ()); // Load additional XEPs require_once ("tiggerXMPP/xep/0030.php"); require_once ("tiggerXMPP/xep/0054.php"); require_once ("tiggerXMPP/xep/0077.php"); require_once ("libs/mtn.php"); require_once ("tiggerXMPP/xep/0092.php"); // Create an OSCAR-abstraction layer require_once ("oscar/client.php"); // Load classes for this component require_once ("libs/oscar.php"); require_once ("libs/xmpp.php"); require_once ("libs/registration.php"); require_once ("libs/client.php"); // Create a new Component $XMPP = new XMPP_ICQ_Transport ( "icq.tiggerswelt.net", # TODO: The domain of your component "jabber.tiggerswelt.net", # TODO: The host where your jabberd is running 5347, # TODO: The port for component-connections ); // Authenticate with server $XMPP->authenticate ("Some amazing password") # TODO: Your component password here or die ("Authentication with server failed. :-(\n"); // Activate XEPs $XEP0030 = new tiggerXMPP_XEP_0030 ($XMPP); $XEP0054 = new tiggerXMPP_XEP_0054 ($XMPP); $XEP0077 = new tiggerXMPP_XEP_0077 ($XMPP); $XEP0085 = new XMPP_ICQ_MTN ($XMPP); $XEP0092 = new tiggerXMPP_XEP_0092 ($XMPP); // Setup XEP 0030 $XEP0030->registerIdentity ("tiggerXMPP ICQ Transport Component", "gateway", "icq"); // Setup XEP 0077 $XEP0077->registerEntity ( $XMPP->getJID (true, true, false), "Bitte geben Sie Ihre ICQ-Account-Zugangsdaten ein.\n(Benutzername entspricht ICQ-UIN)", null, "XMPP_Transport_Registration" ); // Setup XEP 0092 $XEP0092->setVersion ( "tiggerXMPP ICQ Transport Component", "0.01 Alpha", "Some Linux, maybe" ); // Load registered clients $XMPP->probeClients (); // Enter a loop while (true) { $XMPP->readBlock (false); usleep (1000); } ?>