定制 codenamephp/deploymentchecks.http 二次开发

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

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

codenamephp/deploymentchecks.http

最新稳定版本:1.0.0

Composer 安装命令:

composer require codenamephp/deploymentchecks.http

包简介

README 文档

README

Packagist Version Packagist PHP Version Support Lines of code GitHub code size in bytes CI Packagist Downloads GitHub

This package provides simple checks for http services. It can check if a service is reachable and if it returns a specific status code, response body, ...

Installation

Easiest way is via composer. Just run composer require codenamephp/deploymentchecks.http in your cli which should install the latest version for you.

You should also explicitly install the codenamephp/deploymentchecks.base package since you will end up using it directly in almost all cases.

Usage

Just create checks, pass them to a collection and run them:

use de\codenamephp\deploymentchecks\base\Check\Collection\SequentialCheckCollection;
use de\codenamephp\deploymentchecks\base\Check\Result\Collection\ResultCollection;
use de\codenamephp\deploymentchecks\http\HttpCheckResult;
use de\codenamephp\deploymentchecks\http\RunTestsOnHttpResponse;
use de\codenamephp\deploymentchecks\http\Test\CssSelectorExists;
use de\codenamephp\deploymentchecks\http\Test\Result\HttpTestResult;
use de\codenamephp\deploymentchecks\http\Test\StatusCode;
use GuzzleHttp\Psr7\Request;

$check = new SequentialCheckCollection(new RunTestsOnHttpResponse(
  new Request('GET', 'https://localhost/test.html'),
  'Exists',
  new StatusCode(200),
),
  new RunTestsOnHttpResponse(
    new Request('GET','https://localhost/404.html'),
    'Does not exist',
    new StatusCode(404),
  ),
);

$result = $check->run();

exit($result instanceof WithExitCodeInterface ? $result->exitCode() : ($result->successful() ? DefaultExitCodes::SUCCESSFUL->value : DefaultExitCodes::ERROR->value));

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2023-05-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固