zeichen32/gitlabapibundle
最新稳定版本:v7.1.0
Composer 安装命令:
composer require zeichen32/gitlabapibundle
包简介
Symfony Bundle to include the gitlab api.
README 文档
README
This Bundle integrates the GitLab PHP API Client into your Symfony Project.
Step 1: Install Zeichen32GitLabApiBundle
The preferred way to install this bundle is to rely on Composer.
{ "require": { // ... "guzzlehttp/guzzle:^7.9.2", // Optional PSR Client, if you dont want to use the symfony http client "zeichen32/gitlabapibundle": "~7.0" } }
Step 2: Enable the bundle
Finally, enable the bundle in the kernel:
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Zeichen32\GitLabApiBundle\Zeichen32GitLabApiBundle(), ); }
Step 3: Configure Zeichen32GitLabApiBundle
Add Zeichen32GitLabApiBundle settings in app/config/config.yml:
zeichen32_git_lab_api: clients: firstclient: token: your-api-token url: http://example.org/api/v3/ auth_method: http_token secondclient: token: your-api-token url: http://example.org/api/v3/ auth_method: oauth_token sudo: 1 thirdclient: token: your-api-token url: http://example.org/api/v3/ alias: custom_alias
The first client automatically defined as your default client.
Step 4: Use the gitlab api
If you want to use the default client you can use type hinting.
<?php namespace App\Controller; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Gitlab\Client; class DefaultController extends AbstractController { public function index(Client $client) { $issues = $client->api('issues')->all($project_id); } }
If you want to get one of the other clients, you can get the specific client by the "zeichen32_gitlabapi.client.CLIENT_NAME" service id.
services: App\Controller\DefaultController: arguments: {$client: '@zeichen32_gitlabapi.client.default'}
<?php namespace App\Controller; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Gitlab\Client; class DefaultController extends AbstractController { private $client; public __construct(Client $client) { $this->client = $client; } public function index() { $issues = $this->client->api('issues')->all($project_id); } }
Or if you set alias option:
services: App\Controller\DefaultController: arguments: {$client: '@custom_alias'}
For more information about using the api, take a look at the GitLab Client Documentation.
Step 5: Configuration Reference
All available configuration options with their default values listed below:
zeichen32_git_lab_api: clients: # Required token: ~ # Required url: ~ # Required auth_method: ~ http_token|oauth_token sudo: ~ alias: ~ http_client: ~ # http client service id
License
This bundle is under the MIT license. See the complete license in the bundle:
Resources/meta/LICENSE
zeichen32/gitlabapibundle 适用场景与选型建议
zeichen32/gitlabapibundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 404.28k 次下载、GitHub Stars 达 56, 最近一次更新时间为 2026 年 01 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「gitlab」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 zeichen32/gitlabapibundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 zeichen32/gitlabapibundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 zeichen32/gitlabapibundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP GitLab generic API client (not stick to any version)
A collection of monolog handlers using PSR-18 http client
A PSR-7 compatible library for making CRUD API endpoints
Creates & updates issues on a GitLab repository from Symfony2 exceptions
Library to handle Webhooks from various services.
A PSR-15 middleware to manage Gitlab hooks.
统计信息
- 总下载量: 404.28k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 56
- 点击次数: 44
- 依赖项目数: 2
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-04