diff options
author | canyonknight <canyonknight@gmail.com> | 2012-05-23 15:30:52 -0400 |
---|---|---|
committer | Lukas Fleischer <archlinux@cryptocrack.de> | 2012-07-06 11:27:02 +0200 |
commit | 763cbf8373e3373254ad18f5b69fd16efdc6fd5c (patch) | |
tree | a7ba8ba6fc4fc3393ab0f8bb2d707e57627dcdb5 /web/lib/aur.inc.php | |
parent | 82d234c4d559a80ab33b682e004e5991f65a8017 (diff) | |
download | aurweb-763cbf8373e3373254ad18f5b69fd16efdc6fd5c.tar.xz |
pkgsubmit.php: Pull out DB code
* Move DB code in pkgsubmit.php to new functions in aur.inc.php and
pkgfuncs.inc.php
* Centralization of DB code important in a future transition to PDO interface
Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/lib/aur.inc.php')
-rw-r--r-- | web/lib/aur.inc.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/web/lib/aur.inc.php b/web/lib/aur.inc.php index 991fb14..1a294a9 100644 --- a/web/lib/aur.inc.php +++ b/web/lib/aur.inc.php @@ -512,3 +512,24 @@ function parse_comment($comment) { return $html; } + +function begin_atomic_commit($dbh=NULL) { + if(!$dbh) { + $dbh = db_connect(); + } + db_query("BEGIN", $dbh); +} + +function end_atomic_commit($dbh=NULL) { + if(!$dbh) { + $dbh = db_connect(); + } + db_query("COMMIT", $dbh); +} + +function last_insert_id($dbh=NULL) { + if(!$dbh) { + $dbh = db_connect(); + } + return mysql_insert_id($dbh); +} |