diff options
author | Lukas Fleischer <archlinux@cryptocrack.de> | 2014-05-29 21:13:27 +0200 |
---|---|---|
committer | Lukas Fleischer <archlinux@cryptocrack.de> | 2014-05-29 21:13:45 +0200 |
commit | 44268778c824c2d5f49f00f9276a864aeb2e9681 (patch) | |
tree | be910bfe56d8bef97b7f13099093270327826352 /web | |
parent | 86de2e562858d609709cada05f75fe3ec3779f5a (diff) | |
download | aur-44268778c824c2d5f49f00f9276a864aeb2e9681.tar.gz aur-44268778c824c2d5f49f00f9276a864aeb2e9681.tar.xz |
Move latest_pkgs() to pkgfuncs.inc.php
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web')
-rw-r--r-- | web/lib/aur.inc.php | 24 | ||||
-rw-r--r-- | web/lib/pkgfuncs.inc.php | 24 |
2 files changed, 24 insertions, 24 deletions
diff --git a/web/lib/aur.inc.php b/web/lib/aur.inc.php index ff464558..99f5ae4a 100644 --- a/web/lib/aur.inc.php +++ b/web/lib/aur.inc.php @@ -550,30 +550,6 @@ function end_atomic_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 * * Merges entries of the first and the second array. If any key appears in both diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php index c35147fb..a43512c3 100644 --- a/web/lib/pkgfuncs.inc.php +++ b/web/lib/pkgfuncs.inc.php @@ -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; +} |