定制 keven/ci-detect 二次开发

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

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

keven/ci-detect

最新稳定版本:1.0.1

Composer 安装命令:

composer require keven/ci-detect

包简介

Port of watson/ci-info NPM module for CI env discovery

README 文档

README

This library is freely adapted from watson/ci-info npm module.

It detects if PHP is running in a CI environment and which one.

Nearly 50 CI vendors are currently supported.

Installation

$ composer require keven/ci-detect

Usage

<?php

use Keven\CiDetect\Detector;
use Keven\CiDetect\CI;

$vendor = (new Detector)->detect();

$vendor->name; // ex.: Travis CI
$vendor->inPR; // (bool) Are we in a PR?

CI::is('Gitlab'); // (bool) Utility to quickly check a given vendor name

Update vendors

If the library lags behind watson/ci-info in terms of supported vendors, you can update the vendor list by running:

$ php bin/update.php

...which will trigger a synchronization from watson/ci-info repository:

  Download https://raw.githubusercontent.com/watson/ci-info/refs/heads/master/vendors.json
  Update data at data/vendors.php

Declare a vendor or an ENV matching rule

You can declare a new CI vendor manually, for testing purpose, by adding it to data/vendors.php.

Be aware that the file will be overwritten each time you run php bin/update.php.

Please contribute to watson/ci-info to declare vendors for the benefit of everybody.

If matching rules evolve in vendors.json, you can add new matching rules in this package by creating a new class implementing Rule interface.

统计信息

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

GitHub 信息

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

其他信息

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