Download the PHP package moonlydays/php-kannel without Composer

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

PHP Kannel

Tests Latest Version on Packagist License

A PSR-compliant PHP client for the Kannel SMS gateway. Handles outbound SMS via sendsms, bearerbox admin commands, and inbound DLR/MO callback parsing — with typed value objects, enums, and a clean extensibility surface.

Features

Requirements

Installation

Quick start

Configuration

Gateway

Gateway is an immutable value object carrying everything needed to talk to one Kannel installation.

The httpMethod choice is deliberate — the library doesn't pick for you. Use Post when you want credentials out of access logs; Get when Kannel is configured to accept only GET.

Multi-gateway

Single-gateway users don't see the registry — new Client($gateway) normalizes internally.

Swapping the HTTP client

Every PSR dependency is optional. Pass your own to override the Guzzle defaults.

Sending messages

SmsBuilder is the only supported way to construct an Sms. It validates invariants (recipient required, text XOR binary) on build().

Sending results

Delivery reports (DLR)

Configuring dlr-url

Kannel substitutes placeholders (%d, %p, %T, %I, …) in your callback URL before hitting it. The library gives you two ways to build the URL — explicit or via a binding.

Explicit — full control over query key names:

Convention-based — shared with the inbound parser:

The same $binding is then passed to InboundHandler on the receiving side, so the two halves agree on query key names without duplicated string literals.

Receiving DLR callbacks

The handler reads both query params and parsed body, so it works regardless of whether Kannel was configured to POST or GET the callback.

Mobile originated messages (MO)

Admin API

Requires the gateway to have AdminCredentials attached. Each command maps to a typed method.

GatewayStatus exposes version, uptime string, SMS counters, DLR queue depth, a list of SmscStatus and a list of BoxStatus.

Constructing an AdminClient on a gateway without admin credentials throws ConfigurationException.

Events (PSR-14)

Pass any PSR-14 dispatcher to receive events:

Event Dispatched by Fired
MessageSending Client::send() Before the transport runs
MessageSent Client::send() After the transport returns (success or Kannel err)
MessageFailed Client::send() When the transport throws
DlrReceived InboundHandler After receiveDlr() parses successfully
MoReceived InboundHandler After receiveMo() parses successfully

All events are readonly DTOs carrying the relevant Sms / Gateway / SendResult / DeliveryReport / IncomingMessage.

Logging (PSR-3)

The client emits:

Testing

FakeClient is a drop-in ClientInterface implementation that records sends and returns configurable results.

Configure per-gateway failure to test fallback logic:

Running the package's own tests

Exception handling

Every exception thrown by this package implements MoonlyDays\Kannel\Exception\ExceptionInterface, so you can catch them all with one type:

Exception Meaning
TransportException HTTP-level failure (network, DNS, TLS) reaching Kannel
AdminCommandFailedException Admin command returned 4xx/5xx
MalformedResponseException status.xml unparseable, DLR missing required keys, unknown status code
ConfigurationException Package misused (no recipient, missing admin creds, etc.)
GatewayNotFoundException Registry lookup failed

Kannel answering with a non-success status (e.g. 3: Malformed data) is not an exception — it comes back as a SendResult with a non-success SendStatus.

License

MIT — see LICENSE.


All versions of php-kannel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.1 || ^2.0
psr/event-dispatcher Version ^1.0
psr/log Version ^2.0 || ^3.0
guzzlehttp/guzzle Version ^7.8
guzzlehttp/psr7 Version ^2.6
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 moonlydays/php-kannel contains the following files

Loading the files please wait ...