PHPackages                             liuguofa/jenkins-api - 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. [API Development](/categories/api)
4. /
5. liuguofa/jenkins-api

ActiveLibrary[API Development](/categories/api)

liuguofa/jenkins-api
====================

Jenkins PHP API

1.0.1(2y ago)015MITPHP

Since Aug 9Pushed 2y agoCompare

[ Source](https://github.com/liuguofaa/jenkins-php-api)[ Packagist](https://packagist.org/packages/liuguofa/jenkins-api)[ Docs](https://github.com/liuguofaa/jenkins-php-api)[ RSS](/packages/liuguofa-jenkins-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

Jenkins PHP API
===============

[](#jenkins-php-api)

Jenkins PHP API is a set of classes designed to interact with Jenkins CI using its API.

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

[](#installation)

The recommended way to install Jenkins PHP API is through [Composer](http://getcomposer.org).

```
curl -sS https://getcomposer.org/installer | php
```

Then, run the Composer command to install the latest version:

```
composer.phar require jenkins-khan/jenkins-api
```

Basic Usage
-----------

[](#basic-usage)

Before anything, you need to instantiate the client :

```
    $jenkins = new \JenkinsKhan\Jenkins('http://host.org:8080');
```

If your Jenkins needs authentication, you need to pass a URL like this : `'http://user:token@host.org:8080'`.

Here are some examples of how to use it:

Get the color of the job
------------------------

[](#get-the-color-of-the-job)

```
    $job = $jenkins->getJob("dev2-pull");
    var_dump($job->getColor());
    //string(4) "blue"
```

Launch a Job And With Until Finished
------------------------------------

[](#launch-a-job-and-with-until-finished)

```
    $job = $jenkins->launchJobAndWaitUntilFinished("clone-deploy");
    var_dump($job);
    // Jenkins\Build if successful or throws a RuntimeException
```

Launch a Job
------------

[](#launch-a-job)

```
    $job = $jenkins->launchJob("clone-deploy");
    var_dump($job);
    // bool(true) if successful or throws a RuntimeException
```

List the jobs of a given view
-----------------------------

[](#list-the-jobs-of-a-given-view)

```
    $view = $jenkins->getView('madb_deploy');
    foreach ($view->getJobs() as $job) {
      var_dump($job->getName());
    }
    //string(13) "altlinux-pull"
    //string(8) "dev-pull"
    //string(9) "dev2-pull"
    //string(11) "fedora-pull"
```

List builds and their status
----------------------------

[](#list-builds-and-their-status)

```
    $job = $jenkins->getJob('dev2-pull');
    foreach ($job->getBuilds() as $build) {
      var_dump($build->getNumber());
      var_dump($build->getResult());
    }
    //int(122)
    //string(7) "SUCCESS"
    //int(121)
    //string(7) "FAILURE"
```

Check if Jenkins is available
-----------------------------

[](#check-if-jenkins-is-available)

```
    var_dump($jenkins->isAvailable());
    //bool(true);
```

For more information, see the [Jenkins API](https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API).

Coding standards
----------------

[](#coding-standards)

This projects follows PSR-0, PSR-1, PSR-2, PSR-4

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~325 days

Total

2

Last Release

1044d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/498d98f9689abf2a61b8f2ec7096c4585fce7e98524a615464146f38c6d00043?d=identicon)[liuguofaa](/maintainers/liuguofaa)

---

Top Contributors

[![srogier](https://avatars.githubusercontent.com/u/814069?v=4)](https://github.com/srogier "srogier (39 commits)")[![agallou](https://avatars.githubusercontent.com/u/320372?v=4)](https://github.com/agallou "agallou (20 commits)")[![nickdaugherty](https://avatars.githubusercontent.com/u/1103700?v=4)](https://github.com/nickdaugherty "nickdaugherty (10 commits)")[![xeBuz](https://avatars.githubusercontent.com/u/662916?v=4)](https://github.com/xeBuz "xeBuz (3 commits)")[![KuiKui](https://avatars.githubusercontent.com/u/748924?v=4)](https://github.com/KuiKui "KuiKui (1 commits)")[![ianfixes](https://avatars.githubusercontent.com/u/583459?v=4)](https://github.com/ianfixes "ianfixes (1 commits)")[![s-larionov](https://avatars.githubusercontent.com/u/529261?v=4)](https://github.com/s-larionov "s-larionov (1 commits)")[![elliotwms](https://avatars.githubusercontent.com/u/4396779?v=4)](https://github.com/elliotwms "elliotwms (1 commits)")[![timcrider](https://avatars.githubusercontent.com/u/874528?v=4)](https://github.com/timcrider "timcrider (1 commits)")

---

Tags

apijenkins

### Embed Badge

![Health badge](/badges/liuguofa-jenkins-api/health.svg)

```
[![Health](https://phpackages.com/badges/liuguofa-jenkins-api/health.svg)](https://phpackages.com/packages/liuguofa-jenkins-api)
```

###  Alternatives

[m165437/laravel-blueprint-docs

API Blueprint Renderer for Laravel

22779.0k](/packages/m165437-laravel-blueprint-docs)[carlosio/jenkins

Jenkins API

2520.3k](/packages/carlosio-jenkins)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
