Remove unneeded database connection calls

Since all database related functions will establish a connection
when needed, there is no need to pre-emptively try and establish
a database connection.

Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
canyonknight 2013-02-03 16:26:32 +00:00 committed by Lukas Fleischer
parent cf2ab50b82
commit ecf2caf7fb
4 changed files with 0 additions and 5 deletions

View file

@ -20,7 +20,6 @@ $action = in_request("Action");
if (isset($_COOKIE["AURSID"])) { if (isset($_COOKIE["AURSID"])) {
# visitor is logged in # visitor is logged in
# #
$dbh = DB::connect();
$atype = account_from_sid($_COOKIE["AURSID"]); $atype = account_from_sid($_COOKIE["AURSID"]);
if ($action == "SearchAccounts") { if ($action == "SearchAccounts") {

View file

@ -10,8 +10,6 @@ include_once('stats.inc.php');
html_header( __("Home") ); html_header( __("Home") );
$dbh = DB::connect();
?> ?>
<div id="content-left-wrapper"> <div id="content-left-wrapper">

View file

@ -10,7 +10,6 @@ include_once("acctfuncs.inc.php"); # access AUR common functions
# sending any HTML output. # sending any HTML output.
# #
if (isset($_COOKIE["AURSID"])) { if (isset($_COOKIE["AURSID"])) {
$dbh = DB::connect();
delete_session_id($_COOKIE["AURSID"]); delete_session_id($_COOKIE["AURSID"]);
# setting expiration to 1 means '1 second after midnight January 1, 1970' # setting expiration to 1 means '1 second after midnight January 1, 1970'
setcookie("AURSID", "", 1, "/", null, !empty($_SERVER['HTTPS']), true); setcookie("AURSID", "", 1, "/", null, !empty($_SERVER['HTTPS']), true);

View file

@ -356,7 +356,6 @@ if ($uid):
# Update the backend database # Update the backend database
if (!$error) { if (!$error) {
$dbh = DB::connect();
begin_atomic_commit(); begin_atomic_commit();
$pdata = pkgdetails_by_pkgname($new_pkgbuild['pkgname']); $pdata = pkgdetails_by_pkgname($new_pkgbuild['pkgname']);