2017 © Pedro Peláez
 

library phalcon-sms-factory

Multiple gateway SMS Sender factory. Provide any SMS services inside your Phalcon's projects

image

stanislav-web/phalcon-sms-factory

Multiple gateway SMS Sender factory. Provide any SMS services inside your Phalcon's projects

  • Thursday, June 25, 2015
  • by stanislav-web
  • Repository
  • 9 Watchers
  • 30 Stars
  • 1,540 Installations
  • HTML
  • 1 Dependents
  • 0 Suggesters
  • 6 Forks
  • 2 Open issues
  • 10 Versions
  • 0 % Grown

The README.md

Multiple SMS Sender factory

Scrutinizer Code Quality Code Coverage Build Status Total Downloads Latest Stable Version Phalconist License, (*1)

Description

This service makes SMS through a variety of providers. You can easily implement your own providers using the interface design. At the moment, provides an interface to send and check your balance for the next:, (*2)

- BulkSMS
- Clickatell
- MessageBird
- Nexmo
- SmsAero
- SMSC
- SmsUkraine
- SMS.ru

Change Log

In Future

- Support SMS mass mailing

[v 1.2.3-stable] 2015-04-15

- Add single error handler
- Add SMS.ru provider
- Send SMS Unit Tests

[v 1.2.2-beta] 2015-02-08

- Add view balance
- Add development info (API) / UML
- Reformat to PSR-1/PSR-2

[v 1.1-beta] 2015-02-07

- Add response debugger (Show server response headers)

[v 1.0-beta] 2015-02-06

- Sending SMS use multiple providers

Compatible

  • PSR-0, PSR-1, PSR-2, PSR-4 Standards

System requirements

  • PHP 5.4 >
  • Phalcon extension 1.3.x
  • PHP libcurl or Stream Socket client

Install

First update your dependencies through composer. Add to your composer.json:, (*3)

"require": {
    "stanislav-web/phalcon-sms-factory": "1.2.*@stable",
}

Then run to update dependency and autoloader, (*4)

php composer.phar update
php composer.phar install

or just, (*5)

php composer.phar require stanislav-web/phalcon-sms-factory 1.2.*@stable

(Do not forget to include the composer autoloader), (*6)

You can create an injectable service, (*7)

    $di->set('SMS', function () use ($di) {

        return new SMSFactory\Sender($di);
    });

Usage

Configure providers

SMS services have a variety of settings, both mandatory and optional. You can select them in the global configuration file of your project. I intentionally did not make the settings in each provider, as this service will be maintained and no time to change. Therefore, when updating via the composer, your settings will not be overwritten, if you will be making their to global application config. See example:, (*8)

<?php
    // add to your app config and write down your settings .The key 'sms' is required
    'sms'   =>  [

                'Nexmo'         =>  [
                    'from'      => '',
                    'api_key'   => '',
                    'api_secret'=> '',
                    'type'      => '',
                    'request_method' => ''
                ],
                'BulkSMS'   =>  [
                    'username'  => '',
                    'password'  => '',
                ],
                'SmsAero' => [
                    'from'          => '',
                    'user'          => '',
                    'password'      => '',
                ],

                'SmsUkraine'       =>  [
                    'from'          => '',
                    'login'         => '',
                    'password'      => '',
                    'version'       => '',
                ],

                'SMSC'       =>  [
                    'login'     => '',
                    'psw'       => '',
                    'charset'   => '',
                    'sender'    => '',
                ],

                'SMSRu' => [
                    'api_id'    => ''
                ],

                'Clickatell'    => [
                    'api_id'    => '',
                    'user'      => '',
                    'password'  => '',
                    'from'      => '',
                    'request_method' => ''
                ],
                'MessageBird'   => [
                    'originator'   => '',
                    'access_key'   => '',
                    'request_method' => ''
                ]           
    ];

Send SMS and view balance

Now you can call your created service of sending sms., (*9)

<?php

    // get sms service
    $sms = $this->di->get('SMS');

    // send message via SmsAero (available 7 providers)
    $response = $sms->call('SmsAero')->setRecipient('NUMBER')->send('MESSAGE'));

    // get balance of SmsAero account
    $response = $sms->call('SmsAero')->balance();

    // use debug to show headers
    $response = $sms->call('SmsProvider')->debug(true)->setRecipient('NUMBER')->send('MESSAGE'));
    $response = $sms->call('SmsProvider')->debug(true)->balance();

