c55e785d1f0530d8e5d287f3caa5c7028801445d
4 ini_set("display_errors", 0);
5 ini_set("log_errors", 1);
9 use http\Client\Request
;
19 while (!feof(STDIN
)) {
20 if (strlen($line = rtrim(fgets(STDIN
)))) {
21 if (list($pkg, $ver, $url) = explode("\t", $line)) {
22 $url = new Url($url, null, 0);
23 $skp = sprintf("%s/../build/%s-%s.skip", __DIR__
, $pkg, $ver);
24 $tgz = sprintf("%s/../build/%s-%s.tgz", __DIR__
, $pkg, $ver);
25 $ext = sprintf("%s/../public/phars/%s/%s-%s.ext.phar", __DIR__
, $pkg, $pkg, $ver);
29 } elseif (is_file($tgz) ||
is_file($ext)) {
30 printf("%s\t%s\t%s\n", $pkg, $ver, $tgz);
32 $client->enqueue(new Request("GET", $url), function($res) use($tgz, $pkg, $ver) {
33 $res->getBody()->toStream(fopen($tgz, "w"));
34 printf("%s\t%s\t%s\n", $pkg, $ver, $tgz);
42 while (count($client)) {
45 } catch (Exception
$e) {
46 error_log($e->getMessage());