Download the PHP package carpe-hora/smssender without Composer

On this page you can find all versions of the php package carpe-hora/smssender. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package smssender

SmsSender Build Status

SmsSender is a library which helps you send SMS through your web applications. It provides an abstraction layer for sms manipulations. The library is splitted in two parts: HttpAdapter and Provider and is really extensible.

N.B: there is also a bundle integrating this library in Symfony2 applications.

Status

This project is DEPRECATED and should NOT be used.

If someone magically appears and wants to maintain this project, I'll gladly give access to this repository.

HttpAdapters

HttpAdapters are responsible to get data from remote APIs.

Currently, there are the following adapters:

Providers

Providers contain the logic to extract useful information.

The following providers are supported:

Installation

The recommended way to install SmsSender is through composer.

Just create a composer.json file for your project:

Usage

First, you need an adapter to query an API:

The BuzzHttpAdapter is tweakable, actually you can pass a Browser object to this adapter:

Now, you have to choose your provider.

You can use one of the builtin providers or write your own. You can also register all providers and decide later. That's we'll do:

Everything is ok, enjoy!

API

The main method is called send() which receives a phone number, a message and the name of the originator.

The send() method returns a Sms result object with the following API, this object also implements the ArrayAccess interface:

The SmsSender's API is fluent, you can write:

The using() method allows you to choose the adapter to use. When you deal with multiple adapters, you may want to choose one of them. The default behavior is to use the first one but it can be annoying.

Single Recipient Strategy

Sometimes you want to configure a single recipient strategy in the development environment to avoid sending SMS to real users, but still allow the developer to check the rendered message in an SMS reader.

By using the SingleRecipientSender, you'll be able to send your SMS without any other changes thanks to the decorator pattern. Just pass your in-use sender (SmsSender for instance) and a recipient phonenumber, and you're done.

All SMS now will be sent to 0601010101, but in a transparent way:

Delayed sendings

By default, SmsSender sends messages right when you call the send method. However, if you want to avoid the performance hit of the communication between SmsSender and the SMS providers, you can choose to use a "delayed sender".

This sender works by putting the messages in a pool instead of sending them directly. This means you can for instance wait until the response is streamed to the user before really send the messages.

Currently, the supported pool is a MemoryPool. Here is an example of how to set it up:

Extending Things

You can provide your own adapter, you just need to create a new class which implements HttpAdapterInterface.

You can also write your own provider by implementing the ProviderInterface.

Note, the AbstractProvider class can help you by providing useful features.

Unit Tests

To run unit tests, you'll need a set of dependencies you can install using composer:

Once installed, just launch the following command:

You'll obtain some skipped unit tests due to the need of API keys.

Rename the phpunit.xml.dist file to phpunit.xml, then uncomment the following lines and add your own API keys:

You're done.

Thanks

As this library is heavily inspired from willdurand's Geocoder, he deserves a special mention in this README ;)

Credits

License

SmsSender is released under the MIT License. See the bundled LICENSE file for details.


All versions of smssender with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package carpe-hora/smssender contains the following files

Loading the files please wait ....