statuspage/statuspage-sdk-php

Statuspage.io helps you to create a status page of your app or website.

Installs: 388

Dependents: 0

Stars: 2

Watchers: 11

Forks: 2

Language: PHP

v0.1 2014-01-28 09:47 UTC

README

Latest Stable Version Build Status Scrutinizer Quality Score Code Coverage

A PHP SDK for StatusPage.io

Requirements

  • PHP 5.3.3+
  • PHP cURL extension with SSL enabled (it's usually built-in).

Instalation

The recommended way to install StatusPage SDK for PHP is through Composer.

$ cd /path/to/your/project
$ composer require statuspage/statuspage-sdk-php:~0.1

Usage

Subscriptions endpoint

<php

use Guzzle\Http\Client as GuzzleClient;
use StatusPage\SDK\Client;
use StatusPage\SDK\Subscribers\Subscriber;

$client = new Client(new GuzzleClient, 'YOUR_PAGE_ID', 'YOUR_SECRET_KEY');

$subscriber = new Subscriber;
$subscriber->setEmail('example@example.com');

$client->subscribers()->addSubscriber($subscriber);

Metrics endpoint

<php

use Guzzle\Http\Client as GuzzleClient;
use StatusPage\SDK\Client;

$client = new Client(new GuzzleClient, 'YOUR_PAGE_ID', 'YOUR_SECRET_KEY');
$client->metrics()->submitData('YOUR_METRIC_ID', time(), mt_rand(1, 100));

Additional resources