承接 jesugmz/http-health-check 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

jesugmz/http-health-check

Composer 安装命令:

composer require jesugmz/http-health-check

包简介

Simple HTTP health check written in PHP

README 文档

README

Minimum PHP Version CircleCI

HTTP Health Check is a simple HTTP health check written in PHP built on top of Guzzle.

  • Easy way to check HTTP services status by status code and body content from your PHP application
  • Grant finite HTTP request timeout (Guzzle does not)
  • Positive behavior by default. If no conditions are provided, the health will be consider healthy as soon as the request can be made successfully - no connectivity issues

Installation

Install the latest version through Composer:

$ composer require jesugmz/http-health-check

Usage

HTTP Health Check will do a GET request to the given endpoint URL and can check the following conditions in the response:

  • HTTP status code: expressed as status_code_equals_to
  • Body content: plain text that appears in the body response and is expressed as body_contains
use HttpHealthCheck\HttpHealthCheck;

$endpointUrl = 'https://github.com/jesuGMZ/';
$conditions = [
    'status_code_equals_to' => 200,
    'body_contains'         => 'jesuGMZ',
];

$check = new HttpHealthCheck($endpointUrl, $conditions);

var_dump($check->isHealthy());

It allows also Guzzle Request Options parameters:

use HttpHealthCheck\HttpHealthCheck;

$endpointUrl = 'https://mdn.github.io/learning-area/javascript/oojs/json/superheroes.json';
$conditions = [
    'status_code_equals_to' => 200,
    'body_contains'         => 'Super hero squad',
];
$options = [
    'headers' => [
        'User-Agent' => 'My custom user agent',
        'Accept'     => 'application/json',
    ]
];

$check = new HttpHealthCheck($endpointUrl, $conditions, $options);

var_dump($check->isHealthy());

统计信息

  • 总下载量: 20
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-07-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固