darwinel | d8bef8a | 2014-02-11 20:13:22 +0100 | [diff] [blame] | 1 | <?php |
darwinel | d8bef8a | 2014-02-11 20:13:22 +0100 | [diff] [blame] | 2 | defined('BASEPATH') OR exit('No direct script access allowed'); |
| 3 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 4 | /* |
| 5 | | ------------------------------------------------------------------- |
| 6 | | DATABASE CONNECTIVITY SETTINGS |
| 7 | | ------------------------------------------------------------------- |
| 8 | | This file will contain the settings needed to access your database. |
| 9 | | |
Derek Allard | b76fedd | 2010-08-12 16:14:10 -0400 | [diff] [blame] | 10 | | For complete instructions please consult the 'Database Connection' |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 11 | | page of the User Guide. |
| 12 | | |
| 13 | | ------------------------------------------------------------------- |
| 14 | | EXPLANATION OF VARIABLES |
| 15 | | ------------------------------------------------------------------- |
| 16 | | |
Taufan Aditya | 0142f70 | 2012-02-09 16:10:49 +0700 | [diff] [blame] | 17 | | ['dsn'] The full DSN string describe a connection to the database. |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 18 | | ['hostname'] The hostname of your database server. |
| 19 | | ['username'] The username used to connect to the database |
| 20 | | ['password'] The password used to connect to the database |
| 21 | | ['database'] The name of the database you want to connect to |
Andrey Andreev | 2608687 | 2012-07-05 11:21:58 +0300 | [diff] [blame] | 22 | | ['dbdriver'] The database driver. e.g.: mysqli. |
Andrey Andreev | 2f8bf9b | 2012-10-12 20:37:52 +0300 | [diff] [blame] | 23 | | Currently supported: |
Andrey Andreev | 2608687 | 2012-07-05 11:21:58 +0300 | [diff] [blame] | 24 | | cubrid, ibase, mssql, mysql, mysqli, oci8, |
Timothy Warren | 43481d0 | 2012-04-17 09:17:40 -0400 | [diff] [blame] | 25 | | odbc, pdo, postgre, sqlite, sqlite3, sqlsrv |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 26 | | ['dbprefix'] You can add an optional prefix, which will be added |
Jamie Rumbelow | 7efad20 | 2012-02-19 12:37:00 +0000 | [diff] [blame] | 27 | | to the table name when using the Query Builder class |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 28 | | ['pconnect'] TRUE/FALSE - Whether to use a persistent connection |
| 29 | | ['db_debug'] TRUE/FALSE - Whether database errors should be displayed. |
| 30 | | ['cache_on'] TRUE/FALSE - Enables/disables query caching |
| 31 | | ['cachedir'] The path to the folder where cache files should be stored |
| 32 | | ['char_set'] The character set used in communicating with the database |
| 33 | | ['dbcollat'] The character collation used in communicating with the database |
Derek Jones | 6ae70cc | 2011-04-19 16:13:48 -0500 | [diff] [blame] | 34 | | NOTE: For MySQL and MySQLi databases, this setting is only used |
Derek Jones | 3b9f88d | 2011-05-20 10:25:13 -0500 | [diff] [blame] | 35 | | as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7 |
| 36 | | (and in table creation queries made with DB Forge). |
Derek Jones | 6ae70cc | 2011-04-19 16:13:48 -0500 | [diff] [blame] | 37 | | There is an incompatibility in PHP with mysql_real_escape_string() which |
| 38 | | can make your site vulnerable to SQL injection if you are using a |
| 39 | | multi-byte character set and are running versions lower than these. |
| 40 | | 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] | 41 | | ['swap_pre'] A default table prefix that should be swapped with the dbprefix |
Andrey Andreev | 2f8bf9b | 2012-10-12 20:37:52 +0300 | [diff] [blame] | 42 | | ['encrypt'] Whether or not to use an encrypted connection. |
Andrey Andreev | 76e643e | 2015-07-16 13:14:49 +0300 | [diff] [blame] | 43 | | |
| 44 | | 'mysql' (deprecated), 'sqlsrv' and 'pdo/sqlsrv' drivers accept TRUE/FALSE |
Andrey Andreev | a38b0c4 | 2015-07-16 14:25:25 +0300 | [diff] [blame] | 45 | | 'mysqli' and 'pdo/mysql' drivers accept an array with the following options: |
Andrey Andreev | 76e643e | 2015-07-16 13:14:49 +0300 | [diff] [blame] | 46 | | |
| 47 | | 'ssl_key' - Path to the private key file |
| 48 | | 'ssl_cert' - Path to the public key certificate file |
| 49 | | 'ssl_ca' - Path to the certificate authority file |
Andrey Andreev | 23aa166 | 2017-10-09 10:57:57 +0300 | [diff] [blame] | 50 | | 'ssl_capath' - Path to a directory containing trusted CA certificates in PEM format |
Andrey Andreev | 0785e47 | 2015-07-16 13:41:55 +0300 | [diff] [blame] | 51 | | 'ssl_cipher' - List of *allowed* ciphers to be used for the encryption, separated by colons (':') |
Andrey Andreev | f1e13c0 | 2018-08-22 15:01:20 +0300 | [diff] [blame] | 52 | | 'ssl_verify' - TRUE/FALSE; Whether verify the server certificate or not |
Andrey Andreev | 76e643e | 2015-07-16 13:14:49 +0300 | [diff] [blame] | 53 | | |
Andrey Andreev | 2f8bf9b | 2012-10-12 20:37:52 +0300 | [diff] [blame] | 54 | | ['compress'] Whether or not to use client compression (MySQL only) |
Derek Allard | b76fedd | 2010-08-12 16:14:10 -0400 | [diff] [blame] | 55 | | ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections |
Derek Jones | c34e578 | 2010-03-02 17:35:55 -0600 | [diff] [blame] | 56 | | - good for ensuring strict SQL while developing |
Tim Nolte | 52ec825 | 2015-06-18 15:33:00 -0400 | [diff] [blame] | 57 | | ['ssl_options'] Used to set various SSL options that can be used when making SSL connections. |
Felix Balfoort | 5d581b6 | 2011-11-29 15:53:01 +0100 | [diff] [blame] | 58 | | ['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] | 59 | | ['save_queries'] TRUE/FALSE - Whether to "save" all executed queries. |
| 60 | | NOTE: Disabling this will also effectively disable both |
| 61 | | $this->db->last_query() and profiling of DB queries. |
| 62 | | When you run a query, with this setting set to TRUE (default), |
| 63 | | CodeIgniter will store the SQL statement for debugging purposes. |
| 64 | | However, this may cause high memory usage, especially if you run |
| 65 | | a lot of SQL queries ... disable this to avoid that problem. |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 66 | | |
| 67 | | The $active_group variable lets you choose which connection group to |
Derek Jones | 37f4b9c | 2011-07-01 17:56:50 -0500 | [diff] [blame] | 68 | | make active. By default there is only one group (the 'default' group). |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 69 | | |
Jamie Rumbelow | 7efad20 | 2012-02-19 12:37:00 +0000 | [diff] [blame] | 70 | | The $query_builder variables lets you determine whether or not to load |
Andrey Andreev | 2f8bf9b | 2012-10-12 20:37:52 +0300 | [diff] [blame] | 71 | | the query builder class. |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 72 | */ |
Luigi Santivetti | 7bab494 | 2019-06-16 07:40:53 +0000 | [diff] [blame] | 73 | $active_group = 'dev'; |
Jamie Rumbelow | 7efad20 | 2012-02-19 12:37:00 +0000 | [diff] [blame] | 74 | $query_builder = TRUE; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 75 | |
Luigi Santivetti | 7bab494 | 2019-06-16 07:40:53 +0000 | [diff] [blame] | 76 | $db['dev'] = array( |
| 77 | 'dsn' => '', |
| 78 | 'hostname' => getenv('MYSQL_HOSTNAME'), |
| 79 | 'username' => getenv('MYSQL_USER'), |
| 80 | 'password' => getenv('MYSQL_PASSWORD'), |
| 81 | 'database' => getenv('MYSQL_DATABASE'), |
| 82 | 'dbdriver' => 'mysqli', |
| 83 | 'dbprefix' => '', |
| 84 | 'pconnect' => FALSE, |
Luigi Santivetti | 57a98ca | 2020-10-13 22:55:51 +0100 | [diff] [blame^] | 85 | 'db_debug' => FALSE, |
Luigi Santivetti | 7bab494 | 2019-06-16 07:40:53 +0000 | [diff] [blame] | 86 | 'cache_on' => FALSE, |
| 87 | 'cachedir' => '', |
| 88 | 'char_set' => 'utf8', |
| 89 | 'dbcollat' => 'utf8_general_ci', |
| 90 | 'swap_pre' => '', |
Luigi Santivetti | 57a98ca | 2020-10-13 22:55:51 +0100 | [diff] [blame^] | 91 | 'encrypt' => [ |
| 92 | 'ssl_capath' => getenv('MYSQL_SSL_CAPATH'), |
| 93 | 'ssl_cert' => getenv('MYSQL_SSL_CERT'), |
| 94 | 'ssl_key' => getenv('MYSQL_SSL_KEY'), |
| 95 | 'ssl_ca' => getenv('MYSQL_SSL_CA'), |
| 96 | 'ssl_verify' => FALSE |
| 97 | ], |
Luigi Santivetti | 7bab494 | 2019-06-16 07:40:53 +0000 | [diff] [blame] | 98 | 'compress' => FALSE, |
| 99 | 'stricton' => FALSE, |
| 100 | 'failover' => array(), |
| 101 | 'save_queries' => TRUE |
| 102 | ); |
| 103 | |
Timothy Warren | d294a58 | 2012-04-04 13:28:39 -0400 | [diff] [blame] | 104 | $db['default'] = array( |
| 105 | 'dsn' => '', |
Luigi Santivetti | 57a98ca | 2020-10-13 22:55:51 +0100 | [diff] [blame^] | 106 | 'hostname' => getenv('MYSQL_HOSTNAME'), |
| 107 | 'username' => getenv('MYSQL_USER'), |
| 108 | 'password' => getenv('MYSQL_PASSWORD'), |
| 109 | 'database' => getenv('MYSQL_DATABASE'), |
Timothy Warren | d294a58 | 2012-04-04 13:28:39 -0400 | [diff] [blame] | 110 | 'dbdriver' => 'mysqli', |
| 111 | 'dbprefix' => '', |
Andrey Andreev | 47a47fb | 2014-05-31 16:08:30 +0300 | [diff] [blame] | 112 | 'pconnect' => FALSE, |
Andrey Andreev | 13e8db6 | 2015-05-27 15:01:55 +0300 | [diff] [blame] | 113 | 'db_debug' => (ENVIRONMENT !== 'production'), |
Timothy Warren | d294a58 | 2012-04-04 13:28:39 -0400 | [diff] [blame] | 114 | 'cache_on' => FALSE, |
| 115 | 'cachedir' => '', |
| 116 | 'char_set' => 'utf8', |
| 117 | 'dbcollat' => 'utf8_general_ci', |
| 118 | 'swap_pre' => '', |
Luigi Santivetti | 57a98ca | 2020-10-13 22:55:51 +0100 | [diff] [blame^] | 119 | 'encrypt' => [ |
| 120 | 'ssl_capath' => getenv('MYSQL_SSL_CAPATH'), |
| 121 | 'ssl_cert' => getenv('MYSQL_SSL_CERT'), |
| 122 | 'ssl_key' => getenv('MYSQL_SSL_KEY'), |
| 123 | 'ssl_ca' => getenv('MYSQL_SSL_CA'), |
| 124 | 'ssl_verify' => FALSE |
| 125 | ], |
Andrey Andreev | 2f8bf9b | 2012-10-12 20:37:52 +0300 | [diff] [blame] | 126 | 'compress' => FALSE, |
Timothy Warren | d294a58 | 2012-04-04 13:28:39 -0400 | [diff] [blame] | 127 | 'stricton' => FALSE, |
Andrey Andreev | 1c8245a | 2014-01-20 10:28:20 +0200 | [diff] [blame] | 128 | 'failover' => array(), |
| 129 | 'save_queries' => TRUE |
Timothy Warren | d294a58 | 2012-04-04 13:28:39 -0400 | [diff] [blame] | 130 | ); |