Skip to content

Latest commit

 

History

History
59 lines (38 loc) · 1.91 KB

README.md

File metadata and controls

59 lines (38 loc) · 1.91 KB

StatusPage.io PHP SDK

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

<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('[email protected]');

$client->subscribers()->addSubscriber($subscriber);
<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