Class mim_sendlog
Class used to send messages to Notify Anything plugin.
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 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