Download the PHP package docnet/matt-client without Composer

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

PHP Client for MATT notifications

This is a trivial PHP client (one class with a fluent interface) that helps you to monitor success or failure of stuff.

One thing that is often overlooked when writing crons and other regular processes is health monitoring. This usually takes the form of "Oh my god, such-and-such a script has not run successfully for 2 weeks, help!".

Absence of Success

One key thing here is that this system looks for the absence of a success message. So, if your cron starts hitting a Fatal error, this will tell you. Regular "log/email" stuff in a script will not even get hit.

Getting Started

When you need to know if some regular process stops working, do something like this at the end of your script (when you know the job is done to satisfaction)

If something should never happen, do this (perhaps in the main 'catch' block)

Install with Composer

Here's the require line for Composer users...

"docnet/matt-client": "dev-master"

No set-up required

You don't need to go and set up monitors in a web interface or anything. The first time you make a call (as above) the server will start watching.

You'll get a single set up message too, on first call for a unique event reference.

Named recipients

You can used named targets and groups that have been set up too, so in this example 'support' means several people

At the time of writing, named recipients must be set up by the author.

Event Names

The expect() singleton factory method takes an event name/identifier as a parameter. These are limited to 32 characters and will be truncated.

We trigger a E_USER_WARNING when we do this.

Intervals

The every() method take a string parameter to represent intervals. Supported interval strings are one of

OR, one of the following time representations, where N is a number

Changing Intervals

If you start off with

And then decide you want to change the interval, just change the value you are passing to every(), like this:

The system will update it's watch interval automatically for you, and send you another confirmation message.

Alert Frequency

MATT will send you alerts once every skipped interval.

So, a failed cron due to run once per hour will send you alerts once per hour until it runs successfully again.

Watch out - If you ask for an SMS every minute - you'll get one!

Monitors are HOST and DOCNET_APP_ID unique

By default, the MATT client will include your hostname as part of the request and, if defined, the DOCNET_APP_ID.

Monitors are unique to host+app_id pairs.

This means a monitor for "Google feed uploaded OK" can run and each client check will be independent of each other.

If you need to override the hostname, you can use the from() method as follows (but watch overlap with development).

Cancellation (stop monitoring)

If you need to stop the server monitoring a particular event, use cancel() like this

The system will notify current SMS and EMAIL recipients of the cancellation.

Silent watching/cancelling

If you need to suppress the "Now watching..." and "Stopped watching..." messages, use suppress_watch_message() like this

API calls over HTTPS with PHP Streams

As we don't know what sort of platforms we are going to be deployed on to, we don't use Curl in case it's not installed.

So, API calls are made over HTTPS using PHP native Streams and associated context options. If HTTPS using PHP native Streams fails and Curl is available, the API call will be attempted via Curl

API calls are made on __destruct() of each MATT instance. If the call fails, an E_USER_WARNING triggered.

If the response from the server includes a textual message, this is pushed out with an E_USER_NOTICE.

PHP Version Support

Desired compatibility with PHP 5.3.0 and above.

Coding Standards

Desired adherence to PSR-2.


All versions of matt-client with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
ext-json 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 docnet/matt-client contains the following files

Loading the files please wait ....