Created
December 7, 2018 06:49
-
-
Save vibbow/d4e0341d3775ae937c0e0a10ee3cccf1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$fileUrl = 'http://repo.packagist.org/packages.json'; | |
$options = array ( | |
'http' => | |
array ( | |
'follow_location' => 0, | |
'max_redirects' => 20, | |
'proxy' => 'tcp://127.0.0.1:8888', | |
'request_fulluri' => true, | |
'protocol_version' => 1.1, | |
'header' => | |
array ( | |
0 => 'Accept-Encoding: gzip', | |
1 => 'Connection: close', | |
2 => 'User-Agent: Composer/source (Windows NT; 10.0; PHP 7.2.12)', | |
), | |
'ignore_errors' => true, | |
) | |
); | |
$context = stream_context_create($options); | |
$result = file_get_contents($fileUrl, false, $context); | |
echo zlib_decode($result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment