1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

[ticket/11603] Avoid using cURL

PHPBB3-11603
This commit is contained in:
Joas Schilling
2013-06-19 13:38:03 +02:00
parent a7af0134c0
commit 1516ae7e7e
2 changed files with 19 additions and 19 deletions

View File

@@ -124,13 +124,16 @@ function get_repository_url($username, $repository, $ssh = false)
function api_request($query)
{
$c = curl_init();
curl_setopt($c, CURLOPT_URL, "https://api.github.com/$query");
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
curl_setopt($c, CURLOPT_USERAGENT, 'phpBB/1.0');
curl_setopt($c, CURLOPT_HEADER, true);
$contents = curl_exec($c);
curl_close($c);
return api_url_request("https://api.github.com/$query?per_page=100");
}
function api_url_request($url)
{
$contents = file_get_contents($url, false, stream_context_create(array(
'http' => array(
'header' => "User-Agent: phpBB/1.0\r\n",
),
)));
if ($contents === false)
{