statuspage/statuspage-sdk-php

This package is abandoned and no longer maintained. No replacement package was suggested.

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

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

This package is not auto-updated.

Last update: 2022-02-01 12:30:39 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