Net_SMS
[ class tree: Net_SMS ] [ index: Net_SMS ] [ all elements ]

Class: Net_SMS_sms2email_http

Source Location: /Net_SMS-0.0.1/SMS/sms2email_http.php

Class Overview

Net_SMS
   |
   --Net_SMS_sms2email_http

Net_SMS_sms2email_http Class implements the HTTP API for accessing the sms2email (www.sms2email.com) SMS gateway.


Author(s):

Version:

  • $Revision: 1.23 $

Variables

Methods


Inherited Variables

Inherited Methods

Class: Net_SMS

Net_SMS::Net_SMS()
Constructor
Net_SMS::authenticate()
Authenticates against the gateway if required.
Net_SMS::factory()
Attempts to return a concrete Gateway instance based on $driver.
Net_SMS::getBalance()
If the current driver has a credit capability, queries the gateway for a credit balance and returns the value.
Net_SMS::getDefaultSendParams()
Returns send parameters for a gateway from the driver subclass getDefaultSendParams()function. These are parameters which are available to the user during sending, such as setting a time for delivery, or type of SMS (normal text or flash), or source address, etc.
Net_SMS::getDrivers()
Returns a list of available gateway drivers.
Net_SMS::getGatewayInfo()
Returns information on a gateway, such as name and a brief description, from the driver subclass getInfo() function.
Net_SMS::getGatewayParams()
Returns parameters for a gateway from the driver subclass getParams() function.
Net_SMS::hasCapability()
Query the current Gateway object to find out if it supports the given capability.
Net_SMS::send()
Sends a message to one or more recipients. Hands off the actual sending to the gateway driver.
Net_SMS::singleton()
Attempts to return a reference to a concrete Net_SMS instance based on $driver. It wil only create a new instance if no Net_SMS instance with the same parameters currently exists.

Class Details

[line 17]
Net_SMS_sms2email_http Class implements the HTTP API for accessing the sms2email (www.sms2email.com) SMS gateway.

Copyright 2003-2004 Marko Djukic <marko@oblo.com>

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

$Horde: framework/Net_SMS/SMS/sms2email_http.php,v 1.23 2004/04/29 16:38:52 mdjukic Exp $



[ Top ]


Class Variables

$capabilities = array('auth'        => false,
                              'batch'       => 100,
                              'multi'       => true,
                              'receive'     => false,
                              'credit'      => true,
                              'addressbook' => true,
                              'lists'       => true)

[line 34]

An array of capabilities, so that the driver can report which operations

it supports and which it doesn't. Possible values are: auth - The gateway requires authentication before sending; batch - Batch sending is supported; multi - Sending of messages to multiple recipients is supported; receive - Whether this driver is capable of receiving SMS; credit - Is use of the gateway based on credits; addressbook - Are gateway addressbooks supported; lists - Gateway support for distribution lists.


Type:   array


[ Top ]



Method Detail

addContact   [line 169]

mixed addContact( string $name, int $number)

Adds a contact to the gateway's addressbook.
  • Return: The remote contact ID on success or PEAR Error on failure.
  • Access: public

Parameters:

string   $name   —  The name for this contact
int   $number   —  The contact's phone number.

[ Top ]

deleteContact   [line 234]

mixed deleteContact( int $id)

Deletes a contact in the gateway's addressbook.
  • Return: True on success or PEAR Error on failure.
  • Access: public

Parameters:

int   $id   —  The contact's ID on the gateway.

[ Top ]

getAddressBook   [line 266]

mixed getAddressBook( )

Fetches the entire address book from the gateway.
  • Return: Array of contacts on success or PEAR Error on failure. Format of the returned contacts is for example: array(<uniqueid> => array('name' => <name>, 'number' => <number>), <uniqueid> => array('name' => <name>, 'number' => <number>));
  • Access: public

[ Top ]

getDefaultSendParams   [line 577]

array getDefaultSendParams( )

Returns the parameters that can be set as default for sending messages using this gateway driver and displayed when sending messages.
  • Return: Array of parameters that can be set as default.
  • Access: public

