darwinel | d8bef8a | 2014-02-11 20:13:22 +0100 | [diff] [blame] | 1 | <?php |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 2 | /** |
| 3 | * CodeIgniter |
| 4 | * |
Phil Sturgeon | 07c1ac8 | 2012-03-09 17:03:37 +0000 | [diff] [blame] | 5 | * An open source application development framework for PHP 5.2.4 or newer |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 6 | * |
Andrey Andreev | bdb96ca | 2014-10-28 00:13:31 +0200 | [diff] [blame] | 7 | * This content is released under the MIT License (MIT) |
Andrey Andreev | e734b38 | 2012-03-26 13:42:36 +0300 | [diff] [blame] | 8 | * |
Andrey Andreev | bdb96ca | 2014-10-28 00:13:31 +0200 | [diff] [blame] | 9 | * Copyright (c) 2014, British Columbia Institute of Technology |
Andrey Andreev | e734b38 | 2012-03-26 13:42:36 +0300 | [diff] [blame] | 10 | * |
Andrey Andreev | bdb96ca | 2014-10-28 00:13:31 +0200 | [diff] [blame] | 11 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 12 | * of this software and associated documentation files (the "Software"), to deal |
| 13 | * in the Software without restriction, including without limitation the rights |
| 14 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 15 | * copies of the Software, and to permit persons to whom the Software is |
| 16 | * furnished to do so, subject to the following conditions: |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 17 | * |
Andrey Andreev | bdb96ca | 2014-10-28 00:13:31 +0200 | [diff] [blame] | 18 | * The above copyright notice and this permission notice shall be included in |
| 19 | * all copies or substantial portions of the Software. |
| 20 | * |
| 21 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 22 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 23 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 24 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 25 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 26 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 27 | * THE SOFTWARE. |
| 28 | * |
| 29 | * @package CodeIgniter |
| 30 | * @author EllisLab Dev Team |
darwinel | 871754a | 2014-02-11 17:34:57 +0100 | [diff] [blame] | 31 | * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/) |
Andrey Andreev | bdb96ca | 2014-10-28 00:13:31 +0200 | [diff] [blame] | 32 | * @copyright Copyright (c) 2014, British Columbia Institute of Technology (http://bcit.ca/) |
| 33 | * @license http://opensource.org/licenses/MIT MIT License |
| 34 | * @link http://codeigniter.com |
| 35 | * @since Version 1.0.0 |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 36 | * @filesource |
| 37 | */ |
darwinel | d8bef8a | 2014-02-11 20:13:22 +0100 | [diff] [blame] | 38 | defined('BASEPATH') OR exit('No direct script access allowed'); |
| 39 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 40 | /* |
| 41 | | ------------------------------------------------------------------- |
| 42 | | DATABASE CONNECTIVITY SETTINGS |
| 43 | | ------------------------------------------------------------------- |
| 44 | | This file will contain the settings needed to access your database. |
| 45 | | |
Derek Allard | b76fedd | 2010-08-12 16:14:10 -0400 | [diff] [blame] | 46 | | For complete instructions please consult the 'Database Connection' |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 47 | | page of the User Guide. |
| 48 | | |
| 49 | | ------------------------------------------------------------------- |
| 50 | | EXPLANATION OF VARIABLES |
| 51 | | ------------------------------------------------------------------- |
| 52 | | |
Taufan Aditya | 0142f70 | 2012-02-09 16:10:49 +0700 | [diff] [blame] | 53 | | ['dsn'] The full DSN string describe a connection to the database. |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 54 | | ['hostname'] The hostname of your database server. |
| 55 | | ['username'] The username used to connect to the database |
| 56 | | ['password'] The password used to connect to the database |
| 57 | | ['database'] The name of the database you want to connect to |
Andrey Andreev | 2608687 | 2012-07-05 11:21:58 +0300 | [diff] [blame] | 58 | | ['dbdriver'] The database driver. e.g.: mysqli. |
Andrey Andreev | 2f8bf9b | 2012-10-12 20:37:52 +0300 | [diff] [blame] | 59 | | Currently supported: |
Andrey Andreev | 2608687 | 2012-07-05 11:21:58 +0300 | [diff] [blame] | 60 | | cubrid, ibase, mssql, mysql, mysqli, oci8, |
Timothy Warren | 43481d0 | 2012-04-17 09:17:40 -0400 | [diff] [blame] | 61 | | odbc, pdo, postgre, sqlite, sqlite3, sqlsrv |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 62 | | ['dbprefix'] You can add an optional prefix, which will be added |
Jamie Rumbelow | 7efad20 | 2012-02-19 12:37:00 +0000 | [diff] [blame] | 63 | | to the table name when using the Query Builder class |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 64 | | ['pconnect'] TRUE/FALSE - Whether to use a persistent connection |
| 65 | | ['db_debug'] TRUE/FALSE - Whether database errors should be displayed. |
| 66 | | ['cache_on'] TRUE/FALSE - Enables/disables query caching |
| 67 | | ['cachedir'] The path to the folder where cache files should be stored |
| 68 | | ['char_set'] The character set used in communicating with the database |
| 69 | | ['dbcollat'] The character collation used in communicating with the database |
Derek Jones | 6ae70cc | 2011-04-19 16:13:48 -0500 | [diff] [blame] | 70 | | NOTE: For MySQL and MySQLi databases, this setting is only used |
Derek Jones | 3b9f88d | 2011-05-20 10:25:13 -0500 | [diff] [blame] | 71 | | as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7 |
| 72 | | (and in table creation queries made with DB Forge). |
Derek Jones | 6ae70cc | 2011-04-19 16:13:48 -0500 | [diff] [blame] | 73 | | There is an incompatibility in PHP with mysql_real_escape_string() which |
| 74 | | can make your site vulnerable to SQL injection if you are using a |
| 75 | | multi-byte character set and are running versions lower than these. |
| 76 | | 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] | 77 | | ['swap_pre'] A default table prefix that should be swapped with the dbprefix |
| 78 | | ['autoinit'] Whether or not to automatically initialize the database. |
Andrey Andreev | 2f8bf9b | 2012-10-12 20:37:52 +0300 | [diff] [blame] | 79 | | ['encrypt'] Whether or not to use an encrypted connection. |
| 80 | | ['compress'] Whether or not to use client compression (MySQL only) |
Derek Allard | b76fedd | 2010-08-12 16:14:10 -0400 | [diff] [blame] | 81 | | ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections |
Derek Jones | c34e578 | 2010-03-02 17:35:55 -0600 | [diff] [blame] | 82 | | - good for ensuring strict SQL while developing |
Felix Balfoort | 5d581b6 | 2011-11-29 15:53:01 +0100 | [diff] [blame] | 83 | | ['failover'] array - A array with 0 or more data for connections if the main should fail. |
Andrey Andreev | 1c8245a | 2014-01-20 10:28:20 +0200 | [diff] [blame] | 84 | | ['save_queries'] TRUE/FALSE - Whether to "save" all executed queries. |
| 85 | | NOTE: Disabling this will also effectively disable both |
| 86 | | $this->db->last_query() and profiling of DB queries. |
| 87 | | When you run a query, with this setting set to TRUE (default), |
| 88 | | CodeIgniter will store the SQL statement for debugging purposes. |
| 89 | | However, this may cause high memory usage, especially if you run |
| 90 | | a lot of SQL queries ... disable this to avoid that problem. |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 91 | | |
| 92 | | The $active_group variable lets you choose which connection group to |
Derek Jones | 37f4b9c | 2011-07-01 17:56:50 -0500 | [diff] [blame] | 93 | | make active. By default there is only one group (the 'default' group). |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 94 | | |
Jamie Rumbelow | 7efad20 | 2012-02-19 12:37:00 +0000 | [diff] [blame] | 95 | | The $query_builder variables lets you determine whether or not to load |
Andrey Andreev | 2f8bf9b | 2012-10-12 20:37:52 +0300 | [diff] [blame] | 96 | | the query builder class. |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 97 | */ |
| 98 | |
Derek Allard | b76fedd | 2010-08-12 16:14:10 -0400 | [diff] [blame] | 99 | $active_group = 'default'; |
Jamie Rumbelow | 7efad20 | 2012-02-19 12:37:00 +0000 | [diff] [blame] | 100 | $query_builder = TRUE; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 101 | |
Timothy Warren | d294a58 | 2012-04-04 13:28:39 -0400 | [diff] [blame] | 102 | $db['default'] = array( |
| 103 | 'dsn' => '', |
| 104 | 'hostname' => 'localhost', |
| 105 | 'username' => '', |
| 106 | 'password' => '', |
| 107 | 'database' => '', |
| 108 | 'dbdriver' => 'mysqli', |
| 109 | 'dbprefix' => '', |
Andrey Andreev | de6eff0 | 2012-06-26 18:13:13 +0300 | [diff] [blame] | 110 | 'pconnect' => TRUE, |
Timothy Warren | d294a58 | 2012-04-04 13:28:39 -0400 | [diff] [blame] | 111 | 'db_debug' => TRUE, |
| 112 | 'cache_on' => FALSE, |
| 113 | 'cachedir' => '', |
| 114 | 'char_set' => 'utf8', |
| 115 | 'dbcollat' => 'utf8_general_ci', |
| 116 | 'swap_pre' => '', |
| 117 | 'autoinit' => TRUE, |
Andrey Andreev | 2f8bf9b | 2012-10-12 20:37:52 +0300 | [diff] [blame] | 118 | 'encrypt' => FALSE, |
| 119 | 'compress' => FALSE, |
Timothy Warren | d294a58 | 2012-04-04 13:28:39 -0400 | [diff] [blame] | 120 | 'stricton' => FALSE, |
Andrey Andreev | 1c8245a | 2014-01-20 10:28:20 +0200 | [diff] [blame] | 121 | 'failover' => array(), |
| 122 | 'save_queries' => TRUE |
Timothy Warren | d294a58 | 2012-04-04 13:28:39 -0400 | [diff] [blame] | 123 | ); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 124 | |
| 125 | /* End of file database.php */ |
Derek Jones | f0b3994 | 2010-03-25 10:08:20 -0500 | [diff] [blame] | 126 | /* Location: ./application/config/database.php */ |