On Sun, Feb 3, 2013 at 10:26 AM, canyonknight wrote:
> Hello all,
>
> I recently noticed in my SQL logs that multiple database connections
> will be started over the course of a page loading. Past commits have
> relied on passing the handle as an argument to avoid that.
>
> The problem is many fun
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
---
web/html/account.php | 1 -
web/html/home.php | 2 --
web/html/logout.php| 1 -
web/html/pkgsubmit.p
Large amount of boilerplate code that checks if a database
connection exists is useless now that the new connection method
automatically does the same check.
Signed-off-by: canyonknight
---
web/html/logout.php| 4 +-
web/lib/acctfuncs.inc.php | 97 --
web/
---
web/lib/acctfuncs.inc.php | 24
web/lib/aur.inc.php | 18 --
web/lib/pkgfuncs.inc.php | 24
web/lib/stats.inc.php | 5 -
4 files changed, 71 deletions(-)
diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfunc
All functions now have a database connection method that will use
the same database connection. This imitates the functionality of
passing a database connection as an argument and makes it redundant.
Signed-off-by: canyonknight
---
web/html/home.php | 6 +--
web/html/logout.php
Uses the Singleton pattern to ensure all queries use the same
database connection that is released upon script completion.
All database connections should now be called with DB::connect() and
not db_connect().
Signed-off-by: canyonknight
---
web/html/account.php | 2 +-
web/html/home.php
Hello all,
I recently noticed in my SQL logs that multiple database connections
will be started over the course of a page loading. Past commits have
relied on passing the handle as an argument to avoid that.
The problem is many functions don't get a handle passed to them and
there is a large amou