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 | * |
| 7 | * NOTICE OF LICENSE |
Andrey Andreev | e734b38 | 2012-03-26 13:42:36 +0300 | [diff] [blame] | 8 | * |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 9 | * Licensed under the Academic Free License version 3.0 |
Andrey Andreev | e734b38 | 2012-03-26 13:42:36 +0300 | [diff] [blame] | 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 |
darwinel | 871754a | 2014-02-11 17:34:57 +0100 | [diff] [blame] | 21 | * @copyright Copyright (c) 2008 - 2014, 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 | */ |
darwinel | d8bef8a | 2014-02-11 20:13:22 +0100 | [diff] [blame] | 27 | defined('BASEPATH') OR exit('No direct script access allowed'); |
| 28 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 29 | /* |
| 30 | | ------------------------------------------------------------------- |
| 31 | | DATABASE CONNECTIVITY SETTINGS |
| 32 | | ------------------------------------------------------------------- |
| 33 | | This file will contain the settings needed to access your database. |
| 34 | | |
Derek Allard | b76fedd | 2010-08-12 16:14:10 -0400 | [diff] [blame] | 35 | | For complete instructions please consult the 'Database Connection' |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 36 | | page of the User Guide. |
| 37 | | |
| 38 | | ------------------------------------------------------------------- |
| 39 | | EXPLANATION OF VARIABLES |
| 40 | | ------------------------------------------------------------------- |
| 41 | | |
Taufan Aditya | 0142f70 | 2012-02-09 16:10:49 +0700 | [diff] [blame] | 42 | | ['dsn'] The full DSN string describe a connection to the database. |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 43 | | ['hostname'] The hostname of your database server. |
| 44 | | ['username'] The username used to connect to the database |
| 45 | | ['password'] The password used to connect to the database |
| 46 | | ['database'] The name of the database you want to connect to |
Andrey Andreev | 2608687 | 2012-07-05 11:21:58 +0300 | [diff] [blame] | 47 | | ['dbdriver'] The database driver. e.g.: mysqli. |
Andrey Andreev | 2f8bf9b | 2012-10-12 20:37:52 +0300 | [diff] [blame] | 48 | | Currently supported: |
Andrey Andreev | 2608687 | 2012-07-05 11:21:58 +0300 | [diff] [blame] | 49 | | cubrid, ibase, mssql, mysql, mysqli, oci8, |
Timothy Warren | 43481d0 | 2012-04-17 09:17:40 -0400 | [diff] [blame] | 50 | | odbc, pdo, postgre, sqlite, sqlite3, sqlsrv |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 51 | | ['dbprefix'] You can add an optional prefix, which will be added |
Jamie Rumbelow | 7efad20 | 2012-02-19 12:37:00 +0000 | [diff] [blame] | 52 | | to the table name when using the Query Builder class |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 53 | | ['pconnect'] TRUE/FALSE - Whether to use a persistent connection |
| 54 | | ['db_debug'] TRUE/FALSE - Whether database errors should be displayed. |
| 55 | | ['cache_on'] TRUE/FALSE - Enables/disables query caching |
| 56 | | ['cachedir'] The path to the folder where cache files should be stored |
| 57 | | ['char_set'] The character set used in communicating with the database |
| 58 | | ['dbcollat'] The character collation used in communicating with the database |
Derek Jones | 6ae70cc | 2011-04-19 16:13:48 -0500 | [diff] [blame] | 59 | | NOTE: For MySQL and MySQLi databases, this setting is only used |
Derek Jones | 3b9f88d | 2011-05-20 10:25:13 -0500 | [diff] [blame] | 60 | | as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7 |
| 61 | | (and in table creation queries made with DB Forge). |
Derek Jones | 6ae70cc | 2011-04-19 16:13:48 -0500 | [diff] [blame] | 62 | | There is an incompatibility in PHP with mysql_real_escape_string() which |
| 63 | | can make your site vulnerable to SQL injection if you are using a |
| 64 | | multi-byte character set and are running versions lower than these. |
| 65 | | 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] | 66 | | ['swap_pre'] A default table prefix that should be swapped with the dbprefix |
| 67 | | ['autoinit'] Whether or not to automatically initialize the database. |
Andrey Andreev | 2f8bf9b | 2012-10-12 20:37:52 +0300 | [diff] [blame] | 68 | | ['encrypt'] Whether or not to use an encrypted connection. |
| 69 | | ['compress'] Whether or not to use client compression (MySQL only) |
Derek Allard | b76fedd | 2010-08-12 16:14:10 -0400 | [diff] [blame] | 70 | | ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections |
Derek Jones | c34e578 | 2010-03-02 17:35:55 -0600 | [diff] [blame] | 71 | | - good for ensuring strict SQL while developing |
Felix Balfoort | 5d581b6 | 2011-11-29 15:53:01 +0100 | [diff] [blame] | 72 | | ['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] | 73 | | ['save_queries'] TRUE/FALSE - Whether to "save" all executed queries. |
| 74 | | NOTE: Disabling this will also effectively disable both |
| 75 | | $this->db->last_query() and profiling of DB queries. |
| 76 | | When you run a query, with this setting set to TRUE (default), |
| 77 | | CodeIgniter will store the SQL statement for debugging purposes. |
| 78 | | However, this may cause high memory usage, especially if you run |
| 79 | | a lot of SQL queries ... disable this to avoid that problem. |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 80 | | |
| 81 | | The $active_group variable lets you choose which connection group to |
Derek Jones | 37f4b9c | 2011-07-01 17:56:50 -0500 | [diff] [blame] | 82 | | make active. By default there is only one group (the 'default' group). |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 83 | | |
Jamie Rumbelow | 7efad20 | 2012-02-19 12:37:00 +0000 | [diff] [blame] | 84 | | The $query_builder variables lets you determine whether or not to load |
Andrey Andreev | 2f8bf9b | 2012-10-12 20:37:52 +0300 | [diff] [blame] | 85 | | the query builder class. |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 86 | */ |
| 87 | |
Derek Allard | b76fedd | 2010-08-12 16:14:10 -0400 | [diff] [blame] | 88 | $active_group = 'default'; |
Jamie Rumbelow | 7efad20 | 2012-02-19 12:37:00 +0000 | [diff] [blame] | 89 | $query_builder = TRUE; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 90 | |
Timothy Warren | d294a58 | 2012-04-04 13:28:39 -0400 | [diff] [blame] | 91 | $db['default'] = array( |
| 92 | 'dsn' => '', |
| 93 | 'hostname' => 'localhost', |
| 94 | 'username' => '', |
| 95 | 'password' => '', |
| 96 | 'database' => '', |
| 97 | 'dbdriver' => 'mysqli', |
| 98 | 'dbprefix' => '', |
Andrey Andreev | 47a47fb | 2014-05-31 16:08:30 +0300 | [diff] [blame^] | 99 | 'pconnect' => FALSE, |
Timothy Warren | d294a58 | 2012-04-04 13:28:39 -0400 | [diff] [blame] | 100 | 'db_debug' => TRUE, |
| 101 | 'cache_on' => FALSE, |
| 102 | 'cachedir' => '', |
| 103 | 'char_set' => 'utf8', |
| 104 | 'dbcollat' => 'utf8_general_ci', |
| 105 | 'swap_pre' => '', |
| 106 | 'autoinit' => TRUE, |
Andrey Andreev | 2f8bf9b | 2012-10-12 20:37:52 +0300 | [diff] [blame] | 107 | 'encrypt' => FALSE, |
| 108 | 'compress' => FALSE, |
Timothy Warren | d294a58 | 2012-04-04 13:28:39 -0400 | [diff] [blame] | 109 | 'stricton' => FALSE, |
Andrey Andreev | 1c8245a | 2014-01-20 10:28:20 +0200 | [diff] [blame] | 110 | 'failover' => array(), |
| 111 | 'save_queries' => TRUE |
Timothy Warren | d294a58 | 2012-04-04 13:28:39 -0400 | [diff] [blame] | 112 | ); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 113 | |
| 114 | /* End of file database.php */ |
Derek Jones | f0b3994 | 2010-03-25 10:08:20 -0500 | [diff] [blame] | 115 | /* Location: ./application/config/database.php */ |