- Timestamp:
- Nov 14, 2011, 11:17:15 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/rsr.v5.1.dev/web/punbb/include/dblayer/common_db.php
r1 r3 1 1 <?php 2 /***********************************************************************3 2 4 Copyright (C) 2002-2005 Rickard Andersson (rickard@punbb.org) 5 6 This file is part of PunBB. 7 8 PunBB is free software; you can redistribute it and/or modify it 9 under the terms of the GNU General Public License as published 10 by the Free Software Foundation; either version 2 of the License, 11 or (at your option) any later version. 12 13 PunBB is distributed in the hope that it will be useful, but 14 WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 GNU General Public License for more details. 17 18 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 MA 02111-1307 USA 22 23 ************************************************************************/ 24 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 */ 25 8 26 9 // Make sure no one attempts to run this script "directly" … … 29 12 30 13 31 //32 // Return current timestamp (with microseconds) as a float (used in dblayer)33 //34 if (defined('PUN_SHOW_QUERIES'))35 {36 function get_microtime()37 {38 list($usec, $sec) = explode(' ', microtime());39 return ((float)$usec + (float)$sec);40 }41 }42 43 44 14 // Load the appropriate DB layer class 45 15 switch ($db_type) 46 16 { 47 17 case 'mysql': 48 require PUN_ROOT.'include/dblayer/mysql.php'; 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'; 49 23 break; 50 24 51 25 case 'mysqli': 52 require PUN_ROOT.'include/dblayer/mysqli.php'; 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'; 53 31 break; 54 32 55 33 case 'pgsql': 56 require PUN_ROOT.'include/dblayer/pgsql.php';34 require_once PUN_ROOT.'include/dblayer/pgsql.php'; 57 35 break; 58 36 59 37 case 'sqlite': 60 require PUN_ROOT.'include/dblayer/sqlite.php';38 require_once PUN_ROOT.'include/dblayer/sqlite.php'; 61 39 break; 62 40 63 41 default: 64 error('\''.$db_type.'\' n\'est pas un type de base de données valable. Veuillez vérifier vos paramÚtres de configuration dans config.php', __FILE__, __LINE__);42 error('\''.$db_type.'\' is not a valid database type. Please check settings in config.php.', __FILE__, __LINE__); 65 43 break; 66 44 }
Note: See TracChangeset
for help on using the changeset viewer.