From ad1171a6797dc0054381327fb26a9e9e232a639e Mon Sep 17 00:00:00 2001
From: Derek Jones
Date: Wed, 10 Mar 2010 14:18:38 -0600
Subject: added swap_pre, autoinit, and stricton database configuration
explanations
---
system/application/config/database.php | 4 ++++
user_guide/changelog.html | 3 +++
user_guide/database/configuration.html | 15 ++++++++++++---
3 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/system/application/config/database.php b/system/application/config/database.php
index 28dfff5c9..fcdefda71 100644
--- a/system/application/config/database.php
+++ b/system/application/config/database.php
@@ -26,6 +26,8 @@
| ['cachedir'] The path to the folder where cache files should be stored
| ['char_set'] The character set used in communicating with the database
| ['dbcollat'] The character collation used in communicating with the database
+| ['swap_pre'] A default table prefix that should be swapped with the dbprefix
+| ['autoinit'] Whether or not to automatically initialize the database.
| ['stricton'] TRUE/FALSE - forces "Strict Mode" connections
| - good for ensuring strict SQL while developing
|
@@ -51,6 +53,8 @@ $db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";
+$db['default']['swap_pre'] = "";
+$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index 822f394a9..95b1e6ccd 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -89,6 +89,9 @@ Hg Tag:
Database
+ - Added swap_pre value to database configuration.
+ - Added autoinit value to database configuration.
+ - Added stricton value to database configuration.
- Added database_exists() to the Database Utilities Class.
- Semantic change to db->version() function to allow a list of exceptions for databases with functions to return version string instead of specially formed SQL queries. Currently this list only includes Oracle and SQLite.
- Fixed a bug where driver specific table identifier protection could lead to malformed queries in the field_data() functions.
diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html
index 4ef76ed14..1844aa057 100644
--- a/user_guide/database/configuration.html
+++ b/user_guide/database/configuration.html
@@ -78,7 +78,10 @@ $db['default']['db_debug'] = FALSE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
-$db['default']['dbcollat'] = "utf8_general_ci";
+$db['default']['dbcollat'] = "utf8_general_ci";
+$db['default']['swap_pre'] = "";
+$db['default']['autoinit'] = TRUE;
+$db['default']['stricton'] = FALSE;
The reason we use a multi-dimensional array rather than a more simple one is to permit you to optionally store
multiple sets of connection values. If, for example, you run multiple environments (development, production, test, etc.)
@@ -96,7 +99,10 @@ $db['test']['db_debug'] = FALSE;
$db['test']['cache_on'] = FALSE;
$db['test']['cachedir'] = "";
$db['test']['char_set'] = "utf8";
-$db['test']['dbcollat'] = "utf8_general_ci";
+$db['test']['dbcollat'] = "utf8_general_ci";
+$db['test']['swap_pre'] = "";
+$db['test']['autoinit'] = TRUE;
+$db['test']['stricton'] = FALSE;
Then, to globally tell the system to use that group you would set this variable located in the config file:
@@ -129,7 +135,10 @@ for the primary connection, but it too can be renamed to something more relevant
- cachedir - The absolute server path to your database query cache directory.
- char_set - The character set used in communicating with the database.
- dbcollat - The character collation used in communicating with the database.
-- port - The database port number. Currently only used with the Postgres driver. To use this value you have to add a line to the database config array.
$db['default']['port'] = 5432;
+- swap_pre - A default table prefix that should be swapped with dbprefix. This is useful for distributed applications where you might run manually written queries, and need the prefix to still be customizable by the end user.
+- autoinit - Whether or not to automatically initialize the database.
+- stricton - TRUE/FALSE (boolean) - Whether to force "Strict Mode" connections, good for ensuring strict SQL while developing an application.
+- port - The database port number. Currently only used with the Postgres driver. To use this value you have to add a line to the database config array.
$db['default']['port'] = 5432;
Note: Depending on what database platform you are using (MySQL, Postgres, etc.)
--
cgit v1.2.3-24-g4f1b