Sms Global api for Zend Framework (working)

Written by Emilio Alfredo Lodigiani. Posted in Approfondimenti, Programming

The popular Australian SMS provider Sms Global is releasing an API to use its services form a Zend Framework application. Unfortunately the code they are releasing is not working. It has lots of errors, that make the code unusable. The not working code is freely distributed from SmsGlobal here. I have recently downloaded and corrected the code, that now works perfectly in Zend Framework 1.11+. You can download the working library from the link below.

Download

Download package

Prerequisites

  • a working Zend Framework Project
  • for these installation instructions: a default Zend Framework project with default directory structure

Installation

  1. Copy the folder SmsGlobal contained in this archive in PROJECT/library/ (just where the directory Zend is, or other user libraries)
  2. Open the application.ini file (PROJECT/application/configs/application.ini) and add this line in [production] section: autoloaderNamespaces[] = "SmsGlobal_"

Usage

Example usage can be found in SmsGlobal directory (Sample.php). In your Zend controller you can use the library like this:
$smsAdapter = new SmsGlobal_Sms_Adapter_Http('username', 'password');
$sms = new SmsGlobal_Sms($smsAdapter);
$sms->setOrigin('61447100250');
$sms->setIsTwoWay(false); //if true the Origin is ignored and sent from a special number
$sms->addDestination('61447100250')
    ->addDestination('61447100251')
    ->addDestination('61447100252');
$sms->setMessage('Test message');
$sms->send();


Ultima modifica di il .

Nessun articolo correlato. / No related posts.

Contrassegnato con , , ,

Trackback dal tuo sito.

Emilio Alfredo Lodigiani

E' ingegnere informatico (Politecnico di Milano) e segue diversi progetti legati al web (piattaforme internet con funzioni operative, sistemi gestionali, comunicazione e online press). Lavora in giro per l'Italia. Vive su una collina in provincia di Piacenza.

Commenti (1)

Lascia un commento