Forum

GitLabPHP / Client ...
 
Notifications
Clear all

GitLabPHP / Client - example code for issues for project

2 Posty
1 Users
0 Reactions
508 Widok
0
Topic starter

example

2 Answers
0
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
Topic starter

and for commits

    public function commits()
    {
        $pager = new \Gitlab\ResultPager($this->client,100);
        return $pager->fetchAll($this->client->repositories(), 'commits', [$this->projectId]);
    }

Odpowiedź

Author Name

Author Email

Your question *

 
Preview 0 Revisions Saved
Share: