summaryrefslogtreecommitdiffstats
path: root/web/lib/aurjson.class.php
diff options
context:
space:
mode:
authorcanyonknight <canyonknight@gmail.com>2013-02-03 17:26:28 +0100
committerLukas Fleischer <archlinux@cryptocrack.de>2013-02-10 12:10:37 +0100
commit8e03e68d687015b5cd8c9d3857e1a1d007252afa (patch)
tree26cd5d7aa6cfac4f6fddfa1f76fdc59d2cbd4a0f /web/lib/aurjson.class.php
parentb3a2b6c4a59a2cd90b020120b64f16797af1b6fb (diff)
downloadaur-8e03e68d687015b5cd8c9d3857e1a1d007252afa.tar.gz
aur-8e03e68d687015b5cd8c9d3857e1a1d007252afa.tar.xz
Add database wrapper class and new connection method
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 <canyonknight@gmail.com> Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/lib/aurjson.class.php')
-rw-r--r--web/lib/aurjson.class.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/web/lib/aurjson.class.php b/web/lib/aurjson.class.php
index 616b7838..b9052756 100644
--- a/web/lib/aurjson.class.php
+++ b/web/lib/aurjson.class.php
@@ -52,7 +52,7 @@ class AurJSON {
// do the routing
if ( in_array($http_data['type'], self::$exposed_methods) ) {
// set up db connection.
- $this->dbh = db_connect();
+ $this->dbh = DB::connect();
// ugh. this works. I hate you php.
$json = call_user_func(array(&$this, $http_data['type']),