Download the PHP package impeto/mogreet-php without Composer

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

Disclaimer

This is a drastically modified version of the official Mogreet PHP repo, which you can find here. Please use that one if you are running PHP < 5.5 or if you, for some reason, do not use namespaces in your app.


Introduction

This is a PHP wrapper for the Mogreet API.

Installation

The installation is done via Composer:

Or by cloning this repo:

git clone https://github.com/impeto/mogreet-php.git

Usage examples

Create a client

There are two ways to create a client. One is by providing the Mogreet clientId and token to the Mogreet\Client class' constructor, like this:

The other way is by storing the clientId and token in two environment variables named MOGREET_CLIENT_ID and MOGREET_TOKEN respectively. Instantiating the Mogreet class with an empty constructor will instantiate the class with these values:

Laravel Support

The package includes a Laravel ServiceProvider as well as a Facade for easy access to functionality in Laravel style. All you have to do is to register the Service Provider and the Facade with the Laravel App in config/app.php file:

Then you can use it like this:

Configuration

When resolving the Mogreet\Client object form the Laravel IoC, using the Mogreet facade, app('mogreet') or app(Mogreet\Client::class), the MogreetServiceProvider will check for the existence of a config/mogreet.php file. If the file exists, it will use Laravel's Config mechanism to obtain the client_id and token values, like this: Config::get( 'mogreet.client_id') and Config::get( 'mogreet.token'). So, what you have to do is create a config/mogreet.php file with the following contents:

If the config file does not exist, then MogreetServiceProvider will instantiate the Client class with an empty constructor, which means that the client_id and token values will be obtained from the environment variables, as explained above. In order to use this package in Laravel style, you must at the least create the environment variables MOGREET_CLIENT_ID and MOGREET_TOKEN; otherwise you will have to instantiate the Client class manually as if you were using vanilla PHP.

Ping

Send an SMS to one recipient

Send an MMS to one recipient

Upload a media file

List all medias

Notes

With the Response object, you can print the plain JSON response of the API call (echo $response), or access directly a field (e.g: $response->message).

Due to the keyword restriction on 'list' and the existing function 'empty()' in PHP, I changed the mappings of the following API calls:

Full Documentation

The full documentation for the Mogreet API is available here

Prerequisites


All versions of mogreet-php with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
ext-curl Version *
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 impeto/mogreet-php contains the following files

Loading the files please wait ....