neilime / php-gitlab-ci-sdk
This package is abandoned and no longer maintained.
No replacement package was suggested.
GitLab CI SDK
dev-master
2015-11-23 11:15 UTC
Requires
- php: >=5.3.2
- ext-curl: *
- kriswallsmith/buzz: >=0.7
This package is auto-updated.
Last update: 2024-04-24 03:03:42 UTC
README
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
- Buzz (>=0.7).
Installation
Main Setup
By cloning project
- Install the Buzz (>=0.7) by cloning them into
./vendor/
. - Clone this project into your
./vendor/
directory.
With composer
-
Add this project in your composer.json:
"require": { "neilime/php-gitlab-ci-sdk": "1.0.0" }
-
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, ));