The usage of this function is identical to add_column(), except it alters an existing column rather than adding a new one. In order to use it you must add a "name" key into the field defining array.
+
The usage of this function is identical to add_column(), except it alters an existing column rather than adding a new one. In order to change the name you can add a "name" key into the field defining array.
$fields = array(
'old_name' => array(
'name' => 'new_name',
--
cgit v1.2.3-24-g4f1b
From 4df8b2276bbcc7f025a41b0d09f2f8cd7927b51a Mon Sep 17 00:00:00 2001
From: Phil Sturgeon
Date: Wed, 15 Dec 2010 14:23:14 +0000
Subject: ['base_url'] is now empty by default and will guess what
it should be.
---
user_guide/changelog.html | 4 ++++
1 file changed, 4 insertions(+)
(limited to 'user_guide')
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index c3693e5f9..30734a835 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -76,6 +76,10 @@ Hg Tag:
CodeIgniter features wrappers around some of the most popular forms of fast and dynamic caching. All but file-based caching require specific server requirements, and a Fatal Exception will be thrown if server requirements are not met.
The following example will load the cache driver, specify APC as the driver to use, and fall back to file-based caching if APC is not available in the hosting environment.
+
+
+$this->load->driver('cache', array('adapter' => 'apc', 'backup' => 'file'));
+
+if ( ! $foo = $this->cache->get('foo'))
+{
+ echo 'Saving to the cache!<br />';
+ $foo = 'foobarbaz!';
+
+ // Save into the cache for 5 minutes
+ $this->cache->save('foo', $foo, 300);
+}
+
+echo $foo;
+
+
+
Function Reference
+
+
is_supported(driver['string'])
+
+
This function is automatically called when accessing drivers via $this->cache->get(). However, if the individual drivers are used, make sure to call this function to ensure the driver is supported in the hosting environment.
Unlike caching from the Output Class, the driver file-based caching allows for pieces of view files to be cached. Use this with care, and make sure to benchmark your application, as a point can come where disk I/O will negate positive gains by caching.
+
+
All of the functions listed above can be accessed without passing a specific adapter to the driver loader as follows:
This is a caching backend that will always 'miss.' It stores no data, but lets you keep your caching code in place in environments that don't support your chosen cache.
+
+
+
+
+
+
+
+
+
\ No newline at end of file
--
cgit v1.2.3-24-g4f1b
From 5808bad28e58f8b534f1fc269c7713351a7b6845 Mon Sep 17 00:00:00 2001
From: Eric Barnes
Date: Mon, 27 Dec 2010 13:51:10 -0500
Subject: Fixed version in file uploading docs. Fixes: #255
---
user_guide/libraries/file_uploading.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'user_guide')
diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html
index 00bc0c076..54725d035 100644
--- a/user_guide/libraries/file_uploading.html
+++ b/user_guide/libraries/file_uploading.html
@@ -28,7 +28,7 @@
--
cgit v1.2.3-24-g4f1b
From 2e3b0a958fdf236e17b8e3cc6c5f42ea7e873d85 Mon Sep 17 00:00:00 2001
From: Eric Barnes
Date: Tue, 28 Dec 2010 10:33:48 -0500
Subject: js and css was loaded via absolute url instead of pointing relative.
Fixes #289
---
user_guide/libraries/table.html | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
(limited to 'user_guide')
diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html
index 574110807..094d7aac6 100644
--- a/user_guide/libraries/table.html
+++ b/user_guide/libraries/table.html
@@ -4,12 +4,12 @@
CodeIgniter User Guide : HTML Table Class
-
+
-
-
-
-
+
+
+
+
--
cgit v1.2.3-24-g4f1b
From 6113f5462c5801964b12a95e62922606aa258808 Mon Sep 17 00:00:00 2001
From: Eric Barnes
Date: Wed, 29 Dec 2010 13:36:12 -0500
Subject: Changed email library to allow setting different user-agent. Fixes
#286
---
user_guide/changelog.html | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'user_guide')
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index 30734a835..09efc5434 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -171,6 +171,7 @@ Hg Tag:
Bug fixes for 2.0.0
+
Fixed a bug where you could not change the User-Agent when sending email.
Fixed a bug where the Output class would send incorrect cached output for controllers implementing their own _output() method.
Fixed a bug where a failed query would not have a saved query execution time causing errors in the Profiler
Fixed a bug that was writing log entries when multiple identical helpers and plugins were loaded.
@@ -750,7 +751,7 @@ Hg Tag: 1.6.1
-
+
Documentation Changes
Added Writing Documentation section for the community to use in writing their own documentation.
--
cgit v1.2.3-24-g4f1b
From dac1b468d5432ff9166fe221ac520b5050a65f0e Mon Sep 17 00:00:00 2001
From: Phil Sturgeon
Date: Thu, 6 Jan 2011 17:40:10 +0000
Subject: Altered User agent library so that is_browser(), is_mobile() and
is_robot() can optionally check for a specific browser or mobile device.
---
user_guide/changelog.html | 1 +
user_guide/libraries/user_agent.html | 25 +++++++++++++++++++++++++
2 files changed, 26 insertions(+)
(limited to 'user_guide')
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index 09efc5434..a6332d64d 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -113,6 +113,7 @@ Hg Tag:
Altered Form_Validation library to allow for method chaining on set_rules(), set_message() and set_error_delimiters() functions.
Altered Email Library to allow for method chaining.
Added request_headers(), get_request_header() and is_ajax_request() to the input class.
+
Altered User agent library so that is_browser(), is_mobile() and is_robot() can optionally check for a specific browser or mobile device.
Returns TRUE/FALSE (boolean) if the user agent is a known web browser.
+ if ($this->agent->is_browser('Safari'))
+{
+ echo 'You are using Safari.';
+}
+else if ($this->agent->is_browser())
+{
+ echo 'You are using a browser.';
+}
+
+
Note: The string "Safari" in this example is an array key in the list of browser definitions.
+You can find this list in application/config/user_agents.php if you want to add new browsers or change the stings.
+
$this->agent->is_mobile()
Returns TRUE/FALSE (boolean) if the user agent is a known mobile device.
+ if ($this->agent->is_mobile('iphone'))
+{
+ $this->load->view('iphone/home');
+}
+else if ($this->agent->is_mobile())
+{
+ $this->load->view('mobile/home');
+}
+else
+{
+ $this->load->view('web/home');
+}
+
$this->agent->is_robot()
Returns TRUE/FALSE (boolean) if the user agent is a known robot.
--
cgit v1.2.3-24-g4f1b
From f85a4b897b9dfce3de315f307f6fe07606b95131 Mon Sep 17 00:00:00 2001
From: Derek Allard
Date: Thu, 13 Jan 2011 06:52:21 -0500
Subject: Updating references to deprecated functions in the active record
documentation
---
user_guide/database/active_record.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'user_guide')
diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html
index 065db4913..9ae93a9ae 100644
--- a/user_guide/database/active_record.html
+++ b/user_guide/database/active_record.html
@@ -736,7 +736,7 @@ $this->db->get('tablename');
//Generates: SELECT `field2` FROM (`tablename`)
-
Note: The following statements can be cached: select, from, join, where, like, groupby, having, orderby, set
+
Note: The following statements can be cached: select, from, join, where, like, group_by, having, order_by, set
CodeIgniter has a config file that lets you store your database connection values (username, password, database name, etc.).
-The config file is located at:
-
-
application/config/database.php
+The config file is located at application/config/database.php. You can also set database connection values for specific environments by placing database.php it the respective environment config folder.
The config settings are stored in a multi-dimensional array with this prototype:
Where item_name is the $config array index you want to change, and item_value is its value.
+
Environments
+
+
You can set the environment of you application and load config items depending on the current environment. It also disables PHP from displaying errors in environments other than development. To set your environment, open index.php, located at the root and change the ENVIRONMENT constant. By default, there is support for a development, test and production environment.
+
+
+define('ENVIRONMENT', 'development');
+
+
+
To make a config file environment-aware, copy the file from application/config/ to application/config/development/, depending on the environment the config file belongs to. You can place the following configuration files in environment folders:
+
+
+
Default config files
+
Database config files
+
Custom config files
+
+
+
Note: CodeIgniter always tries to load the config file for the current environment first. If the file does not exist, the global config file (i.e. application/config/) is loaded. This means you are not obligated to place all your config files (but rather the files that change per environment) in an environment folder.