Overrides Net_SMS::getDefaultSendParams() (Returns send parameters for a gateway from the driver subclass getDefaultSendParams()function. These are parameters which are available to the user during sending, such as setting a time for delivery, or type of SMS (normal text or flash), or source address, etc.)
[ Top ]

getError   [line 650]

mixed getError( int $error, [optional $error_text = ''])

Returns a string representation of an error code.
  • Return: A textual message corrisponding to the error code or a PEAR Error if passed an existing error text.
  • Todo: Check which of these are actually required and trim down the list.
  • Access: public

Parameters:

int   $error   —  The error code to look up.
optional   $error_text   —  string $text An existing error text to use to raise a PEAR Error.

[ Top ]

getInfo   [line 531]

array getInfo( )

Identifies this gateway driver and returns a brief description.
  • Return: Array of driver info.
  • Access: public

[ Top ]

getList   [line 487]

mixed getList( string $id)

Fetches a specific distribution list from the gateway.
  • Return: An array of numbers in the list on success or PEAR Error on failure.
  • Access: public

Parameters:

string   $id   —  The ID of the distribution list to fetch.

[ Top ]

getLists   [line 439]

mixed getLists( )

Fetches a listing of available distribution lists on the server.
  • Return: An array of lists on success or PEAR Error on failure. Format of the returned lists is for example: array(<uniqueid> => array('name' => <name>), <uniqueid> => array('name' => <name>));
  • Access: public

[ Top ]

getParams   [line 553]

array getParams( )

Returns the required parameters for this gateway driver. The settable

parameters for this gateway are:

  • user - The username for authentication on the gateway;
  • password - The password for authentication on the gateway;
  • ssl - Whether or not to use SSL for communication with the gateway.
  • delivery_report - A URL for a script which would accept delivery report from the gateway.

  • Return: Array of required parameters.
  • Access: public

[ Top ]

getSendParams   [line 609]

array getSendParams( $params)

Returns the parameters for sending messages using this gateway driver, displayed when sending messages. These are filtered out using the default values set up when creating the gateway.
  • Return: Array of required parameters.
  • Todo: Would be nice to use a time/date setup rather than minutes from now for the delivery time. Upload field for ringtones/logos?
  • Access: public

Parameters:

   $params   — 

[ Top ]

listCreate   [line 314]

mixed listCreate( string $name, array $numbers)

Creates a new distribution list on the gateway.
  • Return: Gateway ID for the created list on success or PEAR Error on failure.
  • Access: public

Parameters:

string   $name   —  An arbitrary name for the new list.
array   $numbers   —  A simple array of numbers to add to the list.

[ Top ]

listDelete   [line 349]

mixed listDelete( string $id)

Deletes a distribution list from the gateway.
  • Return: True on success or PEAR Error on failure.
  • Access: public

Parameters:

string   $id   —  The gateway ID for the list to delete.

[ Top ]

listRename   [line 424]

mixed listRename( string $id, string $name)

Renames a distribution list on the gateway. Does nothing other than calling the listUpdate() function with just the $id and $name variables.
  • Return: True on success or PEAR Error on failure.
  • Access: public

Parameters:

string   $id   —  The gateway ID for the list to update.
string   $name   —  The new arbitrary name for the list.

[ Top ]

listUpdate   [line 386]

mixed listUpdate( string $id, string $name, [optional $numbers = array()])

Updates a distribution list on the gateway.
  • Return: True on success or PEAR Error on failure.
  • Access: public

Parameters:

string   $id   —  The gateway ID for the list to update.
string   $name   —  The arbitrary name of the list. If different from the original name that the list was created under, the list will be renamed.
optional   $numbers   —  string $numbers The new list of numbers in the list. If left empty, the result will be the same as calling the listRename() function.

[ Top ]

updateContact   [line 203]

mixed updateContact( int $id, string $name, int $number)

Updates a contact in the gateway's addressbook.
  • Return: True on success or PEAR Error on failure.
  • Access: public

Parameters:

int   $id   —  The contact's ID on the gateway.
string   $name   —  The name for this contact
int   $number   —  The contact's phone number.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 10:17:14 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.