summaryrefslogtreecommitdiffstats
path: root/web/lib/aur.inc.php
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2014-04-04 00:01:44 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2014-04-05 12:21:35 +0200
commitb7941073acec76e5b4f89648aca1413c15eb067f (patch)
tree753a2484af94f5137825b8e49dc36885fae08eef /web/lib/aur.inc.php
parent856298755246b3841f102b67ac123bca0f12a7fd (diff)
downloadaur-b7941073acec76e5b4f89648aca1413c15eb067f.tar.gz
aur-b7941073acec76e5b4f89648aca1413c15eb067f.tar.xz
Add provisional support for package bases
This adds a PackageBases table to the database schema and moves the following fields from the Packages table to PackageBases: * CategoryID * NumVotes * OutOfDateTS * SubmittedTS * ModifiedTS * SubmitterUID * MaintainerUID It also fixes all database accesses to comply with the new layout. Having a separate PackageBases table is the first step to split package support. By now, we create one PackageBases entry per package (where the package base has the same name as the corresponding package). When adding full support for split packages later, the package base name will be derived from the pkgbase variable and a single package base will be shared amongst all packages built from one source package. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/lib/aur.inc.php')
-rw-r--r--web/lib/aur.inc.php15
1 files changed, 2 insertions, 13 deletions
diff --git a/web/lib/aur.inc.php b/web/lib/aur.inc.php
index b3a800c5..e786e507 100644
--- a/web/lib/aur.inc.php
+++ b/web/lib/aur.inc.php
@@ -292,11 +292,11 @@ function html_footer($ver="") {
*
* @return int 0 if the user can't submit, 1 if the user can submit
*/
-function can_submit_pkg($name="", $sid="") {
+function can_submit_pkgbase($name="", $sid="") {
if (!$name || !$sid) {return 0;}
$dbh = DB::connect();
$q = "SELECT MaintainerUID ";
- $q.= "FROM Packages WHERE Name = " . $dbh->quote($name);
+ $q.= "FROM PackageBases WHERE Name = " . $dbh->quote($name);
$result = $dbh->query($q);
$row = $result->fetch(PDO::FETCH_NUM);
@@ -531,17 +531,6 @@ function end_atomic_commit() {
}
/**
- *
- * Determine the row ID for the most recently insterted row
- *
- * @return string The ID of the last inserted row
- */
-function last_insert_id() {
- $dbh = DB::connect();
- return $dbh->lastInsertId();
-}
-
-/**
* Determine package information for latest package
*
* @param int $numpkgs Number of packages to get information on