Class SMSSend_Site

Description

SMSSend Site

This class provides limited support for parsing SMSSend scripts.

SMS Web Sender requires certain standard parameters be available for all SMS Sites, therefore, along with the SMSSend script, you will also need to supply a config file. The config file should map the SMSSend parameters and error codes to the standard SMS Web Sender ones.

Please consider this class experimental, I haven't tested it enough so it might produce odd results. I also haven't looked at the SMSSend source code properly, so don't expect results identical to SMSSend. I've been relying on the SMSSend scripting docs: <http://zekiller.skytech.org/fichiers/smssend/doc_scr_en.html>

These features are still not supported by this class:

  • NoAdd <Name>
  • RTGetForm-<num>-<ind>
  • RTSubURL-<num>-<sub>
  • RTFollowFrame-<num>-<name>
  • RTRegex-<num>-<gpos>-<pos>-<regex>

Located in Program_Root/SMSSend_Site.php (line 53)

SMS_Site
   |
   --SMSSend_Site
Variable Summary
object HTTP_Request $http_request
array $script
array $search
Method Summary
void SMSSend_Site ()
void command_else ()
void command_elsesearch (string $arg)
bool command_go ()
void command_params (string $arg)
void command_postdata (string $arg)
void command_referer (string $arg)
void command_search (string $arg)
void command_setcookie (string $arg)
void command_sleep (string $arg)
string dynamic_rtfollowlink (mixed $arg)
string dynamic_rtformaction (mixed $arg)
string dynamic_rtgetinput (mixed $arg)
string dynamic_rtgetinput2 (mixed $arg)
string dynamic_rtgetinput3 (mixed $arg)
string dynamic_rtgetstring (mixed $arg)
string dynamic_rthost (mixed $num)
string dynamic_rtparams (mixed $num)
string dynamic_rturl (mixed $num)
void get_number ()
void get_param (mixed $param)
void get_param_option (mixed $param, mixed $option)
void get_param_value (mixed $param)
object HTTP_Response &get_phase_result ([int $num = null])
void param_exists (mixed $param)
void param_value_exists (mixed $param)
bool parse_script ()
void process_alias (mixed $line)
bool process_block (string $method, string $url)
void process_param (mixed $line)
string replace_params (string $arg)
bool script_exists (string $site_name)
bool send ()
void _replace_params_callback (mixed $match)
Variables
array $error_mapping (line 100)

Error mapping

Associative array mapping SMSSend script error codes to the standard SWS ones.

object HTTP_Request $http_request (line 107)

HTTP Request message

string $number_format (line 114)

Number format

array $param_mapping (line 77)

Param mapping

Associative array mapping SMSSend params to the standard SWS ones.

array $param_options (line 84)

Param options

array $param_values (line 91)

Param values

array $phase_cookies (line 69)

Phase cookies

Array holding cookies created by the SetCookie SMSSend command

array $phase_results (line 61)

Phase Results

Array holding instances if HTTP_Response

array $script (line 128)

Script

array $search (line 121)

Search

Inherited Variables

Inherited from SMS_Site

SMS_Site::$ccode
SMS_Site::$country_codes
SMS_Site::$error_num
SMS_Site::$error_string
SMS_Site::$html_functions
SMS_Site::$http_client
SMS_Site::$login_pass
SMS_Site::$login_user
SMS_Site::$message
SMS_Site::$number
SMS_Site::$site_name
Methods
Constructor SMSSend_Site (line 130)
void SMSSend_Site ()
command_else (line 426)

