Rev | Line | |
---|
[6] | 1 | <?php |
---|
| 2 | |
---|
| 3 | /** |
---|
| 4 | * Copyright (C) 2008-2011 FluxBB |
---|
| 5 | * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB |
---|
| 6 | * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | // Make sure no one attempts to run this script "directly" |
---|
| 10 | if (!defined('PUN')) |
---|
| 11 | exit; |
---|
| 12 | |
---|
| 13 | |
---|
| 14 | // Load the appropriate DB layer class |
---|
| 15 | switch ($db_type) |
---|
| 16 | { |
---|
| 17 | case 'mysql': |
---|
| 18 | require_once PUN_ROOT.'include/dblayer/mysql.php'; |
---|
| 19 | break; |
---|
| 20 | |
---|
| 21 | case 'mysql_innodb': |
---|
| 22 | require_once PUN_ROOT.'include/dblayer/mysql_innodb.php'; |
---|
| 23 | break; |
---|
| 24 | |
---|
| 25 | case 'mysqli': |
---|
| 26 | require_once PUN_ROOT.'include/dblayer/mysqli.php'; |
---|
| 27 | break; |
---|
| 28 | |
---|
| 29 | case 'mysqli_innodb': |
---|
| 30 | require_once PUN_ROOT.'include/dblayer/mysqli_innodb.php'; |
---|
| 31 | break; |
---|
| 32 | |
---|
| 33 | case 'pgsql': |
---|
| 34 | require_once PUN_ROOT.'include/dblayer/pgsql.php'; |
---|
| 35 | break; |
---|
| 36 | |
---|
| 37 | case 'sqlite': |
---|
| 38 | require_once PUN_ROOT.'include/dblayer/sqlite.php'; |
---|
| 39 | break; |
---|
| 40 | |
---|
| 41 | default: |
---|
| 42 | error('\''.$db_type.'\' is not a valid database type. Please check settings in config.php.', __FILE__, __LINE__); |
---|
| 43 | break; |
---|
| 44 | } |
---|
| 45 | |
---|
| 46 | |
---|
| 47 | // Create the database adapter object (and open/connect to/select db) |
---|
| 48 | $db = new DBLayer($db_host, $db_username, $db_password, $db_name, $db_prefix, $p_connect); |
---|
Note: See
TracBrowser
for help on using the repository browser.