Skip to content

Instantly share code, notes, and snippets.

@vibbow
Created December 7, 2018 06:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vibbow/d4e0341d3775ae937c0e0a10ee3cccf1 to your computer and use it in GitHub Desktop.
Save vibbow/d4e0341d3775ae937c0e0a10ee3cccf1 to your computer and use it in GitHub Desktop.
<?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