FreenetIS
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Sms Class Reference

Abstract class for SMS drivers. More...

Inheritance diagram for Sms:
Sms_Klikniavolej Sms_Soudvinv100

Public Member Functions

 set_hostname ($hostname)
 Sets hostname of gate.
 set_user ($user)
 Sets user to gate.
 set_password ($password)
 Sets password to gate.
 set_test ($test)
 Sets test (no SMS are sended, just states are made).
 get_status ()
 Gets state of message.
 get_error ()
 Gets error report.
 test_conn ()
 Test if connection to server is OK.
 send ($sender, $recipient, $message)
 Try to send SMS messages.
 receive ()
 Try to receive SMS messages.
 get_received_messages ()
 Gets recieved messages after receive.

Static Public Member Functions

static factory ($driver)
 Factory for SMS drivers.
static get_driver_name ($driver, $with_help=FALSE)
 Gets name of driver.
static get_drivers ()
 Gets drivers array.
static get_active_drivers ()
 Gets list of active drivers for selectboxes.
static has_active_driver ()
 Check if there are any active drivers.
static enabled ()
 Checks if SMS are enabled on server.

Public Attributes

const DRIVER_CLASS_PREFIX = 'Sms_'
const DRIVER_INACTIVE = 1
const DRIVER_ACTIVE = 2
const SOUNDWINV100 = 2
const KLIKNIAVOLEJ = 3

Protected Member Functions

 __construct ()
 Construct cannot be called from outside.

Protected Attributes

 $hostname
 $user
 $password

Detailed Description

Abstract class for SMS drivers.

Author
Roman Sevcik, Ondrej Fibich

Member Function Documentation

static Sms::enabled ( )
static

Checks if SMS are enabled on server.

Returns
bool
static Sms::factory (   $driver)
static

Factory for SMS drivers.

Parameters
mixed$driverString index of driver or integer ID of driver.
Returns
Sms Sms instance or NULL if driver name or ID is incorect.
static Sms::get_active_drivers ( )
static

Gets list of active drivers for selectboxes.

Key is id of driver and value is name.

Returns
array
static Sms::get_driver_name (   $driver,
  $with_help = FALSE 
)
static

Gets name of driver.

Parameters
integer$driverString index of driver or integer ID of driver.
boolean$with_helpShould contain name help as well [optional]
Returns
string
static Sms::get_drivers ( )
static

Gets drivers array.

Returns
array
Sms::get_error ( )
abstract

Gets error report.

Returns
mixed Error report or FALSE on no error

Reimplemented in Sms_Soudvinv100, and Sms_Klikniavolej.

Sms::get_received_messages ( )
abstract

Gets recieved messages after receive.

Returns
array

Reimplemented in Sms_Klikniavolej, and Sms_Soudvinv100.

Sms::get_status ( )
abstract

Gets state of message.

Returns
mixed State or FALSE on no error

Reimplemented in Sms_Soudvinv100, and Sms_Klikniavolej.

static Sms::has_active_driver ( )
static

Check if there are any active drivers.

Returns
bool
Sms::receive ( )
abstract

Try to receive SMS messages.

Returns
boolean FALSE on error TRUE on success

Reimplemented in Sms_Klikniavolej, and Sms_Soudvinv100.

Sms::send (   $sender,
  $recipient,
  $message 
)
abstract

Try to send SMS messages.

Parameters
string$senderSender of message
string$recipientRecipier of message
string$messageText of message
Returns
boolean FALSE on error TRUE on success

Reimplemented in Sms_Soudvinv100, and Sms_Klikniavolej.

Sms::set_hostname (   $hostname)

Sets hostname of gate.

Parameters
string$hostname

Reimplemented in Sms_Klikniavolej.

Sms::set_password (   $password)

Sets password to gate.

Parameters
string$password
Sms::set_test (   $test)

Sets test (no SMS are sended, just states are made).

Do nothing by default.

Parameters
bool$test

Reimplemented in Sms_Klikniavolej.

Sms::set_user (   $user)

Sets user to gate.

Parameters
string$user
Sms::test_conn ( )
abstract

Test if connection to server is OK.

Returns
bool

Reimplemented in Sms_Klikniavolej, and Sms_Soudvinv100.


The documentation for this class was generated from the following file: