SMS_Web_Sender -

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
<?php // $Id$ / // main SMS Web Sender classes if (!defined('SWS_CLASS_DIR')) { define('SWS_CLASS_DIR', dirname(__FILE__).'/'); } // SMS Web Sender site classes if (!defined('SWS_SITE_DIR')) { define('SWS_SITE_DIR', realpath(SWS_CLASS_DIR.'. ./sites').'/'); } // SMSSend scripts if (!defined('SWS_SMSSEND_SITE_DIR')) { define('SWS_SMSSEND_SITE_DIR', realpath(SWS_CLASS_DIR.'. ./smssend_sites').'/'); } // include User_Agent from HTTP Navigator classes require_once(HTTPNAV_ROOT.'User_Agent.php'); // include SMS_Site class require_once(SWS_CLASS_DIR.'SMS_Site.php'); r // Error constants define('SWS_ERR_LOGIN', 1); define('SWS_ERR_QUOTA', 2); define('SWS_ERR_SEND', 3); define('SWS_ERR_UNKNOWN', 4); d /** * SMS Web Sender * * Instance of this class should be used to handle SMS requests. * * @author Keyvan Minoukadeh <[email protected]> * @version 2.0 */ class SMS_Web_Sender { /** * HTTP client (instance of User_Agent from HTTP Navigator) * @var object User_Agent */ var $http_client; /** * SMS Sites * @var array */ var $sms_sites; /** * Current site * @var object */ var $current_site; /** * Allow SMSSend scripts * @var bool */
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
var $allow_smssend; function SMS_Web_Sender() { $this->set_allow_smssend(true); $this->sms_sites = array(); // for array shuffle srand((float)microtime()*1000000); // set up HTTP client $options = array( 'agent' => 'Mozilla/6.0 (compatible; MSIE 5.01; Windows NT)', 'protocols_allowed' => array('HTTP', 'HTTPS'), 'cookie_jar' => true, 'http_version' => '1.0', 'lax_redirect' => true, 'max_size' => 35*1024, 'keep_alive' => 0, 'timeout' => 8, 'timeout_rw' => 10, 'gzip_support' => true, 'scheme_implementor' => array('HTTP'=>'Protocol_HTTP', 'HTTPS'=>'Protocol_CURL') ); $ua =& new User_Agent($options); $this->set_http_client($ua); } /** * Set allow SMSSend * * If enabled add_site() and get_site_names() will also look in the * smssend_sites folder to find sites. * * @param bool $allow pass true to enable, false to disable */ function set_allow_smssend($allow) { $this->allow_smssend = $allow; } /** * Get allow SMSSend * * @return bool */ function get_allow_smssend() { return $this->allow_smssend; } /** * Set HTTP client * @param object $ua User_Agent object */ { $this->http_client =& $ua; }
Background image of page 2
/** * Get HTTP client * @return object User_Agent object */
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/31/2011 for the course CS 302 taught by Professor J.parker during the Spring '08 term at University of Texas.

Page1 / 7

SMS_Web_Sender -

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online