Class jabber

Description

Jabber class from Flyspray project

  • author:

    Florian Schmitz (floele)

    Only slightly modified by Acyd Burn

  • version: class.jabber2.php 1488 2007-11-25
  • copyright: 2006 Flyspray.org

Located in /includes/functions_jabber.php (line 31)


	
			
Variable Summary
 mixed $connection
 mixed $features
 mixed $log_array
 mixed $password
 mixed $port
 mixed $resource
 mixed $server
 mixed $session
 mixed $timeout
 mixed $username
 mixed $use_ssl
Method Summary
 jabber jabber ( $server,  $port,  $username,  $password, [ $use_ssl = false])
 void add_to_log ( $string)
 void can_use_ssl ()
 void can_use_tls ()
 void connect ()
 void connected ()
 void disconnect ()
 string encrypt_password (array $data)
 void get_log ()
 string implode_data (array $data)
 mixed listen ([ $timeout = 10], [ $wait = false])
 bool login ()
 bool open_socket (string $server, int $port, [bool $use_ssl = false])
 array parse_data (string $data)
 bool register ()
 bool response (array $xml)
 bool send (string $xml)
 void send_message ( $to,  $text, [ $subject = ''], [ $type = 'normal'])
 bool send_presence ([$message $message = ''], [$type $type = ''], [$unavailable $unavailable = false])
 void set_resource (string $name)
 void xmlize ( $data, [ $skip_white = 1], [ $encoding = 'UTF-8'])
 void _xml_depth ( $vals,  &$i)
Variables
mixed $connection = null (line 33)
mixed $enable_logging (line 44)
mixed $features = array() (line 47)
mixed $log_array (line 45)
mixed $password (line 40)
mixed $port (line 38)
mixed $resource = 'functions_jabber.phpbb.php' (line 42)
mixed $server (line 37)
mixed $session = array() (line 34)
mixed $timeout = 10 (line 35)
mixed $username (line 39)
mixed $use_ssl (line 41)
Methods
Constructor jabber (line 51)
jabber jabber ( $server,  $port,  $username,  $password, [ $use_ssl = false])
  • $server
  • $port
  • $username
  • $password
  • $use_ssl
add_to_log (line 259)

Add information to log

void add_to_log ( $string)
  • $string
can_use_ssl (line 72)

Able to use the SSL functionality?

void can_use_ssl ()
can_use_tls (line 81)

Able to use TLS?

void can_use_tls ()
connect (line 116)

Connect

void connect ()
connected (line 166)

Connected?

void connected ()
disconnect (line 145)

Disconnect

void disconnect ()
encrypt_password (line 693)

Encrypts a password as in RFC 2831

  • access: public
string encrypt_password (array $data)
  • array $data: Needs data from the client-server connection
get_log (line 246)

Return log

void get_log ()
implode_data (line 759)

opposite of jabber::parse_data()

  • access: public
string implode_data (array $data)
  • array $data
listen (line 273)

Listens to the connection until it gets data or the timeout is reached.

Thus, it should only be called if data is expected to be received.

  • return: either false for timeout or an array with the received data
  • access: public
mixed listen ([ $timeout = 10], [ $wait = false])
  • $timeout
  • $wait
login (line 177)

Initiates login (using data from contructor, after calling connect())

  • access: public
bool login ()
open_socket (line 217)

OpenSocket

  • access: public
bool open_socket (string $server, int $port, [bool $use_ssl = false])
  • string $server: host to connect to
  • int $port: port number
  • bool $use_ssl: use ssl or not
parse_data (line 727)

parse_data like a="b",c="d",... or like a="a, b", c, d="e", f=g,...

  • return: a => b ...
  • access: public
array parse_data (string $data)
  • string $data
register (line 308)

Initiates account registration (based on data used for contructor)

  • access: public
bool register ()
response (line 353)

This handles all the different XML elements

  • access: public
bool response (array $xml)
  • array $xml
send (line 194)

Send data to the Jabber server

  • access: public
bool send (string $xml)
  • string $xml
send_message (line 668)
void send_message ( $to,  $text, [ $subject = ''], [ $type = 'normal'])
  • $to
  • $text
  • $subject
  • $type
send_presence (line 328)

Sets account presence. No additional info required (default is "online" status)

  • access: public
bool send_presence ([$message $message = ''], [$type $type = ''], [$unavailable $unavailable = false])
  • $message $message: online, offline...
  • $type $type: dnd, away, chat, xa or nothing
  • $unavailable $unavailable: set this to true if you want to become unavailable
set_resource (line 108)

Sets the resource which is used. No validation is done here, only escaping.

  • access: public
void set_resource (string $name)
  • string $name
xmlize (line 774)

xmlize()

  • author: Hans Anderson
  • copyright: Hans Anderson / http://www.hansanderson.com/php/xml/
void xmlize ( $data, [ $skip_white = 1], [ $encoding = 'UTF-8'])
  • $data
  • $skip_white
  • $encoding
_xml_depth (line 810)

_xml_depth()

  • author: Hans Anderson
  • copyright: Hans Anderson / http://www.hansanderson.com/php/xml/
void _xml_depth ( $vals,  &$i)
  • $vals
  • &$i

Documentation generated on Tue, 26 Aug 2008 08:34:04 +0200 by phpDocumentor 1.4.2