Miranda IM Sendlog 2.0 API Documentation

Miranda IM Sendlog   2.0.3.20030701   (major.minor.build.yyyymmdd)
Copyright (c) 2003 by Michal Nazarewicz (mina86@tlen.pl)
Based on sendlog in php 0.0.2.1 by HuzursuZ

Changelog

2.0.3.20030701 1.1.2.20030519 1.0.1.20030518

Class mim_sendlog

Class used to send messages to Notify Anything plugin.

Constructor mim_sendlog

Definition:
mim_sendlog( [string $host [, int $port [, int $timeout]]] )
Description:
Initializes all class varibles. In fact it executes set_conection_options() method.
Parameters:
$host, $port, $timeout
For descriptions of parameters see set_conection_options() method's description.
See also:
set_connection_options()

Method get_error

Definition:
string get_error()
Description:
Returns error message. If error message is empty string then there was no error during sending last message.
See also:
$error
error()

Methods send_message(), send_notice() and send_error()

Definition:
send_message( [string $title, ] string $message )
send_notice( [string $title, ] string $message )
send_error( [string $title, ] string $message )
Description:
Those 3 methods send message, notice or error message. To connect they're using options set by set_connection_options() method or constructor.
Those 3 methods use send() method (which is private) to connect and send message to NotifyAnything plugin.
Return:
If everything went OK return true. If there was an error return false and set $error which can be read using get_error() method.
Parameters:
If one parameter is specyfied it is message body. If two parameters are specyfied the first one is message title (first line of popup, usually bold) and the second one is message body.
In current version of script nighter $title nor $message can contain '#'.
See also:
get_error()
set_connection_options()
send()

Method set_connection_options

Definition:
void set_connection_options ([string $host = null [, int $port = null [, int $timeout = null]]])
Description:
Method sets settings used by send() method while connecting to NotyfiAnything plugin. For more informations about those values see documentation of fsockopen() function.
Method dose not check if given parameters are correct. If they're wrong send() method won't be able to send message.
Paramaters:
$host, $port, $timeout
If one of the parameters is null then method won't change value of the setting. Default values of all parameters is null.
For descriptions of parameters see fsockopen() function's description in PHP Manual.
See also:
get_host()
get_timeout()
send_*()
send()
$host
$port
$timeout

Method get_host

Definition:
string get_host()
Returns:
Method returns string with host and port eg. 'localhost:12001'. To get host and port in array as separate values use explode(':', get_host()).
See also:
set_connection_options()
$host
$port

Method get_timeout

Definition:
string get_timeout()
Returns:
Method returns timeout.
See also:
set_connection_options()
$timeout

Method send

Definition:
protected boolean send( string $message )
Description:
Connects to NotifyAnything plugin and sends message.
This method is protected so it should not be use outside of this class.
Returns:
Method returns true if everything went OK or false if there was an error. If error occured $error is set (to get error message use get_error() method.
Parameters:
$message -message to send
See also:
set_connection_options()
send_*()

Method error

Definition:
protected mixed error( string $error [, mixed $ret] )
Description:
Sets $error.
This method is protected so it should not be use outside of this class.
Returns:
Method returns value of $ret parameter.
Parameters:
$ret -value to return (default is false)
See also:
get_error()
$error

Varible error

Definition:
protected string $error
Description:
Conteins error message. If this varible is empty then there was no error while sending last message.
This varible is protected so it should not be use outside of this class.
See also:
get_error()
error()

Varible host

Definition:
private string $host
Description:
Contains host to which script is connecting while sending message.
This varible is private so it should not be use outside of this class.
See also:
set_connection_options()
$port
$timeout

Varible port

Definition:
private int $port
Description:
Contains port to which script is connecting while sending message.
This varible is private so it should not be use outside of this class.
See also:
set_connection_options()
$host
$timeout

Varible timeout

Definition:
private int $timeout
Description:
Specyfi how long will script wait for connection.
This varible is private so it should not be use outside of this class.
See also:
set_connection_options()
$host
$port