2 # SPDX-FileCopyrightText: © Fossology contributors
4 # SPDX-License-Identifier: GPL-2.0-only
41 $url =
'https://api.github.com/repos/fossology/fossology/'.$apiRequest;
43 $request = $this->curlRequestService->create($url);
45 CURLOPT_HEADER =>
true,
46 CURLOPT_RETURNTRANSFER =>
true,
47 CURLOPT_HTTPHEADER => array(
'User-Agent: fossology'),
50 $request->setOptions($curlopt);
51 $response = $request->execute();
52 if ($response !==
false) {
53 $headerSize = $request->getInfo(CURLINFO_HEADER_SIZE);
54 $resultBody = json_decode(substr($response, $headerSize),
true);
56 $resultBody = array();
69 return $this->
curlGet(
'releases/latest');
79 $since =
'?since=' . date(
'Y-m-d\\TH:i:s\\Z', time() - 3600 * 24 * $days);
80 return $this->
curlGet(
'commits' . $since);
Helper class to get the latest release and commits from GitHub API.
getCommitsOfLastDays($days=30)
Get the commits from past n days.
__construct($curlRequestService)
curlGet($apiRequest)
Send a curl request to apiRequest for resource.
getLatestRelease()
Get the latest release info from GitHub.
Utility functions for specific applications.