Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/include/dblayer/common_db.php
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2020-02-01 08:57:06 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2020-02-01 08:57:06 +0100
commitada3beb0a6c649bd9bfc6a87b2fe69ee8ae563f7 (patch)
treedf74b326c096fad4d74b90988caed727c15847ef /include/dblayer/common_db.php
initial checkin
Diffstat (limited to 'include/dblayer/common_db.php')
-rw-r--r--include/dblayer/common_db.php48
1 files changed, 48 insertions, 0 deletions
diff --git a/include/dblayer/common_db.php b/include/dblayer/common_db.php
new file mode 100644
index 0000000..5b9e67e
--- /dev/null
+++ b/include/dblayer/common_db.php
@@ -0,0 +1,48 @@
+<?php
+
+/**
+ * Copyright (C) 2008-2012 FluxBB
+ * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
+ * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
+ */
+
+// Make sure no one attempts to run this script "directly"
+if (!defined('PUN'))
+ exit;
+
+
+// Load the appropriate DB layer class
+switch ($db_type)
+{
+ case 'mysql':
+ require_once PUN_ROOT.'include/dblayer/mysql.php';
+ break;
+
+ case 'mysql_innodb':
+ require_once PUN_ROOT.'include/dblayer/mysql_innodb.php';
+ break;
+
+ case 'mysqli':
+ require_once PUN_ROOT.'include/dblayer/mysqli.php';
+ break;
+
+ case 'mysqli_innodb':
+ require_once PUN_ROOT.'include/dblayer/mysqli_innodb.php';
+ break;
+
+ case 'pgsql':
+ require_once PUN_ROOT.'include/dblayer/pgsql.php';
+ break;
+
+ case 'sqlite':
+ require_once PUN_ROOT.'include/dblayer/sqlite.php';
+ break;
+
+ default:
+ error('\''.$db_type.'\' is not a valid database type. Please check settings in config.php.', __FILE__, __LINE__);
+ break;
+}
+
+
+// Create the database adapter object (and open/connect to/select db)
+$db = new DBLayer($db_host, $db_username, $db_password, $db_name, $db_prefix, $p_connect);