neilime/php-gitlab-ci-sdk

dev-master 2015-11-23 11:15 UTC

This package is auto-updated.

Last update: 2024-03-24 02:54:16 UTC


README

Latest Stable Version Total Downloads

NOTE : If you want to contribute don't hesitate, I'll review any PR.

Introduction

Gitlab CI SDK is a PHP Wrapper for use with the Gitlab CI API.

Based on php-gitlab-api.

Requirements

Installation

Main Setup

By cloning project

  1. Install the Buzz (>=0.7) by cloning them into ./vendor/.
  2. Clone this project into your ./vendor/ directory.

With composer

  1. Add this project in your composer.json:

    "require": {
        "neilime/php-gitlab-ci-sdk": "1.0.0"
    }
  2. Now tell composer to download AssetsBundle by running the command:

    $ php composer.phar update

General API Usage

$oClient = new \GitlabCI\Client('http://ci.example.com/api/v1/'); // change here
$oClient->authenticate('your_gitlab_ci_token_here','http://demo.gitlab.com', \GitlabCI\Client::AUTH_URL_TOKEN); // change here

$oProject = $oClient->api('projects')->create('My Project', array(
  'gitlab_id' => 2,
));

Model Usage

You can also use the library in an object oriented manner.

$oClient = new \GitlabCI\Client('http://ci.example.com/api/v1/'); // change here
$oClient->authenticate('your_gitlab_ci_token_here','http://demo.gitlab.com', \GitlabCI\Client::AUTH_URL_TOKEN); // change here

Creating a new project

$oProject = \GitlabCI\Model\Project::create($oClient, 'My Project', array(
  'gitlab_id' => 2,
));