本文整理汇总了PHP中read_checksums函数的典型用法代码示例。如果您正苦于以下问题:PHP read_checksums函数的具体用法?PHP read_checksums怎么用?PHP read_checksums使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了read_checksums函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: read_checksums
<?php
$topdir = "../../..";
include_once "{$topdir}/software/ompi/v1.0/version.inc";
$title = "Open MPI: Version {$ver_v1_0}";
include_once "{$topdir}/software/ompi/nav.inc";
include_once "{$topdir}/includes/header.inc";
include_once "{$topdir}/includes/downloads.inc";
$md5 = read_checksums("downloads/md5sums.txt");
$sha1 = read_checksums("downloads/sha1sums.txt");
#############################################################################
$t = new downloadTable("./downloads", "./downloads", dirname($_SERVER["PHP_SELF"]));
$src = "v{$ver_v1_0} (stable) source code (<a href=\"srpm.php\">SRPM notes</a>)";
$name = "openmpi-{$ver_v1_0}.tar";
$t->addFile($src, "{$name}.bz2", $md5["{$name}.bz2"], $sha1["{$name}.bz2"]);
$t->addFile($src, "{$name}.gz", $md5["{$name}.gz"], $sha1["{$name}.gz"]);
$name = "openmpi-{$ver_v1_0}-1.src.rpm";
$t->addFile($src, $name, $md5[$name], $sha1[$name]);
# No release candidates at the moment
#$s = "v1.0.2 (pending) alpha";
#$fp = fopen("downloads/latest_snapshot.txt", "r");
#$v = fgets($fp);
#fclose($fp);
#$v = substr($v, 0, strlen($v) - 1);
#
#$t->addFile($s, "openmpi-$v.tar.bz2",
# $md5["openmpi-$v.tar.bz2"],
# $sha1["openmpi-$v.tar.bz2"]);
#$t->addFile($s, "openmpi-$v.tar.gz",
# $md5["openmpi-$v.tar.gz"],
# $sha1["openmpi-$v.tar.gz"]);
示例2: trim
if (!$f) {
print "<p>No nightly tarballs available.</p>\n";
} else {
$latest = trim(fgets($f, 4096));
fclose($f);
?>
<p>Latest snapshot version: <strong><?php
print $latest;
?>
</strong></p>
<div align=center>
<?php
$md5 = read_checksums("md5sums.txt");
$sha1 = read_checksums("sha1sums.txt");
$t = new downloadTable($dir, ".");
uksort($md5, callback);
uksort($sha1, callback);
foreach ($md5 as $file => $md5sum) {
if ($file) {
$t->addFile("Nightly snapshot", $file, $md5sum, $sha1[$file]);
}
}
$t->printMe();
print "</div>\n\n";
}
# Do a reverse comparison so that we get the highest numbered tarball
# first. Parse out the git sequence number and sort numerically (not
# lexigraphically).
function callback($a, $b)