Notifications
Clear all
BugOverflow
1
Posty
1
Users
0
Reactions
624
Widok
0
23/06/2022 12:09 am
Topic starter
php curl example
1 Answer
0
23/06/2022 12:10 am
Topic starter
We have to use workaround, iterating through contributors.
function commitStatistics() { $ch = curl_init(); $url = $this->projectUrl . '/api/v4/projects/24/repository/contributors'; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HTTPHEADER, array('PRIVATE-TOKEN:' . $this->secretToken)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); curl_close($ch); $total_counter = 0; foreach (json_decode($result) as $contributor) { $total_counter += $contributor->commits; } return $total_counter; }