2017 © Pedro Peláez
 

library php-gitlab-api

GitLab API client

image

radutopala/php-gitlab-api

GitLab API client

  • Monday, February 8, 2016
  • by radutopala
  • Repository
  • 1 Watchers
  • 0 Stars
  • 23 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 234 Forks
  • 0 Open issues
  • 18 Versions
  • 0 % Grown

The README.md

A PHP wrapper for use with the Gitlab API.

Build Status, (*1)

Based on php-github-api and code from KnpLabs., (*2)

Installation

Install Composer, (*3)

$ curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer

Add the following to your require block in composer.json config. Note: be careful when using the dev-master tag as this may have unexpected results depending on your version of Gitlab. See the Versioning section below for more information., (*4)

"m4tthumphrey/php-gitlab-api": "dev-master"

Include Composer's autoloader:, (*5)

require_once dirname(__DIR__).'/vendor/autoload.php';

Versioning

From the 6.0 stable release of Gitlab, I shall now be matching the client version with the Gitlab version. For example when Gitlab 6.1 is released I will release version 6.1.0 of the API client. If I need to make future updates to the client before the next API version is released. I will simply use a 3th build version. For example 6.1.1, 6.1.2 etc. It is recommended that you keep your composer file up to date depending on what version of Gitlab you are currently running. So if you are using 6.0, you should required 6.0.*; 6.1 should be 6.1.* etc etc., (*6)

General API Usage

$client = new \Gitlab\Client('http://git.yourdomain.com/api/v3/'); // change here
$client->authenticate('your_gitlab_token_here', \Gitlab\Client::AUTH_URL_TOKEN); // change here

$project = $client->api('projects')->create('My Project', array(
  'description' => 'This is a project',
  'issues_enabled' => false
));

Model Usage

You can also use the library in an object oriented manner., (*7)

$client = new \Gitlab\Client('http://git.yourdomain.com/api/v3/'); // change here
$client->authenticate('your_gitlab_token_here', \Gitlab\Client::AUTH_URL_TOKEN); // change here

Creating a new project, (*8)

$project = \Gitlab\Model\Project::create($client, 'My Project', array(
  'description' => 'This is my project',
  'issues_enabled' => false
));

$project->addHook('http://mydomain.com/hook/push/1');

Creating a new issue, (*9)

$project = new \Gitlab\Model\Project(1, $client);
$issue = $project->createIssue('This does not work..', array(
  'description' => 'This doesnt work properly. Please fix',
  'assignee_id' => 2
));

Closing that issue, (*10)

$issue->close();

You get the idea! Take a look around and please feel free to report any bugs., (*11)

Framework Integrations

  • Symfony - https://github.com/Zeichen32/GitLabApiBundle
  • Laravel - https://github.com/vinkla/gitlab

If you have integrated GitLab into a popular PHP framework let us know!, (*12)

Contributing

There are many parts of Gitlab that I have not added to this as it was originally created for personal use, hence the lack of tests. Feel free to fork and add new functionality and tests, I'll gladly accept decent pull requests., (*13)

The Versions

08/02 2016

dev-master

9999999-dev https://github.com/radutopala/php-gitlab-api

GitLab API client

  Sources   Download

MIT

The Requires

 

The Development Requires

api gitlab

28/07 2015

7.13.0

7.13.0.0 https://github.com/m4tthumphrey/php-gitlab-api

GitLab API client

  Sources   Download

MIT

The Requires

 

The Development Requires

api gitlab

29/05 2015

7.11.0

7.11.0.0 https://github.com/m4tthumphrey/php-gitlab-api

GitLab API client

  Sources   Download

MIT

The Requires

 

The Development Requires

api gitlab

06/05 2015

7.10.0

7.10.0.0 https://github.com/m4tthumphrey/php-gitlab-api

GitLab API client

  Sources   Download

MIT

The Requires

 

The Development Requires

api gitlab

23/03 2015

7.9.0

7.9.0.0 https://github.com/m4tthumphrey/php-gitlab-api

GitLab API client

  Sources   Download

MIT

The Requires

 

The Development Requires

api gitlab

23/02 2015

7.8.0

7.8.0.0 https://github.com/m4tthumphrey/php-gitlab-api

GitLab API client

  Sources   Download

MIT

The Requires

 

The Development Requires

api gitlab

22/07 2014

6.9.1

6.9.1.0 https://github.com/m4tthumphrey/php-gitlab-api

GitLab API client

  Sources   Download

MIT

The Requires

 

api gitlab

19/06 2014

6.9.0

6.9.0.0 https://github.com/m4tthumphrey/php-gitlab-api

GitLab API client

  Sources   Download

MIT

The Requires

 

api gitlab

10/01 2014

6.4.3

6.4.3.0 https://github.com/m4tthumphrey/php-gitlab-api

GitLab API client

  Sources   Download

MIT

The Requires

 

api gitlab

18/11 2013

6.2.2

6.2.2.0 https://github.com/m4tthumphrey/php-gitlab-api

GitLab API client

  Sources   Download

MIT

The Requires

 

api gitlab

28/10 2013

6.2.1

6.2.1.0 https://github.com/m4tthumphrey/php-gitlab-api

GitLab API client

  Sources   Download

MIT

The Requires

 

api gitlab

28/10 2013

6.2.0

6.2.0.0 https://github.com/m4tthumphrey/php-gitlab-api

GitLab API client

  Sources   Download

MIT

The Requires

 

api gitlab

24/09 2013

6.1.0

6.1.0.0 https://github.com/m4tthumphrey/php-gitlab-api

GitLab API client

  Sources   Download

MIT

The Requires

 

api gitlab

28/08 2013

6.0.0

6.0.0.0 https://github.com/m4tthumphrey/php-gitlab-api

GitLab API client

  Sources   Download

MIT

The Requires

 

api gitlab

14/08 2013

0.7.1

0.7.1.0 https://github.com/m4tthumphrey/php-gitlab-api

GitLab API client

  Sources   Download

MIT

The Requires

 

api gitlab

27/06 2013

0.7.0

0.7.0.0 https://github.com/m4tthumphrey/php-gitlab-api

GitLab API client

  Sources   Download

MIT

The Requires

 

api gitlab

26/06 2013

0.6.1

0.6.1.0 https://github.com/m4tthumphrey/php-gitlab-api

GitLab API client

  Sources   Download

MIT

The Requires

 

api gitlab

18/06 2013

0.6.0

0.6.0.0 https://github.com/m4tthumphrey/php-gitlab-api

GitLab API client

  Sources   Download

MIT

The Requires

 

api gitlab