2017 © Pedro PelĂĄez
 

library cachet

Cachet client

image

mangati/cachet

Cachet client

  • Monday, January 8, 2018
  • by rogeriolino
  • Repository
  • 3 Watchers
  • 10 Stars
  • 55 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 3 Versions
  • 45 % Grown

The README.md

Cachet

Cachet PHP client., (*1)

About Cachet

Cachet is an open source status page system written in PHP. https://github.com/CachetHQ/Cachet., (*2)

Usage

Setup, (*3)

use Mangati\Cachet\Client;

$endpoint = 'https://demo.cachethq.io/api/v1/';
$token    = '9yMHsdioQosnyVK4iCVR';

$client = new Client($endpoint, $token);

Components

Get components, (*4)

$components = $client->getComponents();

foreach ($components as $component) {
    echo $component->getName();
}

Sorting, (*5)

$components = $client->getComponents([
    'sort' => 'id',
    'order' => 'desc'
]);

Get by id, (*6)

$component = $client->getComponent(3);

Create new component, (*7)

$component = new Component();
$component->setName('My new component');
$component->setDescription('Component description');
$component->setLink('https://github.com/mangati/cachet');
$component->setStatus(Component::STATUS_OPERATIONAL);

$client->addComponent($component);

Update an existing component, (*8)

$component = new Component();
$component->setId(3);
$component->setName('My new component (updated)');

$client->updateComponent($component);

Delete an existing component, (*9)

$id = 3;

$client->deleteComponent($id);

Incidents

Get incidents, (*10)

$incidents = $client->getIncidents();

foreach ($incidents as $incident) {
    echo $incident->getName();
}

Sorting, (*11)

$incidents = $client->getIncidents([
    'sort' => 'id',
    'order' => 'desc'
]);

Get by id, (*12)

$incident = $client->getIncident(3);

Create new incident, (*13)

$incident = new Incident();
$incident->setName('My new incident');
$incident->setMessage('incident message');
$incident->setStatus(Incident::STATUS_WATCHING);

$client->addIncident($incident);

Update an existing incident, (*14)

$incident = new Incident();
$incident->setId(3);
$incident->setStatus(Incident::STATUS_FIXED);

$client->updateIncident($incident);

Delete an existing incident, (*15)

$id = 3;

$client->deleteIncident($id);

Known issue

Doctrine annotation error:, (*16)

PHP Fatal error:  Uncaught exception 'Doctrine\Common\Annotations\AnnotationException' with message '[Semantical Error] The annotation "@JMS\Serializer\Annotation\Type" in property (...) does not exist, or could not be auto-loaded.'

Can fix it registering the JMS namespace:, (*17)

Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespace('JMS\Serializer\Annotation', $rootDir . "/vendor/jms/serializer/src");

The Versions

08/01 2018

dev-master

9999999-dev

Cachet client

  Sources   Download

MIT

The Requires

 

The Development Requires

client status cachet cachethq

08/01 2018

v1.0.1

1.0.1.0

Cachet client

  Sources   Download

MIT

The Requires

 

The Development Requires

client status cachet cachethq

15/02 2016

v1.0

1.0.0.0

Cachet client

  Sources   Download

MIT

The Requires

 

The Development Requires

client status cachet cachethq