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 amount of boilerplate code. This patch series will basically fully implement the same functionality as passing DB handles as arguments but with a lot less code and not mucking up function args. Due to the fact that some of these patches are quite large they may get eaten by the list, so as always they will be available on my "working" branch. canyonknight (5): Add database wrapper class and new connection method Remove unnecessary database connection parameter from all functions Remove documentation references to database parameter Remove checks before calling connection method Remove unneeded database connection calls web/html/account.php | 1 - web/html/home.php | 8 +- web/html/logout.php | 7 +- web/html/pkgsubmit.php | 23 ++-- web/lib/DB.class.php | 28 +++++ web/lib/acctfuncs.inc.php | 179 +++++++++-------------------- web/lib/aur.inc.php | 131 ++++++--------------- web/lib/aurjson.class.php | 2 +- web/lib/cachefuncs.inc.php | 3 +- web/lib/pkgfuncs.inc.php | 276 +++++++++++++++------------------------------ web/lib/stats.inc.php | 33 +++--- web/lib/translator.inc.php | 6 +- 12 files changed, 239 insertions(+), 458 deletions(-) create mode 100644 web/lib/DB.class.php -- 1.8.1.2