Download the PHP package divineomega/cachetphp without Composer

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

cachet.php

cachet.php is a PHP client library for the Cachet status page (https://cachethq.io/).

This library could be useful for displaying details from your Cachet status page in other systems, such as a monitoring dashboard, a client ticketing system or any other web applications.

If you want to grab cachet.php with Composer, take a look on Packagist: https://packagist.org/packages/divineomega/cachetphp

Quick Start

Before starting, install the cachet.php library via Composer.

Create CachetInstance object

Now, you need to create a CachetInstance object that represents your installation of Cachet. You can do this like so:

Retrieving Cachet elements

Retrieving data from the various elements of your Cachet instance is easy. Just call the appropriate getter method on your object. The Cachet install will be contacted and an array of request appropriate objects be returned.

To retrieve a single Cachet element by its ID, you can use code similar to the following method.

Sorting Cachet elements

If you wish to sort your results, you can use the following syntax. This works for components, incidents, metrics, metric points and subscribers.

Reading from Cachet element objects

Reading data from retrieved Cachet element objects is easy. Just access their public member variables.

Here's an example of outputting the id, name, description and status of a Cachet component.

See the official Cachet documentation for information on the variables available for each type of Cachet element.

Creating Cachet elements

You can create a Cachet element, such as a component or incident very easily using the cachet.php library. This involves creating an associative array of the details for the Cachet elements and then passing this to the relevant creation method.

The following example shows you how to make a simple test component.

The more comprehensive example below shows how to create an incident and add an incident update to it. Please note that Cachet 2.4.0 or above required if you wish to use incident updates.

Updating Cachet elements

The cachet.php allows you to make changes to a Cachet element and saving those changes back to your Cachet install. This is done by directly changing the Cachet element's public member variables, and then calling the object's save() method.

The following example shows how to change the name and status of a component, then save the changes.

Updating Component Status via Incident and Incident Updates

If you create an incident with a component_id, you can also include a component_status to change the component's status at the same time as creating the incident. See the example below.

When creating incident updates, you can also specify a component_status to change the component's status when the incident update is created. See the example below.

You can also change a component status via an incident or incident update by changing the component_status on the related object and saving, as shown below in the exmaples below. Note that this will only work if the incident was created with an assoicated component_id.

Deleting Cachet elements

To delete a Cachet element from your Cachet install, you simply need to call the delete() method on the appropriate Cachet element object.

For example, to delete an incident you could do the following.

Contact

If you've found a bug or a new feature, please report it as a GitHub issue.

For other queries, I'm available on Twitter (Jordan Hall).


All versions of cachetphp with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
guzzlehttp/guzzle Version ~6.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 divineomega/cachetphp contains the following files

Loading the files please wait ....