定制 ckdarby/php-uptimerobot 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ckdarby/php-uptimerobot

Composer 安装命令:

composer require ckdarby/php-uptimerobot

包简介

PHP Wrapper for UptimeRobot.com API

README 文档

README

This is a basic PHP wrapper for https://uptimerobot.com/api

Prerequisites

  • Configure the $config apiKey
  • Must be running PHP >= 5.4
  • Format will be JSON & there will be no JSONCallback

Composer

Add this to your composer.json

{
    "require": {
        "ckdarby/php-uptimerobot": "@stable"
    }
}

Example

<?php
//Requires composer install to work
require_once(__DIR__.'/vendor/autoload.php');

use UptimeRobot\API;

//Set configuration settings
$config = [
    'apiKey' => 'APIKEY',
    'url' => 'https://api.uptimerobot.com'
];

try {

    //Initalizes API with config options
    $api = new API($config);

    //Define parameters for our getMethod request
    $args = [
        'showTimezone' => 1
    ];

    //Makes request to the getMonitor Method
    $results = $api->request('/getMonitors', $args);

    //Output json_decoded contents
    var_dump($results);

} catch (Exception $e) {
    echo $e->getMessage();
    //Output various debug information
    var_dump($api->debug);
}

统计信息

  • 总下载量: 27.14k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 38
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 37
  • Watchers: 4
  • Forks: 13
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-10-20