A PHP wrapper for the updown.io API.
You need your API_KEY from your account's settings page to use this. Visit updown.io API documentation to see all settings you can use.
- PHP 5.4.0 or newer
The best way to install this package is through composer by running:
composer require fakiolinho/updown-php:~1.0
You could also add it in your project's composer.json
file:
"require": {
"fakiolinho/updown-php": "~1.0"
}
Then run:
composer update
All examples use the Composer autoloader.
<?php
require 'vendor/autoload.php';
use Foinikas\Updown\Updown;
$updown = new Updown(API_KEY);
$response = $updown->checks();
<?php
require 'vendor/autoload.php';
use Foinikas\Updown\Updown;
$updown = new Updown(API_KEY);
$response = $updown->check(TOKEN);
<?php
require 'vendor/autoload.php';
use Foinikas\Updown\Updown;
$updown = new Updown(API_KEY);
$response = $updown->downtimes(TOKEN);
$response = $updown->downtimes(TOKEN, ['page' => 2]);
<?php
require 'vendor/autoload.php';
use Foinikas\Updown\Updown;
$updown = new Updown(API_KEY);
$response = $updown->metrics(TOKEN);
$response = $updown->metrics(TOKEN, ['group' => 'host']);