2017 © Pedro Peláez
 

library php-gitlab-api

GitLab API client

image

m4tthumphrey/php-gitlab-api

GitLab API client

  • Saturday, July 28, 2018
  • by m4tthumphrey
  • Repository
  • 27 Watchers
  • 503 Stars
  • 325,922 Installations
  • PHP
  • 36 Dependents
  • 3 Suggesters
  • 234 Forks
  • 42 Open issues
  • 39 Versions
  • 18 % Grown

The README.md

GitLab PHP API Client

We present a modern GitLab API v4 client for PHP., (*1)

Banner, (*2)

Build Status StyleCI Status Software License Packagist Downloads Latest Version , (*3)

This is strongly based on php-github-api by KnpLabs. With this in mind, we now have very similar clients for:, (*4)

Check out the change log, releases, security policy, license, code of conduct, and contribution guidelines., (*5)

Installation

This version supports PHP 7.4-8.3. To get started, simply require the project using Composer. You will also need to install packages that "provide" psr/http-client-implementation and psr/http-factory-implementation., (*6)

Standard Installation

$ composer require "m4tthumphrey/php-gitlab-api:^11.14" \
  "guzzlehttp/guzzle:^7.8" "http-interop/http-factory-guzzle:^1.2"

Framework Integration

Laravel:

$ composer require "graham-campbell/gitlab:^7.5"

Symfony:

$ composer require "zeichen32/gitlabapibundle:^6.1"

We are decoupled from any HTTP messaging client by using PSR-7, PSR-17, PSR-18, and HTTPlug. You can visit HTTPlug for library users to get more information about installing HTTPlug related packages. The framework integration graham-campbell/gitlab is by Graham Campbell and zeichen32/gitlabapibundle is by Jens Averkamp., (*7)

General API Usage

// Token authentication
$client = new Gitlab\Client();
$client->authenticate('your_http_token', Gitlab\Client::AUTH_HTTP_TOKEN);

// OAuth2 authentication
$client = new Gitlab\Client();
$client->authenticate('your_oauth_token', Gitlab\Client::AUTH_OAUTH_TOKEN);

// An example API call
$project = $client->projects()->create('My Project', [
    'description' => 'This is a project',
    'issues_enabled' => false,
]);

Self-Hosted GitLab

$client = new Gitlab\Client();
$client->setUrl('https://git.yourdomain.com');
$client->authenticate('your_http_token', Gitlab\Client::AUTH_HTTP_TOKEN);

Example with Pager

$pager = new Gitlab\ResultPager($client);
$issues = $pager->fetchAll($client->issues(), 'all', [null, ['state' => 'closed']]);

HTTP Client Builder

By providing a Gitlab\HttpClient\Builder to the Gitlab\Client constructor, you can customize the HTTP client. For example, to customize the user agent:, (*8)

$plugin = new Http\Client\Common\Plugin\HeaderSetPlugin([
    'User-Agent' => 'Foobar',
]);

$builder = new Gitlab\HttpClient\Builder();
$builder->addPlugin($plugin);

$client = new Gitlab\Client($builder);

One can read more about HTTPlug plugins here. Take a look around the API methods, and please feel free to report any bugs, noting our code of conduct., (*9)

Contributing

We will gladly receive issue reports and review and accept pull requests, in accordance with our code of conduct and contribution guidelines!, (*10)

$ make install
$ make test

Security

If you discover a security vulnerability within this package, please send an email to Graham Campbell at hello@gjcampbell.co.uk. All security vulnerabilities will be promptly addressed. You may view our full security policy here., (*11)

License

GitLab PHP API Client is licensed under The MIT License (MIT)., (*12)

The Versions

10/06 2017

v4.x-dev

4.9999999.9999999.9999999-dev https://github.com/m4tthumphrey/php-gitlab-api

GitLab API client

  Sources   Download

MIT

The Requires

 

The Development Requires

api gitlab

06/06 2017

8.0.x-dev

8.0.9999999.9999999-dev https://github.com/m4tthumphrey/php-gitlab-api

GitLab API client

  Sources   Download

MIT

The Requires

 

The Development Requires

api gitlab

06/06 2017

8.0.0

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

GitLab API client

  Sources   Download

MIT

The Requires

 

The Development Requires

api gitlab

03/10 2016

7.15.0

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

GitLab API client

  Sources   Download

MIT

The Requires

 

The Development Requires

api gitlab

19/09 2016

7.14.0

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

GitLab API client

  Sources   Download

MIT

The Requires

 

The Development Requires

api gitlab

20/06 2016

7.13.1

7.13.1.0 https://github.com/m4tthumphrey/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