Download the PHP package samrap/teleapi-sms without Composer

On this page you can find all versions of the php package samrap/teleapi-sms. 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 teleapi-sms

Teleapi SMS

[Travis branch]() StyleCI

This package provides a fluent interface to the Teleapi SMS service.

Installation

Install via Composer:

composer require samrap/teleapi-sms

Usage

The Teleapi SMS package provides two classes which allow you to easily create and send text messages over HTTP.

The Client

The Client is used to send text messages to the Teleapi SMS service. The HTTP implementation is abstracted using [httplug](), allowing you to define any PSR-7 compliant client or adapter as the HTTP layer. This gives you full control over how requests are sent and allows you to easily mock API requests in unit tests.

To get started, you will need to choose the HTTP client you want to use. We recommend using the PHP HTTP CURL Client for simple applications and Guzzle for more complex apps. Of course, any PSR-7 compliant library can be used. In this example we will use the CURL Client.

First, we will add the CURL Client to our requirements:

composer require php-http/curl-client

Now that our HTTP client is installed, we can instantiate and use our SMS client:

We have now created our SMS client which is ready for use. Notice how we did not specify the HTTP client to use. Behind the scenes, the SMS client searches for any installed package that provides a php-http/client-implementation and loads it automagically. This will only work for some clients, it is better practice to specify the HTTP client explicitly. Have a look at Clients and Adapters in the PHP HTTP documentation on how to instantiate a client. Then, simply pass it as the second argument to the SMS Client's constructor:

In any case, we are now ready to use our SMS client, so let's create a Message and send it off!

All messages are represented by the Teleapi\Sms\Message class and are extremely simple to create:

Now, we can send the message on its way by calling the client's send method and passing the Message as its single argument:

We can check if the message sent successfully by calling the its sent method:

A complete example might look like the following:

More info & features coming soon!


All versions of teleapi-sms with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
php-http/client-implementation Version ^1.0
php-http/httplug Version ^1.1
guzzlehttp/psr7 Version ^1.3
php-http/message Version ^1.4
php-http/discovery Version ^1.1
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 samrap/teleapi-sms contains the following files

Loading the files please wait ....