Derek Jones | 37f4b9c | 2011-07-01 17:56:50 -0500 | [diff] [blame] | 1 | <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 2 | /** |
| 3 | * CodeIgniter |
| 4 | * |
| 5 | * An open source application development framework for PHP 5.1.6 or newer |
| 6 | * |
| 7 | * NOTICE OF LICENSE |
| 8 | * |
| 9 | * Licensed under the Academic Free License version 3.0 |
| 10 | * |
Derek Jones | 61df906 | 2011-10-21 09:55:40 -0500 | [diff] [blame] | 11 | * This source file is subject to the Academic Free License (AFL 3.0) that is |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 12 | * bundled with this package in the files license_afl.txt / license_afl.rst. |
| 13 | * It is also available through the world wide web at this URL: |
| 14 | * http://opensource.org/licenses/AFL-3.0 |
| 15 | * If you did not receive a copy of the license and are unable to obtain it |
| 16 | * through the world wide web, please send an email to |
| 17 | * licensing@ellislab.com so we can send you a copy immediately. |
| 18 | * |
| 19 | * @package CodeIgniter |
| 20 | * @author EllisLab Dev Team |
Greg Aker | 0defe5d | 2012-01-01 18:46:41 -0600 | [diff] [blame] | 21 | * @copyright Copyright (c) 2008 - 2012, EllisLab, Inc. (http://ellislab.com/) |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 22 | * @license http://opensource.org/licenses/AFL-3.0 Academic Free License (AFL 3.0) |
| 23 | * @link http://codeigniter.com |
| 24 | * @since Version 1.0 |
| 25 | * @filesource |
| 26 | */ |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 27 | /* |
| 28 | | ------------------------------------------------------------------- |
| 29 | | DATABASE CONNECTIVITY SETTINGS |
| 30 | | ------------------------------------------------------------------- |
| 31 | | This file will contain the settings needed to access your database. |
| 32 | | |
Derek Allard | b76fedd | 2010-08-12 16:14:10 -0400 | [diff] [blame] | 33 | | For complete instructions please consult the 'Database Connection' |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 34 | | page of the User Guide. |
| 35 | | |
| 36 | | ------------------------------------------------------------------- |
| 37 | | EXPLANATION OF VARIABLES |
| 38 | | ------------------------------------------------------------------- |
| 39 | | |
Taufan Aditya | 0142f70 | 2012-02-09 16:10:49 +0700 | [diff] [blame] | 40 | | ['dsn'] The full DSN string describe a connection to the database. |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 41 | | ['hostname'] The hostname of your database server. |
| 42 | | ['username'] The username used to connect to the database |
| 43 | | ['password'] The password used to connect to the database |
| 44 | | ['database'] The name of the database you want to connect to |
mrw | 4d77d88 | 2011-12-24 02:37:34 -0500 | [diff] [blame] | 45 | | ['dbdriver'] The database type. e.g.: mysql. Currently supported: |
Timothy Warren | ab34758 | 2011-08-23 12:29:29 -0400 | [diff] [blame] | 46 | mysql, mysqli, pdo, postgre, odbc, mssql, sqlite, oci8 |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 47 | | ['dbprefix'] You can add an optional prefix, which will be added |
Jamie Rumbelow | 7efad20 | 2012-02-19 12:37:00 +0000 | [diff] [blame^] | 48 | | to the table name when using the Query Builder class |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 49 | | ['pconnect'] TRUE/FALSE - Whether to use a persistent connection |
| 50 | | ['db_debug'] TRUE/FALSE - Whether database errors should be displayed. |
| 51 | | ['cache_on'] TRUE/FALSE - Enables/disables query caching |
| 52 | | ['cachedir'] The path to the folder where cache files should be stored |
| 53 | | ['char_set'] The character set used in communicating with the database |
| 54 | | ['dbcollat'] The character collation used in communicating with the database |
Derek Jones | 6ae70cc | 2011-04-19 16:13:48 -0500 | [diff] [blame] | 55 | | NOTE: For MySQL and MySQLi databases, this setting is only used |
Derek Jones | 3b9f88d | 2011-05-20 10:25:13 -0500 | [diff] [blame] | 56 | | as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7 |
| 57 | | (and in table creation queries made with DB Forge). |
Derek Jones | 6ae70cc | 2011-04-19 16:13:48 -0500 | [diff] [blame] | 58 | | There is an incompatibility in PHP with mysql_real_escape_string() which |
| 59 | | can make your site vulnerable to SQL injection if you are using a |
| 60 | | multi-byte character set and are running versions lower than these. |
| 61 | | Sites using Latin-1 or UTF-8 database character set and collation are unaffected. |
Derek Jones | ad1171a | 2010-03-10 14:18:38 -0600 | [diff] [blame] | 62 | | ['swap_pre'] A default table prefix that should be swapped with the dbprefix |
| 63 | | ['autoinit'] Whether or not to automatically initialize the database. |
Derek Allard | b76fedd | 2010-08-12 16:14:10 -0400 | [diff] [blame] | 64 | | ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections |
Derek Jones | c34e578 | 2010-03-02 17:35:55 -0600 | [diff] [blame] | 65 | | - good for ensuring strict SQL while developing |
Felix Balfoort | 5d581b6 | 2011-11-29 15:53:01 +0100 | [diff] [blame] | 66 | | ['failover'] array - A array with 0 or more data for connections if the main should fail. |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 67 | | |
| 68 | | The $active_group variable lets you choose which connection group to |
Derek Jones | 37f4b9c | 2011-07-01 17:56:50 -0500 | [diff] [blame] | 69 | | make active. By default there is only one group (the 'default' group). |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 70 | | |
Jamie Rumbelow | 7efad20 | 2012-02-19 12:37:00 +0000 | [diff] [blame^] | 71 | | The $query_builder variables lets you determine whether or not to load |
| 72 | | the query builder class |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 73 | */ |
| 74 | |
Derek Allard | b76fedd | 2010-08-12 16:14:10 -0400 | [diff] [blame] | 75 | $active_group = 'default'; |
Jamie Rumbelow | 7efad20 | 2012-02-19 12:37:00 +0000 | [diff] [blame^] | 76 | $query_builder = TRUE; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 77 | |
Taufan Aditya | 0142f70 | 2012-02-09 16:10:49 +0700 | [diff] [blame] | 78 | $db['default']['dsn'] = ''; |
Derek Allard | b76fedd | 2010-08-12 16:14:10 -0400 | [diff] [blame] | 79 | $db['default']['hostname'] = 'localhost'; |
| 80 | $db['default']['username'] = ''; |
| 81 | $db['default']['password'] = ''; |
| 82 | $db['default']['database'] = ''; |
| 83 | $db['default']['dbdriver'] = 'mysql'; |
| 84 | $db['default']['dbprefix'] = ''; |
Phil Sturgeon | 5280c3c | 2011-12-28 15:52:49 +0000 | [diff] [blame] | 85 | $db['default']['pconnect'] = FALSE; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 86 | $db['default']['db_debug'] = TRUE; |
| 87 | $db['default']['cache_on'] = FALSE; |
Derek Allard | b76fedd | 2010-08-12 16:14:10 -0400 | [diff] [blame] | 88 | $db['default']['cachedir'] = ''; |
| 89 | $db['default']['char_set'] = 'utf8'; |
| 90 | $db['default']['dbcollat'] = 'utf8_general_ci'; |
| 91 | $db['default']['swap_pre'] = ''; |
Derek Jones | ad1171a | 2010-03-10 14:18:38 -0600 | [diff] [blame] | 92 | $db['default']['autoinit'] = TRUE; |
Derek Jones | c34e578 | 2010-03-02 17:35:55 -0600 | [diff] [blame] | 93 | $db['default']['stricton'] = FALSE; |
Felix Balfoort | 5d581b6 | 2011-11-29 15:53:01 +0100 | [diff] [blame] | 94 | $db['default']['failover'] = array(); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 95 | |
| 96 | /* End of file database.php */ |
Derek Jones | f0b3994 | 2010-03-25 10:08:20 -0500 | [diff] [blame] | 97 | /* Location: ./application/config/database.php */ |