Properties

$connection

$connection : 

Type

$session

$session : 

Type

$timeout

$timeout : 

Type

$server

$server : 

Type

$connect_server

$connect_server : 

Type

$port

$port : 

Type

$username

$username : 

Type

$password

$password : 

Type

$use_ssl

$use_ssl : 

Type

$resource

$resource : 

Type

$enable_logging

$enable_logging : 

Type

$log_array

$log_array : 

Type

$features

$features : 

Type

Methods

__construct()

__construct(  $server,   $port,   $username,   $password,   $use_ssl = false) 

Parameters

$server
$port
$username
$password
$use_ssl

can_use_ssl()

can_use_ssl() 

Able to use the SSL functionality?

can_use_tls()

can_use_tls() 

Able to use TLS?

set_resource()

set_resource(string  $name) 

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

Parameters

string $name

connect()

connect() 

Connect

disconnect()

disconnect() 

Disconnect

connected()

connected() 

Connected?

login()

login() : boolean

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

Returns

boolean

send()

send(string  $xml) : boolean

Send data to the Jabber server

Parameters

string $xml

Returns

boolean

open_socket()

open_socket(string  $server, integer  $port, boolean  $use_ssl = false) : boolean

OpenSocket

Parameters

string $server

host to connect to

integer $port

port number

boolean $use_ssl

use ssl or not

Returns

boolean

get_log()

get_log() 

Return log

add_to_log()

add_to_log(  $string) 

Add information to log

Parameters

$string

listen()

listen(  $timeout = 10,   $wait = false) : mixed

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.

Parameters

$timeout
$wait

Returns

mixed —

either false for timeout or an array with the received data

register()

register() : boolean

Initiates account registration (based on data used for contructor)

Returns

boolean

send_presence()

send_presence(  $message = '',   $type = '',   $unavailable = false) : boolean

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

Parameters

$message

online, offline...

$type

dnd, away, chat, xa or nothing

$unavailable

set this to true if you want to become unavailable

Returns

boolean

response()

response(array  $xml) : boolean

This handles all the different XML elements

Parameters

array $xml

Returns

boolean

send_message()

send_message(  $to,   $text,   $subject = '',   $type = 'normal') 

Parameters

$to
$text
$subject
$type

encrypt_password()

encrypt_password(array  $data) : string

Encrypts a password as in RFC 2831

Parameters

array $data

Needs data from the client-server connection

Returns

string

parse_data()

parse_data(string  $data) : array

parse_data like a="b",c="d",.

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

Parameters

string $data

Returns

array —

a => b ...

implode_data()

implode_data(array  $data) : string

opposite of jabber::parse_data()

Parameters

array $data

Returns

string

xmlize()

xmlize(  $data,   $skip_white = 1,   $encoding = 'UTF-8') 

xmlize()

Parameters

$data
$skip_white
$encoding

_xml_depth()

_xml_depth(  $vals,   $i) 

_xml_depth()

Parameters

$vals
$i