if (!$relid) { $bb = new BorderBox("Available Releases", "90%", "", 5, true); if (count($pkg['releases']) == 0) { print "<i>No releases for this package.</i>"; } else { $bb->headRow("Version", "State", "Release Date", "Downloads", ""); foreach ($pkg['releases'] as $r_version => $r) { if (empty($r['state'])) { $r['state'] = 'devel'; } $r['releasedate'] = substr($r['releasedate'], 0, 10); $dl = $downloads[$r_version]; $downloads_html = ''; foreach ($downloads[$r_version] as $dl) { $downloads_html .= "<a href=\"/get/{$dl['basename']}\">" . "{$dl['basename']}</a> (" . sprintf("%.1fkB", @filesize($dl['fullpath']) / 1024.0) . ")"; $urls = package_dll::getDllDownloadUrls($pkg['name'], $r_version, $pkg['releases'][$r_version]['releasedate']); if ($urls) { $downloads_html .= " <a href=\"/package/{$pkg['name']}/{$r_version}/windows\">" . "<img src=\"/gifs/windows-icon.png\" />DLL</a>"; } } $link_changelog = "<small>[" . make_link("/package-changelog.php?package=" . $pkg['name'] . "&release=" . $r_version, "Changelog") . "]</small>"; $href_release = "/package/" . $pkg['name'] . "/" . $r_version; $bb->horizHeadRow(make_link($href_release, $r_version), $r['state'], $r['releasedate'], $downloads_html, $link_changelog); } } $bb->end(); print "<br /><br />\n"; } // }}} // {{{ "Dependencies" $title = "Dependencies";
#!/usr/local/bin/php -Cq <?php /* vim: set expandtab tabstop=4 shiftwidth=4; */ // +---------------------------------------------------------------------+ // | Authors: Anatol Belski <*****@*****.**> | // +---------------------------------------------------------------------+ // require_once dirname(__FILE__) . '/../include/pear-prepend.php'; /*require_once "PEAR.php"; require_once "DB.php"; require_once dirname(__FILE__) . '/../include/pear-win-package.php';*/ $dbh = DB::connect("mysql://*****:*****@localhost/pear"); if (DB::isError($dbh)) { die("could not connect to database"); } $dbh->query('SET NAMES utf8'); $data = $dbh->getAll("SELECT packages.name, releases.version, releases.releasedate \n\t\t\t\t\t\tFROM packages, releases\n\t\t\t\t\t\tWHERE packages.id = releases.package", NULL, DB_FETCHMODE_ASSOC); if (package_dll::isResetOverdue()) { if (!package_dll::resetDllDownloadCache()) { /* some reset running, just sleep and do our thing*/ sleep(10); } } foreach ($data as $pkg) { //$urls = package_dll::getDllDownloadUrls($pkg['name'], $pkg['version'], $pkg['releasedate'], true); if (!package_dll::updateDllDownloadCache($pkg['name'], $pkg['version'])) { echo "Failed to update cache for {$pkg['name']}-{$pkg['version']}\n"; } }