On Sun, Feb 3, 2013 at 10:26 AM, canyonknight <[email protected]> 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 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
Without reviewing every single detail, I clearly left the original work half-complete. This seems like a much more complete and full solution so I give it a +1, although I did not review every single change in the multiple patches posted here. -Dan
