PHP code example of mcmatters / gitlab-api

1. Go to this page and download the library: Download mcmatters/gitlab-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mcmatters / gitlab-api example snippets




declare(strict_types = 1);

i\GitlabClient('URL', 'TOKEN');

// You can use one of the fifth resource contexts:
// 1. Groups
// 2. Projects
// 3. Standalone
// 4. Users
// 5. Templates
// Each of them you can find on https://gitlab.com/help/api/api_resources.md
$epics = $client->group()->epic()->list(1);
$mergeRequests = $client->project()->mergeRequest()->list(1);
$queueMetrics = $client->standalone()->sidekiqMetric()->queueMetrics();
$starredProjects = $client->user()->project()->listStarred(1);
$dockerTemplates = $client->template()->dockerfile()->list();