PHPackages                             mcampbell508/ci-detector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. mcampbell508/ci-detector

AbandonedArchivedLibrary

mcampbell508/ci-detector
========================

Detect current continuous integration server and provide unified access to properties of current build

3.2.0(7y ago)01.7k1MITPHPPHP ^7.1

Since Jul 29Pushed 7y ago1 watchersCompare

[ Source](https://github.com/mcampbell508/ci-detector)[ Packagist](https://packagist.org/packages/mcampbell508/ci-detector)[ RSS](/packages/mcampbell508-ci-detector/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (3)Versions (12)Used By (1)

CI Detector
===========

[](#ci-detector)

[![Latest Stable Version](https://camo.githubusercontent.com/5b5c54917ee33c5418a5f4dc28e273c8b24e8129569db1caf6a0889835310911/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f6e6472616d2f63692d6465746563746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ondram/ci-detector)[![Travis Build Status](https://camo.githubusercontent.com/a843be14674e342664f7462a69dba27b6e5d8c91dbf5c8417f9032b4c06c23b7/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f4f6e6472614d2f63692d6465746563746f722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/OndraM/ci-detector)[![AppVeyor Build Status](https://camo.githubusercontent.com/cba119660ec26240604a8bba5c5c0081f9f05d5340be38adeed764529a0fb264/68747470733a2f2f696d672e736869656c64732e696f2f6170707665796f722f63692f4f6e6472614d2f63692d6465746563746f722e7376673f7374796c653d666c61742d737175617265)](https://ci.appveyor.com/project/OndraM/ci-detector)[![License](https://camo.githubusercontent.com/56f57712909edd680724742f4b2d9a8957be77f6948fe5d5869f9da49aedd463/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6f6e6472616d2f63692d6465746563746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ondram/ci-detector)

Simple PHP library to detect in what continuous integration server is current script being run and to provide unified interface for accessing the build properties.

The detection is based on environment variables injected to the build environment by each of continuous integration server. However, these variables are named differently in each CI. This library contains adapter for each supported CI server which handles these differences so you don't have to and you can make your scripts (and especially CLI tools) portable for multiple build environments.

Supported continuous integration servers
----------------------------------------

[](#supported-continuous-integration-servers)

These CI servers are currently recognized:

- [Jenkins](https://jenkins.io/)
- [Travis CI](https://travis-ci.org/)
- [AppVeyor](https://www.appveyor.com/)
- [Bamboo](https://www.atlassian.com/software/bamboo)
- [CircleCI](https://circleci.com/)
- [Codeship](https://codeship.com/)
- [continuousphp](https://continuousphp.com/)
- [drone](https://github.com/drone/drone/)
- [GitLab](https://about.gitlab.com/gitlab-ci/)
- [TeamCity](https://www.jetbrains.com/teamcity/)

If your favorite CI server is missing, feel free to send a pull-request!

Standalone CLI version
----------------------

[](#standalone-cli-version)

If you want to use CI Detector as a standalone CLI command (ie. without using inside code of PHP project), see [ci-detector-standalone](https://github.com/OndraM/ci-detector-standalone) repository, where you can download CI Detector as a standalone PHAR file with simple command line interface.

Installation
------------

[](#installation)

Install using [Composer](https://getcomposer.org/):

```
$ composer require ondram/ci-detector
```

Ci-detector requires PHP 7.1+, but you need compatibility with PHP &lt;7.1, you can still use old ci-detector version 2.x.

Example usage
-------------

[](#example-usage)

```
