hcelebi / gitlab-php-client
There is no license information available for the latest version (dev-master) of this package.
PHP Client For GitLab API
dev-master
2022-06-28 13:08 UTC
Requires
- guzzlehttp/guzzle: ~6.0
- monolog/monolog: ^1.24
- slim/slim: ^3.12
Requires (Dev)
- phpunit/phpunit: 7.5.*
This package is not auto-updated.
Last update: 2025-01-23 00:28:21 UTC
README
Installation
The prefered way to install this client
php composer.phar require hcelebi/gitlab-php-client
or
composer require hcelebi/gitlab-php-client
Configuration
Dependency injection is exist in project, add these factories to configuration.
GitLabClientFactory.php
BranchServiceFactory.php
Dependency injection doesn't exist in project, add this code block to application entry point
$container = new Container();
GitLabClientFactory::createService($container);
BranchServiceFactory::createService($container);
Usage
Get master branch from specific gitlab project
/** @var BranchService $branchService */
$branchService = $container->get(BranchService::class);
$projectId = 37129493;
$branch = $branchService->getBranch(37129493, "master");