summaryrefslogtreecommitdiffstats
path: root/user_guide
diff options
context:
space:
mode:
Diffstat (limited to 'user_guide')
-rw-r--r--user_guide/changelog.html45
-rw-r--r--user_guide/database/active_record.html26
-rw-r--r--user_guide/general/creating_libraries.html8
-rw-r--r--user_guide/general/credits.html3
-rw-r--r--user_guide/general/environments.html10
-rw-r--r--user_guide/helpers/captcha_helper.html2
-rw-r--r--user_guide/installation/upgrade_201.html26
-rw-r--r--user_guide/libraries/input.html12
-rw-r--r--user_guide/libraries/javascript.html2
-rw-r--r--user_guide/libraries/loader.html7
10 files changed, 122 insertions, 19 deletions
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index 69dc676e6..d34f5c8f0 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -59,16 +59,57 @@ Change Log
<p>The <img src="images/reactor-bullet.png" width="16" height="16" alt="Reactor Marker" /> indicates items that were contributed to CodeIgniter via CodeIgniter Reactor.</p>
-<h2>Version 2.0.1</h2>
+<h2>Version 2.0.2</h2>
<p>Release Date: n/a<br />
Hg Tag: n/a</p>
<ul>
<li>General changes
<ul>
+ <li>The <a href="./libraries/security.html">Security library</a> was moved to the core and is now loaded automatically. Please remove your loading calls.</li>
+ <li>The CI_SHA class is now deprecated. All supported versions of PHP provide a <kbd>sha1()</kbd> function.</li>
+ <li class="reactor"><kbd>constants.php</kbd> will now be loaded from the environment folder if available.</li>
+ <li class="reactor">Added language key error logging</li>
+ <li class="reactor">Made Environment Support optional. Comment out or delete the constant to stop environment checks.</li>
+ <li class="reactor">Added Environment Support for Hooks.</li>
+ <li class="reactor">Added CI_ Prefix to the <a href="libraries/caching.html">Cache driver</a>.</li>
+ </ul>
+ </li>
+ <li>Helpers
+ <ul>
+ <li>Removed the previously deprecated <kbd>dohash()</kbd> from the <a href="./helpers/security_helper.html">Security helper</a>; use <kbd>do_hash()</kbd> instead.</li>
+ <li class="reactor">Changed the 'plural' function so that it doesn't ruin the captalization of your string. It also take into consideration acronyms which are all caps.</li>
+ </ul>
+ </li>
+ <li>Database
+ <ul>
+ <li class="reactor"><kbd>$this->db->count_all_results()</kbd> will now return an integer instead of a string.</li>
+ </ul>
+ </li>
+</ul>
+
+<h3>Bug fixes for 2.0.2</h3>
+<ul>
+ <li class="reactor">Fixed a bug (Reactor #145) where the Output Library had parse_exec_vars set to protected.</li>
+ <li class="reactor">Fixed a bug (Reactor #80) where is_really_writable would create an empty file when on Windows or with safe_mode enabled.</li>
+ <li class="reactor">Fixed various bugs with User Guide.</li>
+ <li class="reactor">Added is_cli_request() method to documentation for <a href="libraries/input.html">Input class</a>.</li>
+ <li class="reactor">Added form_validation_lang entries for <kbd>decimal</kbd>, <kbd>less_than</kbd> and <kbd>greater_than</kbd>.</li>
+ <li class="reactor"><a href="https://bitbucket.org/ellislab/codeigniter-reactor/issue/153/escape-str-bug-in-mssql-driver">Fixed issue #153</a> Escape Str Bug in MSSQL driver.</li>
+ <li class="reactor"><a href="https://bitbucket.org/ellislab/codeigniter-reactor/issue/172/bug-in-chrome-and-form_open-in-201">Fixed issue #172</a> Google Chrome 11 posts incorrectly when action is empty.</li>
+
+</ul>
+
+<h2>Version 2.0.1</h2>
+<p>Release Date: March, 15, 2011<br />
+Hg Tag: v2.0.1</p>
+
+<ul>
+ <li>General changes
+ <ul>
<li>Added <kbd>$config['cookie_secure']</kbd> to the config file to allow requiring a secure (HTTPS) in order to set cookies.</li>
<li class="reactor">Added the constant <kbd>CI_CORE</kbd> to help differentiate between Core: TRUE and Reactor: FALSE.</li>
- <li class="reactor">Added an <kbd>ENVIRONMENT</kbd> constant in index.php, which affects PHP error reporting settings, and optionally,
+ <li class="reactor">Added an <kbd>ENVIRONMENT</kbd> constant in index.php, which affects PHP error reporting settings, and optionally,
which configuration files are loaded (see below). Read more on the <a href="general/environments.html">Handling Environments</a> page.</li>
<li class="reactor">Added support for <a href="libraries/config.html#environments">environment-specific</a> configuration files.</li>
</ul>
diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html
index 812deb90c..64596e271 100644
--- a/user_guide/database/active_record.html
+++ b/user_guide/database/active_record.html
@@ -517,7 +517,7 @@ $this->db->insert('mytable', $object);
<br /><br />
// Produces: INSERT INTO mytable (title, content, date) VALUES ('My Title', 'My Content', 'My Date')</code>
-<p>The first parameter will contain the table name, the second is an associative array of values.</p>
+<p>The first parameter will contain the table name, the second is an object.</p>
<p class="important"><strong>Note:</strong> All values are escaped automatically producing safer queries.</p>
@@ -545,6 +545,30 @@ $this->db->insert_batch('mytable', $data);
<p>The first parameter will contain the table name, the second is an associative array of values.</p>
+<h2>$this->db->insert_batch();</h2>
+<p>Generates an insert string based on the data you supply, and runs the query. You can either pass an
+<strong>array</strong> or an <strong>object</strong> to the function. Here is an example using an array:</p>
+
+<code>
+$data = array(<br/>
+&nbsp;&nbsp;&nbsp;array(<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'title' => 'My title' ,<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'name' => 'My Name' ,<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'date' => 'My date'<br />
+&nbsp;&nbsp;&nbsp;),<br />
+&nbsp;&nbsp;&nbsp;array(<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'title' => 'Another title' ,<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'name' => 'Another Name' ,<br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'date' => 'Another date'<br />
+&nbsp;&nbsp;&nbsp;)<br/>
+);<br />
+<br />
+$this->db->update_batch('mytable', $data);
+<br /><br />
+// Produces: INSERT INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date'), ('Another title', 'Another name', 'Another date')</code>
+
+<p>The first parameter will contain the table name, the second is an associative array of values.</p>
+
<p class="important"><strong>Note:</strong> All values are escaped automatically producing safer queries.</p>
diff --git a/user_guide/general/creating_libraries.html b/user_guide/general/creating_libraries.html
index 3aedd723f..6d65f6599 100644
--- a/user_guide/general/creating_libraries.html
+++ b/user_guide/general/creating_libraries.html
@@ -101,11 +101,11 @@ they are initialized.</p>
<br /><br />
class Someclass {<br />
<br />
-&nbsp;&nbsp;&nbsp;&nbsp;function some_function()<br />
+&nbsp;&nbsp;&nbsp;&nbsp;public function some_function()<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}<br /><br />
-?&gt;</code>
+/* End of file Someclass.php */</code>
<h2>Using Your Class</h2>
@@ -140,7 +140,7 @@ $this->load->library('Someclass', <kbd>$params</kbd>);</code>
<br />
class Someclass {<br />
<br />
-&nbsp;&nbsp;&nbsp;&nbsp;function __construct($params)<br />
+&nbsp;&nbsp;&nbsp;&nbsp;public function __construct($params)<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Do something with $params<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
@@ -243,7 +243,7 @@ class MY_Email extends CI_Email {<br /><br />
<code>
class MY_Email extends CI_Email {<br />
<br />
-&nbsp;&nbsp;&nbsp;&nbsp;function __construct()<br />
+&nbsp;&nbsp;&nbsp;&nbsp;public function __construct()<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent::__construct();<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
diff --git a/user_guide/general/credits.html b/user_guide/general/credits.html
index 7977956a8..e64a74558 100644
--- a/user_guide/general/credits.html
+++ b/user_guide/general/credits.html
@@ -62,7 +62,8 @@ Credits
world, with many of the class libraries, helpers, and sub-systems borrowed from the code-base of
<a href="http://www.expressionengine.com/">ExpressionEngine</a>.</p>
-<p>It is currently developed and maintained by the ExpressionEngine Development Team.</p>
+<p>It is currently developed and maintained by the ExpressionEngine Development Team.<br />
+Bleeding edge development is spearheaded by the handpicked contributors of the Reactor Team.</p>
<p>A hat tip goes to Ruby on Rails for inspiring us to create a PHP framework, and for
bringing frameworks into the general consciousness of the web community.</p>
diff --git a/user_guide/general/environments.html b/user_guide/general/environments.html
index 690c14c2c..76fe214bc 100644
--- a/user_guide/general/environments.html
+++ b/user_guide/general/environments.html
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Creating Libraries : CodeIgniter User Guide</title>
+<title>Handling Multiple Environments : CodeIgniter User Guide</title>
<style type='text/css' media='all'>@import url('../userguide.css');</style>
<link rel='stylesheet' type='text/css' media='all' href='../userguide.css' />
@@ -28,7 +28,7 @@
<div id="masthead">
<table cellpadding="0" cellspacing="0" border="0" style="width:100%">
<tr>
-<td><h1>CodeIgniter User Guide Version 2.0.0</h1></td>
+<td><h1>CodeIgniter User Guide Version 2.0.1</h1></td>
<td id="breadcrumb_right"><a href="../toc.html">Table of Contents Page</a></td>
</tr>
</table>
@@ -42,7 +42,7 @@
<td id="breadcrumb">
<a href="http://codeigniter.com/">CodeIgniter Home</a> &nbsp;&#8250;&nbsp;
<a href="../index.html">User Guide Home</a> &nbsp;&#8250;&nbsp;
-Creating Libraries
+Handling Multiple Environments
</td>
<td id="searchbox"><form method="get" action="http://www.google.com/search"><input type="hidden" name="as_sitesearch" id="as_sitesearch" value="codeigniter.com/user_guide/" />Search User Guide&nbsp; <input type="text" class="input" style="width:200px;" name="q" id="q" size="31" maxlength="255" value="" />&nbsp;<input type="submit" class="submit" name="sa" value="Go" /></form></td>
</tr>
@@ -113,11 +113,11 @@ define('<var>ENVIRONMENT</var>', '<var>development</var>');
<div id="footer">
<p>
-Previous Topic:&nbsp;&nbsp;<a href="libraries.html">Using CodeIgniter Libraries</a>
+Previous Topic:&nbsp;&nbsp;<a href="managing_apps.html">Managing Applications</a>
&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
<a href="#top">Top of Page</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
<a href="../index.html">User Guide Home</a>&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;
-Next Topic:&nbsp;&nbsp;<a href="drivers.html">Using CodeIgniter Drivers</a>
+Next Topic:&nbsp;&nbsp;<a href="alternative_php.html">Alternative PHP Syntax</a>
</p>
<p><a href="http://codeigniter.com">CodeIgniter</a> &nbsp;&middot;&nbsp; Copyright &#169; 2006 - 2011 &nbsp;&middot;&nbsp; <a href="http://ellislab.com/">EllisLab, Inc.</a></p>
</div>
diff --git a/user_guide/helpers/captcha_helper.html b/user_guide/helpers/captcha_helper.html
index ab684f3d9..5169b06b3 100644
--- a/user_guide/helpers/captcha_helper.html
+++ b/user_guide/helpers/captcha_helper.html
@@ -167,7 +167,7 @@ $expiration = time()-7200; // Two hour limit<br />
$this-&gt;db-&gt;query(&quot;DELETE FROM captcha WHERE captcha_time &lt; &quot;.$expiration); <br />
<br />
// Then see if a captcha exists:<br />
-$sql = &quot;SELECT COUNT(*) AS count FROM captcha WHERE word = ? AND ip_address = ? AND date &gt; ?&quot;;<br />
+$sql = &quot;SELECT COUNT(*) AS count FROM captcha WHERE word = ? AND ip_address = ? AND captcha_time &gt; ?&quot;;<br />
$binds = array($_POST[&#x27;captcha&#x27;], $this-&gt;input-&gt;ip_address(), $expiration);<br />
$query = $this-&gt;db-&gt;query($sql, $binds);<br />
$row = $query-&gt;row();<br />
diff --git a/user_guide/installation/upgrade_201.html b/user_guide/installation/upgrade_201.html
index eba87f95a..9c72cf423 100644
--- a/user_guide/installation/upgrade_201.html
+++ b/user_guide/installation/upgrade_201.html
@@ -66,10 +66,36 @@ Upgrading from 2.0.0 to 2.0.1
<p class="important"><strong>Note:</strong> If you have any custom developed files in these folders please make copies of them first.</p>
+
<h2>Step 2: Replace config/mimes.php</h2>
<p>This config file has been updated to contain more mime types, please copy it to <kbd>application/config/mimes.php</kbd>.</p>
+
+<h2>Step 3: Remove loading calls for the Security Library</h2>
+
+<p>Security has been moved to the core and is now always loaded automatically. Make sure you remove any loading calls as they will result in PHP errors.</p>
+
+
+<h2>Step 4: Move MY_Security</h2>
+
+<p>If you are overriding or extending the Security library, you will need to move it to <kbd>application/core</kbd>.</p>
+
+
+<h2>Step 5: Check for forms posting to default controller</h2>
+
+<p>
+ The default behavior for <kbd>form_open()</kbd> when called with no parameters used to be to post to the default controller, but it will now just leave an empty action="" meaning the form will submit to the current URL.
+ If submitting to the default controller was the expected behavior it will need to be changed from:
+</p>
+
+<code>echo form_open(); //&lt;form action="" method="post" accept-charset="utf-8"></code>
+
+<p>to use either a / or <kbd>base_url()</kbd>:</p>
+
+<code>echo form_open('/'); //&lt;form action="http://example.com/index.php/" method="post" accept-charset="utf-8"><br/>
+echo form_open(base_url()); //&lt;form action="http://example.com/" method="post" accept-charset="utf-8"></code>
+
</div>
<!-- END CONTENT -->
diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html
index 479e71bf7..b34938b13 100644
--- a/user_guide/libraries/input.html
+++ b/user_guide/libraries/input.html
@@ -217,17 +217,17 @@ zero the cookie will only last as long as the browser is open.</p>
<code>$this->input->set_cookie($name, $value, $expire, $domain, $path, $prefix, $secure);</code>
-<h2>$this->input->get_cookie()</h2>
+<h2>$this->input->cookie()</h2>
<p>Lets you fetch a cookie. The first parameter will contain the name of the cookie you are looking for (including any prefixes):</p>
-<code>get_cookie('some_cookie');</code>
+<code>cookie('some_cookie');</code>
<p>The function returns FALSE (boolean) if the item you are attempting to retrieve does not exist.</p>
<p>The second optional parameter lets you run the data through the XSS filter. It's enabled by setting the second parameter to boolean TRUE;</p>
-<p><code>get_cookie('some_cookie', TRUE);</code></p>
+<p><code>cookie('some_cookie', TRUE);</code></p>
<h2>$this->input->ip_address()</h2>
@@ -269,7 +269,11 @@ else<br />
<h2>$this->input->is_ajax_request()</h2>
<p>Checks to see if the <var>HTTP_X_REQUESTED_WITH</var> server header has been set, and returns a boolean response.</p>
-<code>$this->input->is_ajax_request()</code>
+
+<h2>$this->input->is_cli_request()</h2>
+<p>Checks to see if the <var>STDIN</var> constant is set, which is a failsafe way to see if PHP is being run on the command line.</p>
+
+<code>$this->input->is_cli_request()</code>
</div>
diff --git a/user_guide/libraries/javascript.html b/user_guide/libraries/javascript.html
index faa84174d..c1fd1fa56 100644
--- a/user_guide/libraries/javascript.html
+++ b/user_guide/libraries/javascript.html
@@ -147,7 +147,7 @@ $this->jquery->effect('bounce');
<p><code> $this-&gt;jquery-&gt;animate(target, parameters, optional speed, optional extra information);</code></p>
<ul>
<li>&quot;target&quot; will be any valid jQuery selector or selectors.</li>
- <li>&quot;paramters&quot; in jQuery would generally include a series of CSS properties that you wish to change.</li>
+ <li>&quot;parameters&quot; in jQuery would generally include a series of CSS properties that you wish to change.</li>
<li>&quot;speed&quot; is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.</li>
<li>&quot;extra information&quot; is optional, and could include a callback, or other additional information.</li>
</ul>
diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html
index 7da087a43..62a250482 100644
--- a/user_guide/libraries/loader.html
+++ b/user_guide/libraries/loader.html
@@ -90,6 +90,10 @@ For example, if you have file located at:</p>
<p>You may nest the file in as many subdirectories as you want.</p>
+<p>Additionally, multiple libraries can be loaded at the same time by passing an array of libraries to the load function.</p>
+
+<code>$this->load->library(array('<var>email</var>', '<var>table</var>'));</code>
+
<h3>Setting options</h3>
<p>The second (optional) parameter allows you to optionally pass configuration setting. You will typically pass these as an array:</p>
@@ -105,6 +109,8 @@ $this->load->library('email', $config);</code>
<p>Config options can usually also be set via a config file. Each library is explained in detail in its own page, so please read the information regarding each one you would like to use.</p>
+<p>Please take note, when multiple libraries are supplied in an array for the first parameter, each will receive the same parameter information.</p>
+
<h3>Assigning a Library to a different object name</h3>
<p>If the third (optional) parameter is blank, the library will usually be assigned to an object with the same name as the library. For example, if the library is named <dfn>Session</dfn>, it
@@ -120,6 +126,7 @@ $this->my_session
</code>
+<p>Please take note, when multiple libraries are supplied in an array for the first parameter, this parameter is discarded.</p>
<h2>$this->load->view('<var>file_name</var>', <samp>$data</samp>, <kbd>true/false</kbd>)</h2>