API > eden > jabber.php
View Source

class Eden_Jabber

XMPP/Jabber abstract for IM clients.

Constants

  • AOL_HOST: xmpp.oscar.aol.com
  • AOL_PORT: 5222
  • GOOGLE_HOST: gmail.com
  • GOOGLE_PORT: 5222
  • JABBER_HOST: jabber.org
  • JABBER_PORT: 5222
  • MSN_HOST: messenger.live.com
  • MSN_PORT: 5222
  • YAHOO_HOST: chat.live.yahoo.com
  • YAHOO_PORT: 5222
  • PRESENCE_ONLINE: online
  • PRESENCE_OFFLINE: offline
  • PRESENCE_AWAY: away
  • PRESENCE_DND: dnd
  • PRESENCE_XA: xa
  • PRESENCE_TYPE_PROBE: probe
  • PRESENCE_TYPE_UNAVAILABLE: unavailable
  • PRESENCE_TYPE_ERROR: error
  • PRESENCE_TYPE_SUBSCRIBE: subscribe
  • PRESENCE_TYPE_SUBSCRIBED: subscribed
  • PRESENCE_TYPE_UNSUBSCRIBE: unsubscribe
  • PRESENCE_TYPE_UNSUBSCRIBED: unsubscribed
  • MESSAGE_TYPE_CHAT: chat
  • MESSAGE_TYPE_ERROR: error
  • MESSAGE_TYPE_GROUPCHAT: groupchat
  • MESSAGE_TYPE_HEADLINE: headline
  • MESSAGE_TYPE_NORMAL: normal
  • AUTH_NOOP: 0
  • AUTH_STARTED: 1
  • AUTH_CHALLENGE: 2
  • AUTH_FAILIURE: 3
  • AUTH_PROCEED: 4
  • AUTH_SUCCESS: 5
  • AUTH_TYPE_STREAM: stream:stream
  • AUTH_TYPE_FEATURES: stream:features
  • AUTH_TYPE_CHALLENGE: challenge
  • AUTH_TYPE_FAILURE: failure
  • AUTH_TYPE_PROCEED: proceed
  • AUTH_TYPE_SUCCESS: success
  • QUERY_TYPE_BIND: bind_1
  • QUERY_TYPE_SESSION: sess_1
  • QUERY_TYPE_REGISTER: reg_1
  • QUERY_TYPE_REGISTERED: reg_2
  • QUERY_TYPE_UNREGISTER: unreg_1
  • QUERY_TYPE_ROSTER: roster_1
  • QUERY_TYPE_PUSH: push

Public Methods

public function connect($timeout = 10)

Connects to the remote server

Arguments

  1. number timeout

Returns this

public function disconnect()

Disconnects from the server

Returns this

public function getMeta()

Returns Meta Data

Returns array

public function probe($to)

Check to see who is online

Returns this

public function send($xml)

Sends xml data to host

Arguments

  1. string xml

Returns this

public function setAway($to = NULL, $message = NULL)

Set the presence to away

Arguments

  1. string|array to
  2. string message

Returns this

public function setDND($to = NULL, $message = NULL)

Set the presence to DND

Arguments

  1. string|array to
  2. string message

Returns this

public function setOffline($to = NULL, $message = NULL)

Set the presence to offline

Arguments

  1. string|array to
  2. string message

Returns this

public function setOnline($to = NULL, $message = NULL)

Set the presence to online

Arguments

  1. string|array to
  2. string message

Returns this

public function setPresence($to = NULL, $message = NULL, $type = NULL, $show = NULL)

Set the presence of a user

Arguments

  1. string|array to
  2. string message
  3. string type
  4. string presence title

Returns this

public function setResource($name)

Defines a resource name. This is usuall your app name.

Arguments

  1. string

Returns this

public function getRoster()

Requests for roster

Arguments

  1. string message

Returns this

public function setXA($to = NULL, $message = NULL)

Set the presence to XA ?

Arguments

  1. string|array to
  2. string message

Returns this

public function start()

Generic start up

Returns this

public function subscribeTo($to = NULL, $message = NULL)

Set the presence of a user

Arguments

  1. string|array to
  2. string message
  3. string type
  4. string presence title

Returns this

public function to($to, $text, $subject = NULL, $thread = NULL)

Sends a message to a user

Arguments

  1. string to whom to send to
  2. string text
  3. string subject
  4. string message type

Returns this

public function wait($timeout = 10)

Listens for imcoming data

Returns string XML

class Eden_Jabber_Error

XMPP/Jabber exception

Constants

  • CONNECTION_FAILED: Connection to %s on port %s failed
  • NO_FEATURES: Error: No feature information from server available
  • NOT_CONNECTED: Not connected
  • NO_JID: No jid given.
  • NO_AUTH_METHOD: No authentication method supported
  • NO_SASL: Server does not offer SASL authentication
  • SERVER_FAILED: Server sent a failiure message
  • TLS_CHANGE_FAILED: TLS mode change failed

© 2012 Openovate Labs. All rights reserved.