source: trunk/web/punbb/include/dblayer/common_db.php @ 10

Last change on this file since 10 was 6, checked in by dj3c1t, 13 years ago

mise a jour du trunk

File size: 1.1 KB
Line 
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"
10if (!defined('PUN'))
11        exit;
12
13
14// Load the appropriate DB layer class
15switch ($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.