Notifications
Clear all
BugOverflow
2
Posty
1
Users
0
Reactions
508
Widok
0
30/04/2022 8:13 pm
Topic starter
example
2 Answers
0
30/04/2022 9:19 pm
Topic starter
private $projectUrl = "MY_SELFHOSTED_GITLAB"; private $secretToken = "MY_TOKEN"; private $client = null; private $projectId = 1; public function __construct() { $this->client = new \Gitlab\Client(); $this->client->setUrl($this->projectUrl); $this->client->authenticate($this->secretToken, \Gitlab\Client::AUTH_HTTP_TOKEN); } public function issues() { $parameters = [ "scope" => "all", "per_page" => 100, "page" => 1, ]; return $this->client->issues()->all($this->projectId, $parameters); }
0
30/04/2022 9:25 pm
Topic starter
and for commits
public function commits() { $pager = new \Gitlab\ResultPager($this->client,100); return $pager->fetchAll($this->client->repositories(), 'commits', [$this->projectId]); }