]);
while (!feof(STDIN)) {
- if (strlen($url = rtrim(fgets(STDIN)))) {
- $url = new Url($url, null, 0);
- $ver = basename($url->path);
- $pkg = basename(dirname($url->path));
- $skp = sprintf("%s/../build/%s-%s.skip", __DIR__, $pkg, $ver);
- $tgz = sprintf("%s/../build/%s-%s.tgz", __DIR__, $pkg, $ver);
- $ext = sprintf("%s/../public/phars/%s/%s-%s.ext.phar", __DIR__, $pkg, $pkg, $ver);
+ if (strlen($line = rtrim(fgets(STDIN)))) {
+ if (list($pkg, $ver, $url) = explode("\t", $line)) {
+ $url = new Url($url, null, 0);
+ $skp = sprintf("%s/../build/%s-%s.skip", __DIR__, $pkg, $ver);
+ $tgz = sprintf("%s/../build/%s-%s.tgz", __DIR__, $pkg, $ver);
+ $ext = sprintf("%s/../public/phars/%s/%s-%s.ext.phar", __DIR__, $pkg, $pkg, $ver);
- if (is_file($skp)) {
- // skip
- } elseif (is_file($tgz) || is_file($ext)) {
- printf("%s\t%s\t%s\n", $pkg, $ver, $tgz);
- } else {
- $client->enqueue(new Request("GET", $url), function($res) use($tgz, $pkg, $ver) {
- $res->getBody()->toStream(fopen($tgz, "w"));
+ if (is_file($skp)) {
+ // skip
+ } elseif (is_file($tgz) || is_file($ext)) {
printf("%s\t%s\t%s\n", $pkg, $ver, $tgz);
- return true;
- });
+ } else {
+ $client->enqueue(new Request("GET", $url), function($res) use($tgz, $pkg, $ver) {
+ $res->getBody()->toStream(fopen($tgz, "w"));
+ printf("%s\t%s\t%s\n", $pkg, $ver, $tgz);
+ return true;
+ });
+ }
}
}
}
--- /dev/null
+#!/usr/bin/php
+<?php
+
+ini_set("display_errors", 0);
+ini_set("log_errors", 1);
+
+$what = !empty($argv[1]) ? $argv[1] : "latest";
+
+if (($sxe = simplexml_load_file("http://pecl.php.net/feeds/$what.rss"))) {
+ foreach ($sxe->item as $item) {
+ $url = (string) $item->link;
+ printf("%s\t%s\t%s\n", basename(dirname($url)), basename($url), $url);
+ }
+}