All Projects → GitLabPHP → Client

GitLabPHP / Client

Licence: mit
GitLab API v4 client for PHP

Projects that are alternatives of or similar to Client

Pymisp
Python library using the MISP Rest API
Stars: ✭ 254 (-66.71%)
Mutual labels:  api, api-client
Gitbeaker
🤖 GitLab API NodeJS library with full support of all the Gitlab API services.
Stars: ✭ 755 (-1.05%)
Mutual labels:  api, gitlab
Php Curl Class
PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs
Stars: ✭ 2,903 (+280.47%)
Mutual labels:  api, api-client
Coinapi Sdk
SDKs for CoinAPI
Stars: ✭ 238 (-68.81%)
Mutual labels:  api, api-client
Unifi Api Client
A PHP API client class to interact with Ubiquiti's UniFi Controller API
Stars: ✭ 602 (-21.1%)
Mutual labels:  api, api-client
Protoman
Postman for protobuf APIs
Stars: ✭ 241 (-68.41%)
Mutual labels:  api, api-client
Insomnia
The open-source, cross-platform API client for GraphQL, REST, and gRPC.
Stars: ✭ 18,969 (+2386.11%)
Mutual labels:  api, api-client
Twitch4j
Modular Async/Sync/Reactive Twitch API Client / IRC Client
Stars: ✭ 209 (-72.61%)
Mutual labels:  api, api-client
Datafire
A framework for building integrations and APIs
Stars: ✭ 487 (-36.17%)
Mutual labels:  api, api-client
Node Vault
Client for HashiCorp's Vault
Stars: ✭ 391 (-48.75%)
Mutual labels:  api, api-client
Twitch
Interact with Twitch's API, chat, PubSub and subscribe to WebHooks.
Stars: ✭ 237 (-68.94%)
Mutual labels:  api, api-client
Pyowm
A Python wrapper around the OpenWeatherMap web API
Stars: ✭ 654 (-14.29%)
Mutual labels:  api, api-client
Php Bitcoinrpc
Fully unit-tested Bitcoin JSON-RPC client based on GuzzleHttp.
Stars: ✭ 231 (-69.72%)
Mutual labels:  api, api-client
Httpie
As easy as /aitch-tee-tee-pie/ 🥧 Modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more. https://twitter.com/httpie
Stars: ✭ 53,052 (+6853.08%)
Mutual labels:  api, api-client
Alpaca
Given a web API, Generate client libraries in node, php, python, ruby
Stars: ✭ 2,447 (+220.71%)
Mutual labels:  api, api-client
Hubspot Php
HubSpot PHP API Client
Stars: ✭ 273 (-64.22%)
Mutual labels:  api, api-client
Binance
A .NET Standard Binance API library.
Stars: ✭ 199 (-73.92%)
Mutual labels:  api, api-client
Api Development Tools
📚 A collection of useful resources for building RESTful HTTP+JSON APIs.
Stars: ✭ 2,519 (+230.14%)
Mutual labels:  api, api-client
Diplomat
A HTTP Ruby API for Consul
Stars: ✭ 358 (-53.08%)
Mutual labels:  api, api-client
Client
DigitalOcean API v2 client for PHP
Stars: ✭ 604 (-20.84%)
Mutual labels:  api, api-client

GitLab PHP API Client

We present a modern GitLab API v4 client for PHP.

Banner

Build Status StyleCI Status Software License Packagist Downloads Latest Version

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

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

Installation

This version supports PHP 7.2-8.0. 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.

Standard Installation

$ composer require "m4tthumphrey/php-gitlab-api:^11.3" "guzzlehttp/guzzle:^7.2" "http-interop/http-factory-guzzle:^1.0"

Framework Integration

Laravel:

$ composer require "graham-campbell/gitlab:^5.2" "guzzlehttp/guzzle:^7.2" "http-interop/http-factory-guzzle:^1.0"

Symfony:

$ composer require "zeichen32/gitlabapibundle:^6.0" "symfony/http-client:^5.2" "nyholm/psr7:^1.3"

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.

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:

$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.

Contributing

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

$ make install
$ make test

Security

If you discover a security vulnerability within this package, please send an email to Graham Campbell at [email protected]. All security vulnerabilities will be promptly addressed. You may view our full security policy here.

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].