SMSSend command: Else (what to do if previous search terms didn't match)

void command_else ()
command_elsesearch (line 418)

SMSSend command: ElseSearch (alias to to Search in our case)

void command_elsesearch (string $arg)
  • string $arg:

    search text

command_go (line 474)

SMSSend command: GO

Submits HTTP Request and returns boolean (true on success, false on fail)

  • return:

    true if success, false if search match results in error

bool command_go ()
command_params (line 347)

SMSSend command: Params

void command_params (string $arg)
  • string $arg:

    querystring to append to URL

command_postdata (line 361)

SMSSend command: PostData

void command_postdata (string $arg)
  • string $arg:

    body of POST request

command_referer (line 373)

SMSSend command: Referer

void command_referer (string $arg)
  • string $arg:

    referer URL

command_search (line 388)

SMSSend command: Search

Search 
Look for text in the HTTP response. Must be followed be ErrorMsg or PrintMsg. Only ONE Search per bloc (for more searches, use ElseSearch after this one).

void command_search (string $arg)
  • string $arg:

    search text

command_setcookie (line 447)

SMSSend command: SetCookie <Phase> <Domain>-<Path>-<Name>=<Value>

void command_setcookie (string $arg)
  • string $arg
command_sleep (line 437)

SMSSend command: Sleep

void command_sleep (string $arg)
  • string $arg:

    seconds to sleep

dynamic_rtfollowlink (line 629)

SMSSend command: RTFollowLink-<num>-<name>

Returns link URL from HTML with name passed in $arg

string dynamic_rtfollowlink (mixed $arg)
dynamic_rtformaction (line 741)

SMSSend command: RTFormAction-<num>-<ind>

Returns the ACTION field of the form ind (the first form being 0) searched in the result from phase num (the first phase being 1, and automatic redirect being counted).

string dynamic_rtformaction (mixed $arg)
dynamic_rtgetinput (line 665)

SMSSend command: RTGetInput-<num>-<name>

Returns value of attribute VALUE from INPUT tag whose NAME attribute value matches that provided in <name>. Searched in the result from phase <num>

string dynamic_rtgetinput (mixed $arg)
dynamic_rtgetinput2 (line 685)

SMSSend command: RTGetInput2-<num>-<idx>-<flags>

Returns the fields (defined by flags) of the INPUT tag of index idx (the first input being 1) searched in the result from phase num (the first phase being 1, and automatic redirect being counted). Flags : {a:NAME=VALUE}{n:NAME}{v:VALUE}{t:TYPE}.

string dynamic_rtgetinput2 (mixed $arg)
dynamic_rtgetinput3 (line 720)

SMSSend command: RTGetInput3-<num>-<ind>-<idx>

Returns the NAME and VALUE fields of the INPUT tag of index idx (the first input being 1) of the form ind (the first form being 0) searched in the result from phase num (the first phase being 1, and automatic redirect being counted).

string dynamic_rtgetinput3 (mixed $arg)
dynamic_rtgetstring (line 647)

SMSSend command: RTGetString-<num>-<textBefore>

Returns string found just after textBefore (after removing spaces and string delimiters) searched in the result from phase num.

string dynamic_rtgetstring (mixed $arg)
dynamic_rthost (line 613)

SMSSend command: RTHost-<num>

Returns host used in phase $num request

string dynamic_rthost (mixed $num)
dynamic_rtparams (line 597)

SMSSend command: RTParams-<num>

Returns params string used in phase $num request

string dynamic_rtparams (mixed $num)
dynamic_rturl (line 582)

SMSSend command: RTURL-<num>

Returns URL string used in phase $num request

string dynamic_rturl (mixed $num)
get_number (line 167)

Get number (overrides method in SMS_Site)

Take into account $number_format specified in the script config file.

void get_number ()

Redefinition of:
SMS_Site::get_number()
Get Number
get_param (line 218)
void get_param (mixed $param)
get_param_option (line 229)
void get_param_option (mixed $param, mixed $option)
get_param_value (line 196)
void get_param_value (mixed $param)
get_phase_result (line 184)

Return phase result (HTTP_Response object) from phase $num

  • return:

    object

object HTTP_Response &get_phase_result ([int $num = null])
  • int $num:

    default: last result

param_exists (line 212)
void param_exists (mixed $param)
param_value_exists (line 206)
void param_value_exists (mixed $param)
parse_script (line 246)

Parse SMSSend script

Opens an SMSSend script and the SMS Web Sender config file for the script and begins to process it.

bool parse_script ()
process_alias (line 570)
void process_alias (mixed $line)
process_block (line 315)

Process a GetURL or PostURL block

bool process_block (string $method, string $url)
  • string $method:

    (either 'POST' or 'GET')

  • string $url
process_param (line 546)
void process_param (mixed $line)
replace_params (line 541)

Replace params

string replace_params (string $arg)
  • string $arg
reset_block_attributes (line 530)

Reset block attributes

Called at the start of each block

void reset_block_attributes ()
script_exists (line 144)

Script exists

  • static:
bool script_exists (string $site_name)
  • string $site_name
send (line 156)

Send SMS

  • return:

    true on success, false on error

bool send ()

Redefinition of:
SMS_Site::send()
Send message
_replace_params_callback (line 755)
void _replace_params_callback (mixed $match)

Inherited Methods

Inherited From SMS_Site

SMS_Site::SMS_Site()
SMS_Site::get_ccode()
SMS_Site::get_ccode_np()
SMS_Site::get_error()
SMS_Site::get_error_number()
SMS_Site::get_http_client()
SMS_Site::get_login_pass()
SMS_Site::get_login_user()
SMS_Site::get_message()
SMS_Site::get_number()
SMS_Site::get_number_nz()
SMS_Site::get_site_name()
SMS_Site::send()
SMS_Site::set_ccode()
SMS_Site::set_country_codes()
SMS_Site::set_http_client()
SMS_Site::set_login()
SMS_Site::set_message()
SMS_Site::set_number()
SMS_Site::set_site_name()
SMS_Site::supports_country()

Documention generated on Sat, 19 Jul 2003 03:43:25 +0100 by phpDocumentor 1.2.0