PHPackages                             ooobii/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. [CLI &amp; Console](/categories/cli)
4. /
5. ooobii/jenkins-api

ActiveLibrary[CLI &amp; Console](/categories/cli)

ooobii/jenkins-api
==================

Jenkins Management for PHP

1.0.0(5y ago)1191MITPHP

Since Mar 16Pushed 5y ago1 watchersCompare

[ Source](https://github.com/ooobii/jenkins-php-api)[ Packagist](https://packagist.org/packages/ooobii/jenkins-api)[ Docs](https://github.com/ooobii/jenkins-php-api)[ RSS](/packages/ooobii-jenkins-api/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)DependenciesVersions (4)Used By (0)

Jenkins Management for PHP
==========================

[](#jenkins-management-for-php)

[![Build Status](https://camo.githubusercontent.com/2989d9541051bcee8babce16a66eca800827dab9361a0824a42608312e72d61b/68747470733a2f2f696d672e736869656c64732e696f2f6a656e6b696e732f6275696c643f6a6f6255726c3d68747470732533412532462532466a656e6b696e732e6d61747468657777656e64656c2e696e666f2532466a6f622532466a656e6b696e732d7068702d6170692532466a6f622532466d6173746572253246267374796c653d706c6173746963)](https://jenkins.matthewwendel.info/job/jenkins-php-api/job/master/) [![Build Status](https://camo.githubusercontent.com/893ac0eba4979b0190c32be7ccbb2a108a48be31bb11fd44110db024a399a4c8/68747470733a2f2f696d672e736869656c64732e696f2f6a656e6b696e732f74657374733f636f6d706163745f6d657373616765266661696c65645f6c6162656c3d6661696c75726573266a6f6255726c3d68747470732533412532462532466a656e6b696e732e6d61747468657777656e64656c2e696e666f2532466a6f622532466a656e6b696e732d7068702d6170692532466a6f622532466d6173746572253246266c6162656c3d706870756e6974267061737365645f6c6162656c3d7375636365737366756c26736b69707065645f6c6162656c3d756e746573746564267374796c653d706c6173746963)](https://jenkins.matthewwendel.info/job/jenkins-php-api/job/master/)

This composer library is designed to facilitate interactions with Jenkins CI using its API or CLI via SSH.

This library is distributed with the [MIT License](https://tldrlegal.com/license/mit-license) applied to all work within.

About this Fork
---------------

[](#about-this-fork)

**Note:** This is a fork of the original repository created by [Jenkins Khan](https://github.com/jenkins-khan), located [here](https://github.com/jenkins-khan/jenkins-php-api). A huge thanks to them for starting this project.

The primary focus of this fork is to facilitate additional functionality through the Jenkins CLI via. SSH. Since many publicly-accessible pieces of functionality are changing from the original, this fork is also published as it's own [Composer](http://getcomposer.org) package under my identity (ooobii).

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

[](#installation)

#### Package Installation

[](#package-installation)

To begin utilizing Jenkins Management for PHP, you can install it using [Composer](http://getcomposer.org):

```
# Once composer is installed, you can require it within your project.
# Using this 'require' variant will install the latest stable release build.
composer require ooobii/jenkins-api

# To use the latest development build, .
composer require ooobii/jenkins-api:dev-master
```

#### Composer Installation

[](#composer-installation)

If you do not have [Composer](http://getcomposer.org) installed, you can download the binary to your project's folder:

```
# Always exercise caution when executing installer scripts from remote sources!
curl -sS https://getcomposer.org/installer | php

# This isn't required, but it's easier to refer to it this way.
mv composer.phar composer
```

Alternatively, you can install it on your system globally, so the command `composer` will be accessible anywhere:

```
# Always exercise caution when executing installer scripts from remote sources!
wget "https://getcomposer.org/installer" -O composer-setup.php

# These 2 arguments will copy the binary to a folder in your $PATH, and remove the default extension.
php composer-setup.php --install-dir=/usr/local/bin --filename=composer
```

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

[](#basic-usage)

### Connecting to a Jenkins Instance

[](#connecting-to-a-jenkins-instance)

Before anything, you need to instantiate the client:

```
$jenkins = new \ooobii\Jenkins($host, $port = NULL, $useHttps = TRUE, $user = NULL, $token = NULL);
```

***OR:***

```
use \ooobii\Jenkins;
...
$jenkins = new Jenkins($host, $port = NULL, $useHttps = TRUE, $user = NULL, $token = NULL);
```

### Usage Examples

[](#usage-examples)

#### 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

[](#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).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Unknown

Total

1

Last Release

1879d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/78e6614db9a2361f7ebad25e6b61ca606108e31ccdc09050b6a3fa6a2be4214e?d=identicon)[ooobii](/maintainers/ooobii)

---

Top Contributors

[![srogier](https://avatars.githubusercontent.com/u/814069?v=4)](https://github.com/srogier "srogier (39 commits)")[![ooobii](https://avatars.githubusercontent.com/u/60083197?v=4)](https://github.com/ooobii "ooobii (22 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)")[![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)")[![s-larionov](https://avatars.githubusercontent.com/u/529261?v=4)](https://github.com/s-larionov "s-larionov (1 commits)")[![ianfixes](https://avatars.githubusercontent.com/u/583459?v=4)](https://github.com/ianfixes "ianfixes (1 commits)")

---

Tags

apiclijenkinsmanagement

### Embed Badge

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

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

###  Alternatives

[zenddevops/client

ZF2 CLI tool to access Zend Server Web API

225.1k](/packages/zenddevops-client)[renoki-co/php-helm

PHP Helm Processor is a process wrapper for Kubernetes' Helm v3 CLI. You can run programmatically Helm v3 commands, directly from PHP, with a simple syntax.

1310.5k](/packages/renoki-co-php-helm)

PHPackages © 2026

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