Coder Social home page Coder Social logo

php-sms's Introduction

andreas-weber/php-sms

Build Status

SMS library for PHP 5.3+.

Supported sms providers

Features

  • Send messages
  • Receive messages (only if gateway supports inbound messages)

Requirements

Check shipped composer.json.

Installation

Simply add a dependency on andreas-weber/php-sms to your project's Composer composer.json file.

Usage

Send a message

use AndreasWeber\SMS\Core\Gateway;
use AndreasWeber\SMS\Core\Gateway\Adapter\SMSTrade;
use AndreasWeber\SMS\Core\Message;

// create gateway
$gateway = new Gateway(
    new SMSTrade('XXXXXXXXXXXX'),
    true
);

// create message
$message = new Message(
    '+49160123456789',
    'php-sms',
    'Hello, how are you?'
);

// send message
$response = $gateway->send($message);

// print response
var_dump($response);

Receive messages

use AndreasWeber\SMS\Core\Gateway;
use AndreasWeber\SMS\Core\Gateway\Adapter\TextAnywhere;

// create gateway
$gateway = new Gateway(
    new TextAnywhere('XXXXXXXX', 'XXXXXXXX'),
    true
);

// receive messages
$messages = $gateway->fetch('+49177123456789');

// print messages
var_dump($messages);

Developer

Environment

Boot:

vagrant up

Enter virtual machine:

vagrant ssh

Run tests:

cd /vagrant
vendor/bin/phpunit src/Test/

Build targets

vagrant@andreas-weber:/vagrant$ ant
Buildfile: /vagrant/build.xml

help:
     [echo]
     [echo] The following commands are available:
     [echo]
     [echo] |   +++ Build +++
     [echo] |-- build                (Run the build)
     [echo] |   |-- dependencies     (Install dependencies)
     [echo] |   |-- tests            (Lint all files and run tests)
     [echo] |   |-- metrics          (Generate quality metrics)
     [echo] |-- cleanup              (Cleanup the build directory)
     [echo] |
     [echo] |   +++ Composer +++
     [echo] |-- composer             -> composer-download, composer-install
     [echo] |-- composer-download    (Downloads composer.phar to project)
     [echo] |-- composer-install     (Install all dependencies)
     [echo] |
     [echo] |   +++ Testing +++
     [echo] |-- phpunit              -> phpunit-full
     [echo] |-- phpunit-tests        (Run unit tests)
     [echo] |-- phpunit-full         (Run unit tests and generate code coverage report / logs)
     [echo] |
     [echo] |   +++ Metrics +++
     [echo] |-- coverage             (Show code coverage metric)
     [echo] |-- phploc               (Show lines of code metric)
     [echo] |-- qa                   (Run quality assurance tools)
     [echo] |-- |-- phpcpd           (Show copy paste metric)
     [echo] |-- |-- phpcs            (Show code sniffer metric)
     [echo] |-- |-- phpmd            (Show mess detector metric)
     [echo] |
     [echo] |   +++ Metric Reports +++
     [echo] |-- phploc-report        (Generate lines of code metric report)
     [echo] |-- phpcpd-report        (Generate copy paste metric report)
     [echo] |-- phpcs-report         (Generate code sniffer metric report)
     [echo] |-- phpmd-report         (Generate mess detector metric report)
     [echo] |
     [echo] |   +++ Tools +++
     [echo] |-- lint                 (Lint all php files)
     [echo]

Thoughts

Pull requests are highly appreciated. Built with love. Hope you'll enjoy.. :-)

php-sms's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.