Unit Test

Also available in /phpunit directory. Run command to start, (*10)

phpunit --configuration phpunit.xml.dist --coverage-text

Change Log

Contributing and development

I have enclosed instructions API and related classes Diagram., (*11)

I am accept bug reports, new feature requests and pull requests in GitHub., (*12)

If you have a question about how to use this service, please see this README., (*13)

If you have a change or new feature in mind, please see this README again and follow DRI (development rules interfaces)., (*14)

You can add new providers following interfaces: - ProviderConfigInterface - ProviderInterface, (*15)

You can add own or choise exists of request's client. Also available:, (*16)

Issues

The Versions

25/06 2015

dev-master

9999999-dev https://github.com/stanislav-web/phalcon-sms-factory

Multiple gateway SMS Sender factory. Provide any SMS services inside your Phalcon's projects

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

phalcon phalcon sms phalcon sms providers phalcon send sms phalcon sms service

15/04 2015

1.2.3-stable

1.2.3.0 https://github.com/stanislav-web/phalcon-sms-factory

Multiple gateway SMS Sender factory. Provide any SMS services inside your Phalcon's projects

  Sources   Download

MIT

The Requires

 

The Development Requires

phalcon phalcon sms phalcon sms providers phalcon send sms phalcon sms service

15/04 2015

dev-scrutinizer-patch-2

dev-scrutinizer-patch-2 https://github.com/stanislav-web/phalcon-sms-factory

Multiple gateway SMS Sender factory. Provide any SMS services inside your Phalcon's projects

  Sources   Download

MIT

The Requires

 

The Development Requires

phalcon phalcon sms phalcon sms providers phalcon send sms phalcon sms service

15/04 2015

dev-Release

dev-Release https://github.com/stanislav-web/phalcon-sms-factory

Multiple gateway SMS Sender factory. Provide any SMS services inside your Phalcon's projects

  Sources   Download

MIT

The Requires

 

The Development Requires

phalcon phalcon sms phalcon sms providers phalcon send sms phalcon sms service

13/02 2015

dev-Massmailing

dev-Massmailing https://github.com/stanislav-web/phalcon-sms-factory

Multiple gateway SMS Sender factory. Provide any SMS services inside your Phalcon's projects

  Sources   Download

MIT

The Requires

 

phalcon phalcon sms phalcon sms providers phalcon send sms phalcon sms service

09/02 2015

1.2.2-beta

1.2.2.0-beta https://github.com/stanislav-web/phalcon-sms-factory

Multiple gateway SMS Sender factory. Provide any SMS services inside your Phalcon's projects

  Sources   Download

MIT

The Requires

 

phalcon phalcon sms phalcon sms providers phalcon send sms phalcon sms service

09/02 2015

dev-scrutinizer-patch-1

dev-scrutinizer-patch-1 https://github.com/stanislav-web/phalcon-sms-factory

Multiple gateway SMS Sender factory. Provide any SMS services inside your Phalcon's projects

  Sources   Download

MIT

The Requires

 

phalcon phalcon sms phalcon sms providers phalcon send sms phalcon sms service

08/02 2015

1.2-beta

1.2.0.0-beta https://github.com/stanislav-web/phalcon-sms-factory

Phalcon SMS Factory. Provide any SMS services inside your Phalcon's projects

  Sources   Download

MIT

The Requires

 

phalcon phalcon sms phalcon sms providers

08/02 2015

1.1-beta

1.1.0.0-beta https://github.com/stanislav-web/phalcon-sms-factory

Phalcon SMS Factory. Provide any SMS services inside your Phalcon's projects

  Sources   Download

MIT

The Requires

 

phalcon phalcon sms phalcon sms providers

07/02 2015

1.0-beta

1.0.0.0-beta https://github.com/stanislav-web/phalcon-sms-factory

Phalcon SMS Factory. Provide any SMS services inside your Phalcon's projects

  Sources   Download

MIT

The Requires

 

phalcon phalcon sms phalcon sms providers