本文整理汇总了PHP中repository::fetch方法的典型用法代码示例。如果您正苦于以下问题:PHP repository::fetch方法的具体用法?PHP repository::fetch怎么用?PHP repository::fetch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类repository
的用法示例。
在下文中一共展示了repository::fetch方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: redefrepo
function redefrepo($reposelected = 0)
{
global $defrepo, $classes, $npackages;
$defrepo = array();
$classes = array();
$repo = new repository();
$nrepos = $repo->find();
while ($repo->fetch()) {
$id = $repo->id;
$defrepo[$id] = (array) $repo;
unset($defrepo[$id]["db"]);
$defrepo[$id]['selected'] = $id == $reposelected;
$classes[$repo->class]['class'] = $repo->class;
$classes[$repo->class]['arch'] = $repo->arch;
$classes[$repo->class]['version'] = $repo->version;
$classes[$repo->class]['selected'] = $repo->class == $reposelected;
$classes[$repo->class]['repo'][] = $repo->id;
$npackages += $repo->npkgs;
}
echo "<table border='0' width='100%'>";
echo "<tr>";
echo "<td>";
echo "You are the " . $_SESSION['searcher_visitor'] . "st visitor<br />";
echo "Searched " . $GLOBALS['db']->counter_get('searches') . " packages from 24 Apr 2012<br /><br />";
echo "<code>{$nrepos} repositories ({$npackages} packages)</code><br><br>\n";
echo "</td>";
$stats = new stats();
$names = $stats->lastsearch(15);
echo "<td>";
echo "<table border=1 cellspacing=0>";
echo "<tr><td colspan=3 align=center><code><b><a href='stats.php'>Recents</a></b></code></td></tr>";
echo "<tr><td><code>", $names[0] . "<br />" . $names[1] . "<br />" . $names[2] . "<br />" . $names[3] . "<br />" . $names[4] . "</code></td>";
echo "<td><code>", $names[5] . "<br />" . $names[6] . "<br />" . $names[7] . "<br />" . $names[8] . "<br />" . $names[9] . "</code></td>";
echo "<td><code>", $names[10] . "<br />" . $names[11] . "<br />" . $names[12] . "<br />" . $names[13] . "<br />" . $names[14] . "</code></td></tr>";
echo "</table>";
echo "</td>";
echo "<td>";
echo "<table border=1 cellspacing=0 cellpadding=0>";
echo "<tr><td><a href='stats.php'><img border=0 src='stats.php?gdaily&y=95&time=60&mid=0'></a></td></tr>";
echo "</table>";
echo "</tr></table>";
}
示例2: tables
echo tables(array("URL", "<a href='{$repo->url}'>{$repo->url}</a>"));
echo tables(array("Rank", $repo->rank));
echo tables(array("File list", $repo->manifest ? "<a href='{$repo->url}{$repo->manifest}'>{$repo->manifest}</a>" : "unsupported"));
echo tables(array("Packages", "<a href='{$repo->url}{$repo->packages}'>{$repo->packages}</a>"));
echo tables(array("Slackware Version", $repo->version));
echo tables(array("Arch", $repo->arch));
echo tables(array("Class", $repo->class));
echo tables(array("Last update", $repo->mtime));
echo tables(array("Name", $repo->name));
echo tables(array("N. packages", $repo->npkgs));
echo tables(array("N. files", $repo->nfiles));
echo tables(array("Dependencies", $repo->deps ? "supported" : "unsupported"));
echo tables(array("Description", $repo->description . "<br>"));
echo tables(array("Brief Descr.", $repo->brief));
echo tables();
} else {
$id = 0;
}
}
if (!$id) {
echo tables(array('id', 'brief', 'arch', 'version', 'description'), 1, "class='tab'");
$repo = new repository();
$repo->find();
while ($r = $repo->fetch()) {
echo tables(array($repo->id, "<a href='showrepo.php?repo={$repo->id}'>{$repo->brief}</a>", $repo->arch, $repo->version, $repo->description . "<br>"));
}
echo tables();
}
echo "</pre>";
echo "To report a bug, send a mail to <a href='mailto:zerouno@slacky.it'>zerouno@slacky.it</a>. Thanks.";
echo "</body></html>";