A PHP SDK for StatusPage.io
- PHP 5.3.3+
- PHP cURL extension with SSL enabled (it's usually built-in).
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
<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));