Commit 44268778 authored by Lukas Fleischer's avatar Lukas Fleischer
Browse files

Move latest_pkgs() to pkgfuncs.inc.php



Signed-off-by: default avatarLukas Fleischer <archlinux@cryptocrack.de>
parent 86de2e56
......@@ -549,30 +549,6 @@ function end_atomic_commit() {
$dbh->commit();
}
/**
* Determine package information for latest package
*
* @param int $numpkgs Number of packages to get information on
*
* @return array $packages Package info for the specified number of recent packages
*/
function latest_pkgs($numpkgs) {
$dbh = DB::connect();
$q = "SELECT * FROM Packages ";
$q.= "ORDER BY SubmittedTS DESC ";
$q.= "LIMIT " .intval($numpkgs);
$result = $dbh->query($q);
if ($result) {
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
$packages[] = $row;
}
}
return $packages;
}
/**
* Merge pkgbase and package options
*
......
......@@ -942,3 +942,27 @@ function pkg_add_lic($pkgid, $licid) {
);
$dbh->exec($q);
}
/**
* Determine package information for latest package
*
* @param int $numpkgs Number of packages to get information on
*
* @return array $packages Package info for the specified number of recent packages
*/
function latest_pkgs($numpkgs) {
$dbh = DB::connect();
$q = "SELECT * FROM Packages ";
$q.= "ORDER BY SubmittedTS DESC ";
$q.= "LIMIT " .intval($numpkgs);
$result = $dbh->query($q);
if ($result) {
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
$packages[] = $row;
}
}
return $packages;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment