From 1f622294b92c095fd91e8ca44912d405c1605ded Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Thu, 7 Apr 2011 12:06:51 -0400 Subject: Wow, I screwed that up, Reactor is going to 2.0.2 not 2.0.1 --- user_guide/libraries/benchmark.html | 2 +- user_guide/libraries/caching.html | 2 +- user_guide/libraries/calendar.html | 2 +- user_guide/libraries/cart.html | 2 +- user_guide/libraries/config.html | 2 +- user_guide/libraries/email.html | 2 +- user_guide/libraries/encryption.html | 2 +- user_guide/libraries/file_uploading.html | 2 +- user_guide/libraries/form_validation.html | 2 +- user_guide/libraries/ftp.html | 2 +- user_guide/libraries/image_lib.html | 2 +- user_guide/libraries/input.html | 2 +- user_guide/libraries/javascript.html | 2 +- user_guide/libraries/language.html | 2 +- user_guide/libraries/loader.html | 2 +- user_guide/libraries/output.html | 2 +- user_guide/libraries/pagination.html | 2 +- user_guide/libraries/parser.html | 2 +- user_guide/libraries/security.html | 2 +- user_guide/libraries/sessions.html | 2 +- user_guide/libraries/table.html | 2 +- user_guide/libraries/trackback.html | 2 +- user_guide/libraries/typography.html | 2 +- user_guide/libraries/unit_testing.html | 2 +- user_guide/libraries/uri.html | 2 +- user_guide/libraries/user_agent.html | 2 +- user_guide/libraries/xmlrpc.html | 2 +- user_guide/libraries/zip.html | 2 +- 28 files changed, 28 insertions(+), 28 deletions(-) (limited to 'user_guide/libraries') diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index 3213a6790..c29acb7b2 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

diff --git a/user_guide/libraries/caching.html b/user_guide/libraries/caching.html index e04cf10b8..190232e4b 100644 --- a/user_guide/libraries/caching.html +++ b/user_guide/libraries/caching.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index 1222235c9..e1af71cc9 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

diff --git a/user_guide/libraries/cart.html b/user_guide/libraries/cart.html index c8d69d787..f084d5dcf 100644 --- a/user_guide/libraries/cart.html +++ b/user_guide/libraries/cart.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index 71c68332c..2433ec4ad 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index 357c01ff1..5a8814d59 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index b06adefc2..60099312c 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index 5e5117a9e..e4e842e5f 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index c72cfce1c..8fdcd1446 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -27,7 +27,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index 1c1ad73e9..43b949a50 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index 81ae09c6b..dbf07768e 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index b34938b13..08b8ab0d3 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

diff --git a/user_guide/libraries/javascript.html b/user_guide/libraries/javascript.html index c1fd1fa56..4e262279d 100644 --- a/user_guide/libraries/javascript.html +++ b/user_guide/libraries/javascript.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index fcc28262d..75863c2ac 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 62a250482..42f8cf94f 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index 3e18fa0d9..4d1f8d97a 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index 3db020adb..e86ec13cc 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index 1089f4056..cb2f100a2 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

diff --git a/user_guide/libraries/security.html b/user_guide/libraries/security.html index 6fbdf7744..735187459 100644 --- a/user_guide/libraries/security.html +++ b/user_guide/libraries/security.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 5243a83d6..600d301c9 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

diff --git a/user_guide/libraries/table.html b/user_guide/libraries/table.html index 28994aa69..eeb3b421f 100644 --- a/user_guide/libraries/table.html +++ b/user_guide/libraries/table.html @@ -27,7 +27,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

diff --git a/user_guide/libraries/trackback.html b/user_guide/libraries/trackback.html index 971b8f336..7f89b4f5e 100644 --- a/user_guide/libraries/trackback.html +++ b/user_guide/libraries/trackback.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

diff --git a/user_guide/libraries/typography.html b/user_guide/libraries/typography.html index 14725cd1a..895e76f7d 100644 --- a/user_guide/libraries/typography.html +++ b/user_guide/libraries/typography.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html index e68bc3fde..5e0c4c16b 100644 --- a/user_guide/libraries/unit_testing.html +++ b/user_guide/libraries/unit_testing.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

diff --git a/user_guide/libraries/uri.html b/user_guide/libraries/uri.html index 7b5887fa0..e4e0f9d3f 100644 --- a/user_guide/libraries/uri.html +++ b/user_guide/libraries/uri.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

diff --git a/user_guide/libraries/user_agent.html b/user_guide/libraries/user_agent.html index 2d303db3c..24e8071f3 100644 --- a/user_guide/libraries/user_agent.html +++ b/user_guide/libraries/user_agent.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index 53931aee7..5ba851341 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index 6cb0d195d..031126603 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

-- cgit v1.2.3-24-g4f1b From 3403366d0f457c1dd449076b4177d1aff5cb176c Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Mon, 18 Apr 2011 11:18:09 -0500 Subject: changeset: 2202:06a75a1bd622 tag: tip user: Greg Aker date: Mon Apr 18 11:10:37 2011 -0500 summary: Tweak to session class all_userdata() to just return the userdata array. Also documented previously undocumented all_userdata() method. --- user_guide/libraries/sessions.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'user_guide/libraries') diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 600d301c9..8d9c14eb6 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -170,6 +170,23 @@ having to run a database query when you need it.

Note: Cookies can only hold 4KB of data, so be careful not to exceed the capacity. The encryption process in particular produces a longer data string than the original so keep careful track of how much data you are storing.

+

Retrieving All Session Data

+

An array of all userdata can be retrieved as follows:

+$this->session->all_userdata() + +

And returns an associative array like the following:

+ +
+Array
+(
+    [session_id] => 4a5a5dca22728fb0a84364eeb405b601
+    [ip_address] => 127.0.0.1
+    [user_agent] => Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7;
+    [last_activity] => 1303142623
+)
+
+ +

Removing Session Data

Just as set_userdata() can be used to add information into a session, unset_userdata() can be used to remove it, by passing the session key. For example, if you wanted to remove 'some_name' from your session information:

$this->session->unset_userdata('some_name');

-- cgit v1.2.3-24-g4f1b From e08c527aa0a8a05836b05763d859eb3d2970f62f Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Wed, 20 Apr 2011 09:54:47 -0500 Subject: Updating Documentation on package view loading --- user_guide/libraries/loader.html | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'user_guide/libraries') diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 42f8cf94f..1d93af5ed 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -231,17 +231,22 @@ $this->load->library('foo_bar');

Package view files

-

@todo - package view file interface is not complete. It can be experimentally used by first saving the Loader's original view path, setting the view path to the package's view path, and when finished, setting back to the original view path.

- -// ... save the original view path, and set to our Foo Bar package view folder
-$orig_view_path = $this->load->_ci_view_path;
-$this->load->_ci_view_path = APPPATH.'third_party/foo_bar/views/';
-
-// ... code using the package's view files
-
-// ... then return the view path to the application's original view path
-$this->load->_ci_view_path = $orig_view_path;
+

By Default, package view files paths are set when add_package_path() is called. View paths are looped through, and once a match is encountered that view is loaded.

+

In this instance, it is possible for view naming collisions within packages to occur, and possibly the incorrect package being loaded. To ensure against this, set an optional second parameter of FALSE when calling add_package_path().

+ +$this->load->add_package_path(APPPATH.'my_app', TRUE);
+$this->load->view('my_app_index'); // Loads
+$this->load->view('welcome_message'); // Will not load the default welcome_message b/c the second param to add_package_path is TRUE
+
+// Reset things
+$this->load->remove_package_path(APPPATH.'my_app');
+
+// Again without the second parameter:
+$this->load->add_package_path(APPPATH.'my_app', TRUE);
+$this->load->view('my_app_index'); // Loads
+$this->load->view('welcome_message'); // Loads
+
-- cgit v1.2.3-24-g4f1b From 882b76bda8b701a8718960b8d639f060ae79e998 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Wed, 20 Apr 2011 11:22:09 -0500 Subject: Fixed a bug (Reactor #231) where Sessions Library database table example SQL did not contain an index on last_activity. See Upgrade Notes Fixed a bug (Reactor #229) where the Sessions Library example SQL in the documentation contained incorrect SQL. --- user_guide/libraries/sessions.html | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'user_guide/libraries') diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index 8d9c14eb6..6048f4809 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -218,15 +218,17 @@ be updated, they can only be generated when a new session is created.

In order to store sessions, you must first create a database table for this purpose. Here is the basic prototype (for MySQL) required by the session class:

- + session_id varchar(40) DEFAULT '0' NOT NULL, + ip_address varchar(16) DEFAULT '0' NOT NULL, + user_agent varchar(50) NOT NULL, + last_activity int(10) unsigned DEFAULT 0 NOT NULL, + user_data text NOT NULL, + PRIMARY KEY (session_id), + KEY `last_activity_idx` (`last_activity`) +); +

Note: By default the table is called ci_sessions, but you can name it anything you want as long as you update the application/config/config.php file so that it contains the name you have chosen. -- cgit v1.2.3-24-g4f1b From 50671cf8d67c805692fec49eda33d21227a21ec2 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Wed, 20 Apr 2011 11:36:45 -0500 Subject: Altered Session to use a longer match against the user_agent string. See upgrade notes if using database sessions. CREATE TABLE IF NOT EXISTS `ci_sessions` ( session_id varchar(40) DEFAULT '0' NOT NULL, ip_address varchar(16) DEFAULT '0' NOT NULL, - user_agent varchar(50) NOT NULL, + user_agent varchar(120) NOT NULL, last_activity int(10) unsigned DEFAULT 0 NOT NULL, user_data text NOT NULL, PRIMARY KEY (session_id), -- cgit v1.2.3-24-g4f1b From c0b133c02e057b6506726b794ba4582bf18ed663 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 22 Apr 2011 19:58:43 +0900 Subject: default value of $total_rows in Pagination class should be number. And fix User Guide Pagination Class's Example which uses string to number variable. --- user_guide/libraries/pagination.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'user_guide/libraries') diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index e86ec13cc..3c366a69f 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -71,8 +71,8 @@ Pagination Class $this->load->library('pagination');

$config['base_url'] = 'http://example.com/index.php/test/page/';
-$config['total_rows'] = '200';
-$config['per_page'] = '20'; +$config['total_rows'] = 200;
+$config['per_page'] = 20;

$this->pagination->initialize($config); -- cgit v1.2.3-24-g4f1b From 114ab0988e20ac6be39ad363ff897a1a3b85e565 Mon Sep 17 00:00:00 2001 From: Razican Date: Mon, 25 Apr 2011 17:26:45 +0200 Subject: Fixed double-space typo. --- user_guide/libraries/benchmark.html | 8 +-- user_guide/libraries/caching.html | 16 +++--- user_guide/libraries/calendar.html | 12 ++-- user_guide/libraries/cart.html | 46 +++++++-------- user_guide/libraries/config.html | 40 ++++++------- user_guide/libraries/email.html | 24 ++++---- user_guide/libraries/encryption.html | 34 +++++------ user_guide/libraries/file_uploading.html | 58 +++++++++---------- user_guide/libraries/form_validation.html | 94 +++++++++++++++---------------- user_guide/libraries/ftp.html | 36 ++++++------ user_guide/libraries/image_lib.html | 64 ++++++++++----------- user_guide/libraries/input.html | 32 +++++------ user_guide/libraries/javascript.html | 26 ++++----- user_guide/libraries/language.html | 22 ++++---- user_guide/libraries/loader.html | 40 ++++++------- user_guide/libraries/output.html | 20 +++---- user_guide/libraries/pagination.html | 20 +++---- user_guide/libraries/parser.html | 16 +++--- user_guide/libraries/security.html | 8 +-- user_guide/libraries/sessions.html | 42 +++++++------- user_guide/libraries/table.html | 28 ++++----- user_guide/libraries/trackback.html | 26 ++++----- user_guide/libraries/typography.html | 4 +- user_guide/libraries/unit_testing.html | 16 +++--- user_guide/libraries/uri.html | 14 ++--- user_guide/libraries/user_agent.html | 10 ++-- user_guide/libraries/xmlrpc.html | 46 +++++++-------- user_guide/libraries/zip.html | 32 +++++------ 28 files changed, 417 insertions(+), 417 deletions(-) (limited to 'user_guide/libraries') diff --git a/user_guide/libraries/benchmark.html b/user_guide/libraries/benchmark.html index c29acb7b2..4dadf6b83 100644 --- a/user_guide/libraries/benchmark.html +++ b/user_guide/libraries/benchmark.html @@ -83,7 +83,7 @@ timing of the entire system execution to be shown.

Using the Benchmark Class

-

The Benchmark class can be used within your controllers, views, or your models. The process for usage is this:

+

The Benchmark class can be used within your controllers, views, or your models. The process for usage is this:

  1. Mark a start point
  2. @@ -101,7 +101,7 @@ $this->benchmark->mark('code_end');

    echo $this->benchmark->elapsed_time('code_start', 'code_end');
    -

    Note: The words "code_start" and "code_end" are arbitrary. They are simply words used to set two markers. You can +

    Note: The words "code_start" and "code_end" are arbitrary. They are simply words used to set two markers. You can use any words you want, and you can set multiple sets of markers. Consider this example:

    $this->benchmark->mark('dog');
    @@ -154,8 +154,8 @@ is sent to the browser, simply place this in one of your view templates:

    <?php echo $this->benchmark->elapsed_time();?>

    You'll notice that it's the same function used in the examples above to calculate the time between two point, except you are -not using any parameters. When the parameters are absent, CodeIgniter does not stop the benchmark until right before the final -output is sent to the browser. It doesn't matter where you use the function call, the timer will continue to run until the very end.

    +not using any parameters. When the parameters are absent, CodeIgniter does not stop the benchmark until right before the final +output is sent to the browser. It doesn't matter where you use the function call, the timer will continue to run until the very end.

    An alternate way to show your elapsed time in your view files is to use this pseudo-variable, if you prefer not to use the pure PHP:

    {elapsed_time} diff --git a/user_guide/libraries/caching.html b/user_guide/libraries/caching.html index 190232e4b..3fa9fa6a4 100644 --- a/user_guide/libraries/caching.html +++ b/user_guide/libraries/caching.html @@ -58,7 +58,7 @@ Caching Driver

    Caching Driver

    -

    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.

    +

    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.

    Table of Contents

      @@ -97,7 +97,7 @@ echo $foo;

      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.

      +

      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.

      if ($this->cache->apc->is_supported())
      @@ -111,23 +111,23 @@ if ($this->cache->apc->is_supported())

      get(id['string'])

      -

      This function will attempt to fetch an item from the cache store. If the item does not exist, the function will return FALSE.

      +

      This function will attempt to fetch an item from the cache store. If the item does not exist, the function will return FALSE.

      $foo = $this->cache->get('my_cached_item');

      save(id['string'], data['mixed'], ttl['int'])

      -

      This function will save an item to the cache store. If saving fails, the function will return FALSE.

      +

      This function will save an item to the cache store. If saving fails, the function will return FALSE.

      The optional third parameter (Time To Live) defaults to 60 seconds.

      $this->cache->save('cache_item_id', 'data_to_cache');

      delete(id['string'])

      -

      This function will delete a specific item from the cache store. If item deletion fails, the function will return FALSE.

      +

      This function will delete a specific item from the cache store. If item deletion fails, the function will return FALSE.

      $this->cache->delete('cache_item_id');

      clean()

      -

      This function will 'clean' the entire cache. If the deletion of the cache files fails, the function will return FALSE.

      +

      This function will 'clean' the entire cache. If the deletion of the cache files fails, the function will return FALSE.

      $this->cache->clean(); @@ -154,7 +154,7 @@ if ($this->cache->apc->is_supported())

      File-based Caching

      -

      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.

      +

      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->load->driver('cache');
      @@ -172,7 +172,7 @@ if ($this->cache->apc->is_supported())

      Dummy Cache

      -

      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.

      +

      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.

diff --git a/user_guide/libraries/calendar.html b/user_guide/libraries/calendar.html index e1af71cc9..06dfec71e 100644 --- a/user_guide/libraries/calendar.html +++ b/user_guide/libraries/calendar.html @@ -86,13 +86,13 @@ To show a calendar for a specific month and year you will pass this information
echo $this->calendar->generate(2006, 6);
-

The above code will generate a calendar showing the month of June in 2006. The first parameter specifies the year, the second parameter specifies the month.

+

The above code will generate a calendar showing the month of June in 2006. The first parameter specifies the year, the second parameter specifies the month.

Passing Data to your Calendar Cells

To add data to your calendar cells involves creating an associative array in which the keys correspond to the days -you wish to populate and the array value contains the data. The array is passed to the third parameter of the calendar -generating function. Consider this example:

+you wish to populate and the array value contains the data. The array is passed to the third parameter of the calendar +generating function. Consider this example:

$this->load->library('calendar');

@@ -114,7 +114,7 @@ how data passed to your cells is handled so you can pass different types of info

Setting Display Preferences

-

There are seven preferences you can set to control various aspects of the calendar. Preferences are set by passing an +

There are seven preferences you can set to control various aspects of the calendar. Preferences are set by passing an array of preferences in the second parameter of the loading function. Here is an example:

@@ -129,7 +129,7 @@ $this->load->library('calendar', $prefs);

echo $this->calendar->generate();
-

The above code would start the calendar on saturday, use the "long" month heading, and the "short" day names. More information +

The above code would start the calendar on saturday, use the "long" month heading, and the "short" day names. More information regarding preferences below.

@@ -180,7 +180,7 @@ echo $this->calendar->generate($this->uri->segment(3), $this->ur
  • You must set the "show_next_prev" to TRUE.
  • You must supply the URL to the controller containing your calendar in the "next_prev_url" preference.
  • -
  • You must supply the "year" and "month" to the calendar generating function via the URI segments where they appear (Note: The calendar class automatically adds the year/month to the base URL you provide.).
  • +
  • You must supply the "year" and "month" to the calendar generating function via the URI segments where they appear (Note: The calendar class automatically adds the year/month to the base URL you provide.).
diff --git a/user_guide/libraries/cart.html b/user_guide/libraries/cart.html index f084d5dcf..433bd5089 100644 --- a/user_guide/libraries/cart.html +++ b/user_guide/libraries/cart.html @@ -61,13 +61,13 @@ Shopping Cart Class

The Cart Class permits items to be added to a session that stays active while a user is browsing your site. These items can be retrieved and displayed in a standard "shopping cart" format, allowing the user to update the quantity or remove items from the cart.

-

Please note that the Cart Class ONLY provides the core "cart" functionality. It does not provide shipping, credit card authorization, or other processing components.

+

Please note that the Cart Class ONLY provides the core "cart" functionality. It does not provide shipping, credit card authorization, or other processing components.

Initializing the Shopping Cart Class

Important: The Cart class utilizes CodeIgniter's -Session Class to save the cart information to a database, so before using the Cart class you must set up a database table +Session Class to save the cart information to a database, so before using the Cart class you must set up a database table as indicated in the Session Documentation , and set the session preferences in your application/config/config.php file to utilize a database.

To initialize the Shopping Cart Class in your controller constructor, use the $this->load->library function:

@@ -106,19 +106,19 @@ It is intended to be used in cases where your product has options associated wit
  • qty - The quantity being purchased.
  • price - The price of the item.
  • name - The name of the item. -
  • options - Any additional attributes that are needed to identify the product. These must be passed via an array. +
  • options - Any additional attributes that are needed to identify the product. These must be passed via an array. -

    In addition to the five indexes above, there are two reserved words: rowid and subtotal. These are used internally by the Cart class, so +

    In addition to the five indexes above, there are two reserved words: rowid and subtotal. These are used internally by the Cart class, so please do NOT use those words as index names when inserting data into the cart.

    -

    Your array may contain additional data. Anything you include in your array will be stored in the session. However, it is best to standardize your data among +

    Your array may contain additional data. Anything you include in your array will be stored in the session. However, it is best to standardize your data among all your products in order to make displaying the information in a table easier.

    Adding Multiple Items to The Cart

    -

    By using a multi-dimensional array, as shown below, it is possible to add multiple products to the cart in one action. This is useful in cases where you wish to allow +

    By using a multi-dimensional array, as shown below, it is possible to add multiple products to the cart in one action. This is useful in cases where you wish to allow people to select from among several items on the same page.

    @@ -170,10 +170,10 @@ $this->cart->insert($data); <table cellpadding="6" cellspacing="1" style="width:100%" border="0"> <tr> - <th>QTY</th> - <th>Item Description</th> - <th style="text-align:right">Item Price</th> - <th style="text-align:right">Sub-Total</th> + <th>QTY</th> + <th>Item Description</th> + <th style="text-align:right">Item Price</th> + <th style="text-align:right">Sub-Total</th> </tr> <?php $i = 1; ?> @@ -183,8 +183,8 @@ $this->cart->insert($data); <?php echo form_hidden($i.'[rowid]', $items['rowid']); ?> <tr> - <td><?php echo form_input(array('name' => $i.'[qty]', 'value' => $items['qty'], 'maxlength' => '3', 'size' => '5')); ?></td> - <td> + <td><?php echo form_input(array('name' => $i.'[qty]', 'value' => $items['qty'], 'maxlength' => '3', 'size' => '5')); ?></td> + <td> <?php echo $items['name']; ?> <?php if ($this->cart->has_options($items['rowid']) == TRUE): ?> @@ -199,9 +199,9 @@ $this->cart->insert($data); <?php endif; ?> - </td> - <td style="text-align:right"><?php echo $this->cart->format_number($items['price']); ?></td> - <td style="text-align:right">$<?php echo $this->cart->format_number($items['subtotal']); ?></td> + </td> + <td style="text-align:right"><?php echo $this->cart->format_number($items['price']); ?></td> + <td style="text-align:right">$<?php echo $this->cart->format_number($items['subtotal']); ?></td> </tr> <?php $i++; ?> @@ -209,9 +209,9 @@ $this->cart->insert($data); <?php endforeach; ?> <tr> - <td colspan="2"> </td> - <td class="right"><strong>Total</strong></td> - <td class="right">$<?php echo $this->cart->format_number($this->cart->total()); ?></td> + <td colspan="2"> </td> + <td class="right"><strong>Total</strong></td> + <td class="right">$<?php echo $this->cart->format_number($this->cart->total()); ?></td> </tr> </table> @@ -265,11 +265,11 @@ $this->cart->update($data);
    -

    What is a Row ID?  The row ID is a unique identifier that is generated by the cart code when an item is added to the cart. The reason a +

    What is a Row ID?  The row ID is a unique identifier that is generated by the cart code when an item is added to the cart. The reason a unique ID is created is so that identical products with different options can be managed by the cart.

    -

    For example, let's say someone buys two identical t-shirts (same product ID), but in different sizes. The product ID (and other attributes) will be -identical for both sizes because it's the same shirt. The only difference will be the size. The cart must therefore have a means of identifying this +

    For example, let's say someone buys two identical t-shirts (same product ID), but in different sizes. The product ID (and other attributes) will be +identical for both sizes because it's the same shirt. The only difference will be the size. The cart must therefore have a means of identifying this difference so that the two sizes of shirts can be managed independently. It does so by creating a unique "row ID" based on the product ID and any options associated with it.

    In nearly all cases, updating the cart will be something the user does via the "view cart" page, so as a developer, it is unlikely that you will ever have to concern yourself @@ -311,7 +311,7 @@ function when the update form is submitted. Please examine the construction of t

    $this->cart->has_options(rowid);

    -

    Returns TRUE (boolean) if a particular row in the cart contains options. This function is designed to be used in a loop with $this->cart->contents(), since you must pass the rowid to this function, as shown in the Displaying the Cart example above.

    +

    Returns TRUE (boolean) if a particular row in the cart contains options. This function is designed to be used in a loop with $this->cart->contents(), since you must pass the rowid to this function, as shown in the Displaying the Cart example above.

    $this->cart->product_options(rowid);

    @@ -322,7 +322,7 @@ function when the update form is submitted. Please examine the construction of t

    $this->cart->destroy();

    -

    Permits you to destroy the cart. This function will likely be called when you are finished processing the customer's order.

    +

    Permits you to destroy the cart. This function will likely be called when you are finished processing the customer's order.

    diff --git a/user_guide/libraries/config.html b/user_guide/libraries/config.html index 2433ec4ad..c0192ca0a 100644 --- a/user_guide/libraries/config.html +++ b/user_guide/libraries/config.html @@ -58,7 +58,7 @@ Config Class

    Config Class

    -

    The Config class provides a means to retrieve configuration preferences. These preferences can +

    The Config class provides a means to retrieve configuration preferences. These preferences can come from the default config file (application/config/config.php) or from your own custom config files.

    Note: This class is initialized automatically by the system so there is no need to do it manually.

    @@ -66,7 +66,7 @@ come from the default config file (application/config/config.php) o

    Anatomy of a Config File

    -

    By default, CodeIgniter has one primary config file, located at application/config/config.php. If you open the file using +

    By default, CodeIgniter has one primary config file, located at application/config/config.php. If you open the file using your text editor you'll see that config items are stored in an array called $config.

    You can add your own config items to @@ -74,7 +74,7 @@ this file, or if you prefer to keep your configuration items separate (assuming simply create your own file and save it in config folder.

    Note: If you do create your own config files use the same format as the primary one, storing your items in -an array called $config. CodeIgniter will intelligently manage these files so there will be no conflict even though +an array called $config. CodeIgniter will intelligently manage these files so there will be no conflict even though the array has the same name (assuming an array index is not named the same as another).

    Loading a Config File

    @@ -92,12 +92,12 @@ so you will only need to load a config file if you have created your own.

    Where filename is the name of your config file, without the .php file extension.

    -

    If you need to load multiple config files normally they will be merged into one master config array. Name collisions can occur, however, if -you have identically named array indexes in different config files. To avoid collisions you can set the second parameter to TRUE +

    If you need to load multiple config files normally they will be merged into one master config array. Name collisions can occur, however, if +you have identically named array indexes in different config files. To avoid collisions you can set the second parameter to TRUE and each config file will be stored in an array index corresponding to the name of the config file. Example:

    -// Stored in an array with this prototype: $this->config['blog_settings'] = $config
    +// Stored in an array with this prototype: $this->config['blog_settings'] = $config
    $this->config->load('blog_settings', TRUE);

    Please see the section entitled Fetching Config Items below to learn how to retrieve config items set this way.

    @@ -109,7 +109,7 @@ $this->config->load('blog_settings', TRUE);
  • Auto-loading -

    If you find that you need a particular config file globally, you can have it loaded automatically by the system. To do this, +

    If you find that you need a particular config file globally, you can have it loaded automatically by the system. To do this, open the autoload.php file, located at application/config/autoload.php, and add your config file as indicated in the file.

  • @@ -129,7 +129,7 @@ indicated in the file.

    The function returns FALSE (boolean) if the item you are trying to fetch does not exist.

    If you are using the second parameter of the $this->config->load function in order to assign your config items to a specific index -you can retrieve it by specifying the index name in the second parameter of the $this->config->item() function. Example:

    +you can retrieve it by specifying the index name in the second parameter of the $this->config->item() function. Example:

    // Loads a config file named blog_settings.php and assigns it to an index named "blog_settings"
    @@ -154,32 +154,32 @@ $site_name = $blog_config['site_name'];

    Environments

    - You may load different configuration files depending on the current environment. - The ENVIRONMENT constant is defined in index.php, and is described - in detail in the Handling Environments - section. + You may load different configuration files depending on the current environment. + The ENVIRONMENT constant is defined in index.php, and is described + in detail in the Handling Environments + section.

    - To create an environment-specific configuration file, - create or copy a configuration file in application/config/{ENVIRONMENT}/{FILENAME}.php + To create an environment-specific configuration file, + create or copy a configuration file in application/config/{ENVIRONMENT}/{FILENAME}.php

    For example, to create a production-only config.php, you would:

      -
    1. Create the directory application/config/production/
    2. -
    3. Copy your existing config.php into the above directory
    4. -
    5. Edit application/config/production/config.php so it contains your production settings
    6. +
    7. Create the directory application/config/production/
    8. +
    9. Copy your existing config.php into the above directory
    10. +
    11. Edit application/config/production/config.php so it contains your production settings

    - When you set the ENVIRONMENT constant to 'production', the settings - for your new production-only config.php will be loaded. + When you set the ENVIRONMENT constant to 'production', the settings + for your new production-only config.php will be loaded.

    You can place the following configuration files in environment-specific folders:

    - +
    • Default CodeIgniter configuration files
    • Your own custom configuration files
    • diff --git a/user_guide/libraries/email.html b/user_guide/libraries/email.html index 5a8814d59..61e139187 100644 --- a/user_guide/libraries/email.html +++ b/user_guide/libraries/email.html @@ -78,7 +78,7 @@ Email Class

      Sending email is not only simple, but you can configure it on the fly or set your preferences in a config file.

      -

      Here is a basic example demonstrating how you might send email. Note: This example assumes you are sending the email from one of your +

      Here is a basic example demonstrating how you might send email. Note: This example assumes you are sending the email from one of your controllers.

      $this->load->library('email');
      @@ -103,7 +103,7 @@ echo $this->email->print_debugger();

      There are 17 different preferences available to tailor how your email messages are sent. You can either set them manually as described here, or automatically via preferences stored in your config file, described below:

      -

      Preferences are set by passing an array of preference values to the email initialize function. Here is an example of how you might set some preferences:

      +

      Preferences are set by passing an array of preference values to the email initialize function. Here is an example of how you might set some preferences:

      $config['protocol'] = 'sendmail';
      $config['mailpath'] = '/usr/sbin/sendmail';
      @@ -117,7 +117,7 @@ $this->email->initialize($config);
      >

      Setting Email Preferences in a Config File

      If you prefer not to set preferences using the above method, you can instead put them into a config file. -Simply create a new file called the email.php, add the $config +Simply create a new file called the email.php, add the $config array in that file. Then save the file at config/email.php and it will be used automatically. You will NOT need to use the $this->email->initialize() function if you save your preferences in a config file.

      @@ -156,13 +156,13 @@ will NOT need to use the $this->email->initialize() function if you s wrapchars76 Character count to wrap at. -mailtypetexttext or htmlType of mail. If you send HTML email you must send it as a complete web page. Make sure you don't have any relative links or relative image paths otherwise they will not work. +mailtypetexttext or htmlType of mail. If you send HTML email you must send it as a complete web page. Make sure you don't have any relative links or relative image paths otherwise they will not work. charsetutf-8Character set (utf-8, iso-8859-1, etc.). -validateFALSETRUE or FALSE (boolean)Whether to validate the email address. +validateFALSETRUE or FALSE (boolean)Whether to validate the email address. -priority31, 2, 3, 4, 5Email Priority. 1 = highest. 5 = lowest. 3 = normal. +priority31, 2, 3, 4, 5Email Priority. 1 = highest. 5 = lowest. 3 = normal. crlf @@ -188,12 +188,12 @@ will NOT need to use the $this->email->initialize() function if you s $this->email->from('you@example.com', 'Your Name');

      $this->email->reply_to()

      -

      Sets the reply-to address. If the information is not provided the information in the "from" function is used. Example:

      +

      Sets the reply-to address. If the information is not provided the information in the "from" function is used. Example:

      $this->email->reply_to('you@example.com', 'Your Name');

      $this->email->to()

      -

      Sets the email address(s) of the recipient(s). Can be a single email, a comma-delimited list or an array:

      +

      Sets the email address(s) of the recipient(s). Can be a single email, a comma-delimited list or an array:

      $this->email->to('someone@example.com'); $this->email->to('one@example.com, two@example.com, three@example.com'); @@ -221,14 +221,14 @@ $this->email->to($list);

      Sets the alternative email message body:

      $this->email->set_alt_message('This is the alternative message'); -

      This is an optional message string which can be used if you send HTML formatted email. It lets you specify an alternative +

      This is an optional message string which can be used if you send HTML formatted email. It lets you specify an alternative message with no HTML formatting which is added to the header string for people who do not accept HTML email. If you do not set your own message CodeIgniter will extract the message from your HTML email and strip the tags.

      $this->email->clear()

      -

      Initializes all the email variables to an empty state. This function is intended for use if you run the email sending function +

      Initializes all the email variables to an empty state. This function is intended for use if you run the email sending function in a loop, permitting the data to be reset between cycles.

      foreach ($list as $name => $address)
      {
      @@ -268,13 +268,13 @@ $this->email->send();

      $this->email->print_debugger()

      -

      Returns a string containing any server messages, the email headers, and the email messsage. Useful for debugging.

      +

      Returns a string containing any server messages, the email headers, and the email messsage. Useful for debugging.

      Overriding Word Wrapping

      If you have word wrapping enabled (recommended to comply with RFC 822) and you have a very long link in your email it can -get wrapped too, causing it to become un-clickable by the person receiving it. CodeIgniter lets you manually override +get wrapped too, causing it to become un-clickable by the person receiving it. CodeIgniter lets you manually override word wrapping within part of your message like this:

      The text of your email that
      diff --git a/user_guide/libraries/encryption.html b/user_guide/libraries/encryption.html index 60099312c..96ad54bc0 100644 --- a/user_guide/libraries/encryption.html +++ b/user_guide/libraries/encryption.html @@ -58,9 +58,9 @@ Encryption Class

      Encryption Class

      -

      The Encryption Class provides two-way data encryption. It uses a scheme that either compiles +

      The Encryption Class provides two-way data encryption. It uses a scheme that either compiles the message using a randomly hashed bitwise XOR encoding scheme, or is encrypted using -the Mcrypt library. If Mcrypt is not available on your server the encoded message will +the Mcrypt library. If Mcrypt is not available on your server the encoded message will still provide a reasonable degree of security for encrypted sessions or other such "light" purposes. If Mcrypt is available, you'll be provided with a high degree of security appropriate for storage.

      @@ -72,7 +72,7 @@ In fact, the key you chose will provide the only means to decod so not only must you choose the key carefully, you must never change it if you intend use it for persistent data.

      It goes without saying that you should guard your key carefully. -Should someone gain access to your key, the data will be easily decoded. If your server is not totally under your control +Should someone gain access to your key, the data will be easily decoded. If your server is not totally under your control it's impossible to ensure key security so you may want to think carefully before using it for anything that requires high security, like storing credit card numbers.

      @@ -91,9 +91,9 @@ storage mechanism and pass the key dynamically when encoding/decoding.

      Message Length

      It's important for you to know that the encoded messages the encryption function generates will be approximately 2.6 times longer than the original -message. For example, if you encrypt the string "my super secret data", which is 21 characters in length, you'll end up +message. For example, if you encrypt the string "my super secret data", which is 21 characters in length, you'll end up with an encoded string that is roughly 55 characters (we say "roughly" because the encoded string length increments in -64 bit clusters, so it's not exactly linear). Keep this information in mind when selecting your data storage mechanism. Cookies, +64 bit clusters, so it's not exactly linear). Keep this information in mind when selecting your data storage mechanism. Cookies, for example, can only hold 4K of information.

      @@ -124,7 +124,7 @@ $encrypted_string = $this->encrypt->encode($msg, $key);

      $this->encrypt->decode()

      -

      Decrypts an encoded string. Example:

      +

      Decrypts an encoded string. Example:

      $encrypted_string = 'APANtByIGI1BpVXZTJgcsAG8GZl8pdwwa84';
      @@ -142,9 +142,9 @@ $encrypted_string = $this->encrypt->decode($msg, $key);

      $this->encrypt->set_cipher();

      -

      Permits you to set an Mcrypt cipher. By default it uses MCRYPT_RIJNDAEL_256. Example:

      +

      Permits you to set an Mcrypt cipher. By default it uses MCRYPT_RIJNDAEL_256. Example:

      $this->encrypt->set_cipher(MCRYPT_BLOWFISH); -

      Please visit php.net for a list of available ciphers.

      +

      Please visit php.net for a list of available ciphers.

      If you'd like to manually test whether your server supports Mcrypt you can use:

      echo ( ! function_exists('mcrypt_encrypt')) ? 'Nope' : 'Yup'; @@ -152,13 +152,13 @@ $encrypted_string = $this->encrypt->decode($msg, $key);

      $this->encrypt->set_mode();

      -

      Permits you to set an Mcrypt mode. By default it uses MCRYPT_MODE_CBC. Example:

      +

      Permits you to set an Mcrypt mode. By default it uses MCRYPT_MODE_CBC. Example:

      $this->encrypt->set_mode(MCRYPT_MODE_CFB); -

      Please visit php.net for a list of available modes.

      +

      Please visit php.net for a list of available modes.

      $this->encrypt->sha1();

      -

      SHA1 encoding function. Provide a string and it will return a 160 bit one way hash. Note: SHA1, just like MD5 is non-decodable. Example:

      +

      SHA1 encoding function. Provide a string and it will return a 160 bit one way hash. Note: SHA1, just like MD5 is non-decodable. Example:

      $hash = $this->encrypt->sha1('Some string');

      Many PHP installations have SHA1 support by default so if all you need is to encode a hash it's simpler to use the native @@ -169,12 +169,12 @@ function:

      If your server does not support SHA1 you can use the provided function.

      $this->encrypt->encode_from_legacy($orig_data, $legacy_mode = MCRYPT_MODE_ECB, $key = '');

      -

      Enables you to re-encode data that was originally encrypted with CodeIgniter 1.x to be compatible with the Encryption library in CodeIgniter 2.x. It is only - necessary to use this method if you have encrypted data stored permanently such as in a file or database and are on a server that supports Mcrypt. "Light" use encryption - such as encrypted session data or transitory encrypted flashdata require no intervention on your part. However, existing encrypted Sessions will be +

      Enables you to re-encode data that was originally encrypted with CodeIgniter 1.x to be compatible with the Encryption library in CodeIgniter 2.x. It is only + necessary to use this method if you have encrypted data stored permanently such as in a file or database and are on a server that supports Mcrypt. "Light" use encryption + such as encrypted session data or transitory encrypted flashdata require no intervention on your part. However, existing encrypted Sessions will be destroyed since data encrypted prior to 2.x will not be decoded.

      -

      Why only a method to re-encode the data instead of maintaining legacy methods for both encoding and decoding? The algorithms in +

      Why only a method to re-encode the data instead of maintaining legacy methods for both encoding and decoding? The algorithms in the Encryption library have improved in CodeIgniter 2.x both for performance and security, and we do not wish to encourage continued use of the older methods. You can of course extend the Encryption library if you wish and replace the new methods with the old and retain seamless compatibility with CodeIgniter 1.x encrypted data, but this a decision that a developer should make cautiously and deliberately, if at all.

      @@ -195,13 +195,13 @@ function:

      $legacy_mode MCRYPT_MODE_ECB - The Mcrypt mode that was used to generate the original encrypted data. CodeIgniter 1.x's default was MCRYPT_MODE_ECB, and it will + The Mcrypt mode that was used to generate the original encrypted data. CodeIgniter 1.x's default was MCRYPT_MODE_ECB, and it will assume that to be the case unless overridden by this parameter. $key n/a - The encryption key. This it typically specified in your config file as outlined above. + The encryption key. This it typically specified in your config file as outlined above. diff --git a/user_guide/libraries/file_uploading.html b/user_guide/libraries/file_uploading.html index e4e842e5f..a248267ae 100644 --- a/user_guide/libraries/file_uploading.html +++ b/user_guide/libraries/file_uploading.html @@ -58,7 +58,7 @@ File Uploading Class

      File Uploading Class

      -

      CodeIgniter's File Uploading Class permits files to be uploaded. You can set various +

      CodeIgniter's File Uploading Class permits files to be uploaded. You can set various preferences, restricting the type and size of the files.

      @@ -80,7 +80,7 @@ preferences, restricting the type and size of the files.

      -

      Using a text editor, create a form called upload_form.php. In it, place this code and save it to your applications/views/ +

      Using a text editor, create a form called upload_form.php. In it, place this code and save it to your applications/views/ folder:

      @@ -106,8 +106,8 @@ folder:

      </body> </html> -

      You'll notice we are using a form helper to create the opening form tag. File uploads require a multipart form, so the helper -creates the proper syntax for you. You'll also notice we have an $error variable. This is so we can show error messages in the event +

      You'll notice we are using a form helper to create the opening form tag. File uploads require a multipart form, so the helper +creates the proper syntax for you. You'll also notice we have an $error variable. This is so we can show error messages in the event the user does something wrong.

      @@ -138,7 +138,7 @@ In it, place this code and save it to your applications/views/ fold

      The Controller

      -

      Using a text editor, create a controller called upload.php. In it, place this code and save it to your applications/controllers/ +

      Using a text editor, create a controller called upload.php. In it, place this code and save it to your applications/controllers/ folder:

      @@ -162,8 +162,8 @@ class Upload extends CI_Controller { $config['upload_path'] = './uploads/'; $config['allowed_types'] = 'gif|jpg|png'; $config['max_size'] = '100'; - $config['max_width'] = '1024'; - $config['max_height'] = '768'; + $config['max_width'] = '1024'; + $config['max_height'] = '768'; $this->load->library('upload', $config); @@ -186,7 +186,7 @@ class Upload extends CI_Controller {

      The Upload Folder

      -

      You'll need a destination folder for your uploaded images. Create a folder at the root of your CodeIgniter installation called +

      You'll need a destination folder for your uploaded images. Create a folder at the root of your CodeIgniter installation called uploads and set its file permissions to 777.

      @@ -215,26 +215,26 @@ controller is correct it should work.

      Setting Preferences

      -

      Similar to other libraries, you'll control what is allowed to be upload based on your preferences. In the controller you +

      Similar to other libraries, you'll control what is allowed to be upload based on your preferences. In the controller you built above you set the following preferences:

      $config['upload_path'] = './uploads/';
      $config['allowed_types'] = 'gif|jpg|png';
      $config['max_size'] = '100';
      -$config['max_width'] = '1024';
      -$config['max_height'] = '768';
      +$config['max_width'] = '1024';
      +$config['max_height'] = '768';

      $this->load->library('upload', $config);

      -// Alternately you can set preferences by calling the initialize function. Useful if you auto-load the class:
      +// Alternately you can set preferences by calling the initialize function. Useful if you auto-load the class:
      $this->upload->initialize($config);
      -

      The above preferences should be fairly self-explanatory. Below is a table describing all available preferences.

      +

      The above preferences should be fairly self-explanatory. Below is a table describing all available preferences.

      Preferences

      -

      The following preferences are available. The default value indicates what will be used if you do not specify that preference.

      +

      The following preferences are available. The default value indicates what will be used if you do not specify that preference.

      @@ -248,14 +248,14 @@ $this->upload->initialize($config); - + - + @@ -264,7 +264,7 @@ $this->upload->initialize($config); @@ -280,28 +280,28 @@ $this->upload->initialize($config); - + - + - + - + @@ -323,7 +323,7 @@ $this->upload->initialize($config);

      Setting preferences in a config file

      If you prefer not to set preferences using the above method, you can instead put them into a config file. -Simply create a new file called the upload.php, add the $config +Simply create a new file called the upload.php, add the $config array in that file. Then save the file in: config/upload.php and it will be used automatically. You will NOT need to use the $this->upload->initialize function if you save your preferences in a config file.

      @@ -335,7 +335,7 @@ will NOT need to use the $this->upload->initialize function if you sa

      $this->upload->do_upload()

      -

      Performs the upload based on the preferences you've set. Note: By default the upload routine expects the file to come from a form field +

      Performs the upload based on the preferences you've set. Note: By default the upload routine expects the file to come from a form field called userfile, and the form must be a "multipart type:

      <form method="post" action="some_action" enctype="multipart/form-data" /> @@ -349,11 +349,11 @@ $this->upload->do_upload($field_name)

      $this->upload->display_errors()

      -

      Retrieves any error messages if the do_upload() function returned false. The function does not echo automatically, it +

      Retrieves any error messages if the do_upload() function returned false. The function does not echo automatically, it returns the data so you can assign it however you need.

      Formatting Errors

      -

      By default the above function wraps any errors within <p> tags. You can set your own delimiters like this:

      +

      By default the above function wraps any errors within <p> tags. You can set your own delimiters like this:

      $this->upload->display_errors('<p>', '</p>'); @@ -403,7 +403,7 @@ Here is the array prototype:

      - + @@ -415,7 +415,7 @@ Here is the array prototype:

      - + @@ -424,10 +424,10 @@ Here is the array prototype:

      - + - +
      upload_path None NoneThe path to the folder where the upload should be placed. The folder must be writable and the path can be absolute or relative.The path to the folder where the upload should be placed. The folder must be writable and the path can be absolute or relative.
      allowed_types None NoneThe mime types corresponding to the types of files you allow to be uploaded. Usually the file extension can be used as the mime type. Separate multiple types with a pipe.The mime types corresponding to the types of files you allow to be uploaded. Usually the file extension can be used as the mime type. Separate multiple types with a pipe.
      None Desired file name -

      If set CodeIgniter will rename the uploaded file to this name. The extension provided in the file name must also be an allowed file type.

      +

      If set CodeIgniter will rename the uploaded file to this name. The extension provided in the file name must also be an allowed file type.

      max_size 0 NoneThe maximum size (in kilobytes) that the file can be. Set to zero for no limit. Note: Most PHP installations have their own limit, as specified in the php.ini file. Usually 2 MB (or 2048 KB) by default.The maximum size (in kilobytes) that the file can be. Set to zero for no limit. Note: Most PHP installations have their own limit, as specified in the php.ini file. Usually 2 MB (or 2048 KB) by default.
      max_width 0 NoneThe maximum width (in pixels) that the file can be. Set to zero for no limit.The maximum width (in pixels) that the file can be. Set to zero for no limit.
      max_height 0 NoneThe maximum height (in pixels) that the file can be. Set to zero for no limit.The maximum height (in pixels) that the file can be. Set to zero for no limit.
      max_filename 0 NoneThe maximum length that a file name can be. Set to zero for no limit.The maximum length that a file name can be. Set to zero for no limit.
      The file name without the extension
      orig_nameThe original file name. This is only useful if you use the encrypted name option.
      The original file name. This is only useful if you use the encrypted name option.
      client_name The file name as supplied by the client user agent, prior to any file name preparation or incrementing.
      The file size in kilobytes
      is_imageWhether the file is an image or not. 1 = image. 0 = not.
      Whether the file is an image or not. 1 = image. 0 = not.
      image_width Image width.
      Image height
      image_typeImage type. Typically the file extension without the period.
      Image type. Typically the file extension without the period.
      image_size_strA string containing the width and height. Useful to put into an image tag.
      A string containing the width and height. Useful to put into an image tag.
      diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index 8fdcd1446..54908d41d 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -113,10 +113,10 @@ along with an error message describing the problem.
      1. Check for required data.
      2. Verify that the data is of the correct type, and meets the correct criteria. For example, if a username is submitted -it must be validated to contain only permitted characters. It must be of a minimum length, +it must be validated to contain only permitted characters. It must be of a minimum length, and not exceed a maximum length. The username can't be someone else's existing username, or perhaps even a reserved word. Etc.
      3. Sanitize the data for security.
      4. -
      5. Pre-format the data if needed (Does the data need to be trimmed? HTML encoded? Etc.)
      6. +
      7. Pre-format the data if needed (Does the data need to be trimmed? HTML encoded? Etc.)
      8. Prep the data for insertion in the database.
      @@ -150,7 +150,7 @@ Form validation, while simple to create, is generally very messy and tedious to

      The Form

      -

      Using a text editor, create a form called myform.php. In it, place this code and save it to your applications/views/ +

      Using a text editor, create a form called myform.php. In it, place this code and save it to your applications/views/ folder:

      @@ -191,7 +191,7 @@ folder:

      The Success Page

      -

      Using a text editor, create a form called formsuccess.php. In it, place this code and save it to your applications/views/ +

      Using a text editor, create a form called formsuccess.php. In it, place this code and save it to your applications/views/ folder:

      @@ -215,7 +215,7 @@ folder:

      The Controller

      -

      Using a text editor, create a controller called form.php. In it, place this code and save it to your applications/controllers/ +

      Using a text editor, create a controller called form.php. In it, place this code and save it to your applications/controllers/ folder:

      @@ -248,10 +248,10 @@ class Form extends CI_Controller { example.com/index.php/form/ -

      If you submit the form you should simply see the form reload. That's because you haven't set up any validation +

      If you submit the form you should simply see the form reload. That's because you haven't set up any validation rules yet.

      -

      Since you haven't told the Form Validation class to validate anything yet, it returns FALSE (boolean false) by default. The run() +

      Since you haven't told the Form Validation class to validate anything yet, it returns FALSE (boolean false) by default. The run() function only returns TRUE if it has successfully applied your rules without any of them failing.

      @@ -263,8 +263,8 @@ function only returns TRUE if it has successfully applied your rules
      1. It uses a form helper to create the form opening. -Technically, this isn't necessary. You could create the form using standard HTML. However, the benefit of using the helper -is that it generates the action URL for you, based on the URL in your config file. This makes your application more portable in the event your URLs change.
      2. +Technically, this isn't necessary. You could create the form using standard HTML. However, the benefit of using the helper +is that it generates the action URL for you, based on the URL in your config file. This makes your application more portable in the event your URLs change.
      3. At the top of the form you'll notice the following function call: <?php echo validation_errors(); ?> @@ -341,7 +341,7 @@ class Form extends CI_Controller { If you submit the form with all the fields populated you'll see your success page.

        Note: The form fields are not yet being re-populated with the data when -there is an error. We'll get to that shortly.

        +there is an error. We'll get to that shortly.

        @@ -387,7 +387,7 @@ $this->form_validation->set_rules($config);

        Cascading Rules

        -

        CodeIgniter lets you pipe multiple rules together. Let's try it. Change your rules in the third parameter of rule setting function, like this:

        +

        CodeIgniter lets you pipe multiple rules together. Let's try it. Change your rules in the third parameter of rule setting function, like this:

        $this->form_validation->set_rules('username', 'Username', 'required|min_length[5]|max_length[12]');
        @@ -427,7 +427,7 @@ $this->form_validation->set_rules('email', 'Email', 'trim|required|va the "xss_clean" function, which removes malicious data.

        Any native PHP function that accepts one parameter can be used as a rule, like htmlspecialchars, -trim, MD5, etc.

        +trim, MD5, etc.

        Note: You will generally want to use the prepping functions after the validation rules so if there is an error, the original data will be shown in the form.

        @@ -438,7 +438,7 @@ the validation rules so if there is an error, the original data will be shown in

        Re-populating the form

        -

        Thus far we have only been dealing with errors. It's time to repopulate the form field with the submitted data. CodeIgniter offers several helper functions +

        Thus far we have only been dealing with errors. It's time to repopulate the form field with the submitted data. CodeIgniter offers several helper functions that permit you to do this. The one you will use most commonly is:

        set_value('field name') @@ -481,13 +481,13 @@ that permit you to do this. The one you will use most commonly is:

        -

        Now reload your page and submit the form so that it triggers an error. Your form fields should now be re-populated

        +

        Now reload your page and submit the form so that it triggers an error. Your form fields should now be re-populated

        Note: The Function Reference section below contains functions that permit you to re-populate <select> menus, radio buttons, and checkboxes.

        -

        Important Note: If you use an array as the name of a form field, you must supply it as an array to the function. Example:

        +

        Important Note: If you use an array as the name of a form field, you must supply it as an array to the function. Example:

        <input type="text" name="colors[]" value="<?php echo set_value('colors[]'); ?>" size="50" /> @@ -500,16 +500,16 @@ permit you to re-populate <select> menus, radio buttons, and checkboxes.

        Callbacks: Your own Validation Functions

        -

        The validation system supports callbacks to your own validation functions. This permits you to extend the validation class -to meet your needs. For example, if you need to run a database query to see if the user is choosing a unique username, you can -create a callback function that does that. Let's create a example of this.

        +

        The validation system supports callbacks to your own validation functions. This permits you to extend the validation class +to meet your needs. For example, if you need to run a database query to see if the user is choosing a unique username, you can +create a callback function that does that. Let's create a example of this.

        In your controller, change the "username" rule to this:

        $this->form_validation->set_rules('username', 'Username', 'callback_username_check'); -

        Then add a new function called username_check to your controller. Here's how your controller should now look:

        +

        Then add a new function called username_check to your controller. Here's how your controller should now look:

        -

        Reload your form and submit it with the word "test" as the username. You can see that the form field data was passed to your +

        Reload your form and submit it with the word "test" as the username. You can see that the form field data was passed to your callback function for you to process.

        To invoke a callback just put the function name in a rule, with "callback_" as the rule prefix.

        -

        You can also process the form data that is passed to your callback and return it. If your callback returns anything other than a boolean TRUE/FALSE +

        You can also process the form data that is passed to your callback and return it. If your callback returns anything other than a boolean TRUE/FALSE it is assumed that the data is your newly processed form data.

        @@ -568,7 +568,7 @@ it is assumed that the data is your newly processed form data.

        Setting Error Messages

        -

        All of the native error messages are located in the following language file: language/english/form_validation_lang.php

        +

        All of the native error messages are located in the following language file: language/english/form_validation_lang.php

        To set your own custom message you can either edit that file, or use the following function:

        @@ -582,7 +582,7 @@ it is assumed that the data is your newly processed form data.

        $this->form_validation->set_message('username_check') -

        You can also override any error message found in the language file. For example, to change the message for the "required" rule you will do this:

        +

        You can also override any error message found in the language file. For example, to change the message for the "required" rule you will do this:

        $this->form_validation->set_message('required', 'Your custom message here'); @@ -669,9 +669,9 @@ individually.

        <input type="text" name="email" value="<?php echo set_value('email'); ?>" size="50" /> -

        If there are no errors, nothing will be shown. If there is an error, the message will appear.

        +

        If there are no errors, nothing will be shown. If there is an error, the message will appear.

        -

        Important Note: If you use an array as the name of a form field, you must supply it as an array to the function. Example:

        +

        Important Note: If you use an array as the name of a form field, you must supply it as an array to the function. Example:

        <?php echo form_error('options[size]'); ?>
        <input type="text" name="options[size]" value="<?php echo set_value("options[size]"); ?>" size="50" /> @@ -688,8 +688,8 @@ individually.

        Saving Sets of Validation Rules to a Config File

        -

        A nice feature of the Form Validation class is that it permits you to store all your validation rules for your entire application in a config file. You -can organize these rules into "groups". These groups can either be loaded automatically when a matching controller/function is called, or +

        A nice feature of the Form Validation class is that it permits you to store all your validation rules for your entire application in a config file. You +can organize these rules into "groups". These groups can either be loaded automatically when a matching controller/function is called, or you can manually call each set as needed.

        How to save your rules

        @@ -728,8 +728,8 @@ $config = array(

        Creating Sets of Rules

        -

        In order to organize your rules into "sets" requires that you place them into "sub arrays". Consider the following example, showing two sets of rules. -We've arbitrarily called these two rules "signup" and "email". You can name your rules anything you want:

        +

        In order to organize your rules into "sets" requires that you place them into "sub arrays". Consider the following example, showing two sets of rules. +We've arbitrarily called these two rules "signup" and "email". You can name your rules anything you want:

        $config = array(
        @@ -783,7 +783,7 @@ We've arbitrarily called these two rules "signup" and "email". You can name you

        Calling a Specific Rule Group

        -

        In order to call a specific group you will pass its name to the run() function. For example, to call the signup rule you will do this:

        +

        In order to call a specific group you will pass its name to the run() function. For example, to call the signup rule you will do this:

        if ($this->form_validation->run('signup') == FALSE)
        @@ -800,8 +800,8 @@ else

        Associating a Controller Function with a Rule Group

        -

        An alternate (and more automatic) method of calling a rule group is to name it according to the controller class/function you intend to use it with. For example, let's say you -have a controller named Member and a function named signup. Here's what your class might look like:

        +

        An alternate (and more automatic) method of calling a rule group is to name it according to the controller class/function you intend to use it with. For example, let's say you +have a controller named Member and a function named signup. Here's what your class might look like:

        <?php

        @@ -860,7 +860,7 @@ class Member extends CI_Controller {

        Using Arrays as Field Names

        -

        The Form Validation class supports the use of arrays as field names. Consider this example:

        +

        The Form Validation class supports the use of arrays as field names. Consider this example:

        <input type="text" name="options[]" value="" size="50" /> @@ -1147,13 +1147,13 @@ like trim, htmlspecialchars, urldecode, etc.

        $this->form_validation->run(); -

        Runs the validation routines. Returns boolean TRUE on success and FALSE on failure. You can optionally pass the name of the validation +

        Runs the validation routines. Returns boolean TRUE on success and FALSE on failure. You can optionally pass the name of the validation group via the function, as described in: Saving Groups of Validation Rules to a Config File.

        $this->form_validation->set_message();

        -

        Permits you to set custom error messages. See Setting Error Messages above.

        +

        Permits you to set custom error messages. See Setting Error Messages above.

         

        @@ -1161,25 +1161,25 @@ group via the function, as described in: Saving Groups

        Helper Reference

        -

        The following helper functions are available for use in the view files containing your forms. Note that these are procedural functions, so they +

        The following helper functions are available for use in the view files containing your forms. Note that these are procedural functions, so they do not require you to prepend them with $this->form_validation.

        form_error()

        -

        Shows an individual error message associated with the field name supplied to the function. Example:

        +

        Shows an individual error message associated with the field name supplied to the function. Example:

        <?php echo form_error('username'); ?> -

        The error delimiters can be optionally specified. See the Changing the Error Delimiters section above.

        +

        The error delimiters can be optionally specified. See the Changing the Error Delimiters section above.

        validation_errors()

        -

        Shows all error messages as a string: Example:

        +

        Shows all error messages as a string: Example:

        <?php echo validation_errors(); ?> -

        The error delimiters can be optionally specified. See the Changing the Error Delimiters section above.

        +

        The error delimiters can be optionally specified. See the Changing the Error Delimiters section above.

        @@ -1194,7 +1194,7 @@ The second (optional) parameter allows you to set a default value for the form.

        set_select()

        -

        If you use a <select> menu, this function permits you to display the menu item that was selected. The first parameter +

        If you use a <select> menu, this function permits you to display the menu item that was selected. The first parameter must contain the name of the select menu, the second parameter must contain the value of each item, and the third (optional) parameter lets you set an item as the default (use boolean TRUE/FALSE).

        @@ -1202,16 +1202,16 @@ each item, and the third (optional) parameter lets you set an item as the defaul <select name="myselect">
        -<option value="one" <?php echo set_select('myselect', 'one', TRUE); ?> >One</option>
        -<option value="two" <?php echo set_select('myselect', 'two'); ?> >Two</option>
        -<option value="three" <?php echo set_select('myselect', 'three'); ?> >Three</option>
        +<option value="one" <?php echo set_select('myselect', 'one', TRUE); ?> >One</option>
        +<option value="two" <?php echo set_select('myselect', 'two'); ?> >Two</option>
        +<option value="three" <?php echo set_select('myselect', 'three'); ?> >Three</option>
        </select>

        set_checkbox()

        -

        Permits you to display a checkbox in the state it was submitted. The first parameter +

        Permits you to display a checkbox in the state it was submitted. The first parameter must contain the name of the checkbox, the second parameter must contain its value, and the third (optional) parameter lets you set an item as the default (use boolean TRUE/FALSE). Example:

        <input type="checkbox" name="mycheck[]" value="1" <?php echo set_checkbox('mycheck[]', '1'); ?> />
        @@ -1222,8 +1222,8 @@ must contain the name of the checkbox, the second parameter must contain its val

        Permits you to display radio buttons in the state they were submitted. This function is identical to the set_checkbox() function above.

        -<input type="radio" name="myradio" value="1" <?php echo set_radio('myradio', '1', TRUE); ?> />
        -<input type="radio" name="myradio" value="2" <?php echo set_radio('myradio', '2'); ?> />
        +<input type="radio" name="myradio" value="1" <?php echo set_radio('myradio', '1', TRUE); ?> />
        +<input type="radio" name="myradio" value="2" <?php echo set_radio('myradio', '2'); ?> />
        diff --git a/user_guide/libraries/ftp.html b/user_guide/libraries/ftp.html index 43b949a50..c318bc15a 100644 --- a/user_guide/libraries/ftp.html +++ b/user_guide/libraries/ftp.html @@ -59,7 +59,7 @@ FTP Class

        FTP Class

        CodeIgniter's FTP Class permits files to be transfered to a remote server. Remote files can also be moved, renamed, -and deleted. The FTP class also includes a "mirroring" function that permits an entire local directory to be recreated remotely via FTP.

        +and deleted. The FTP class also includes a "mirroring" function that permits an entire local directory to be recreated remotely via FTP.

        Note:  SFTP and SSL FTP protocols are not supported, only standard FTP.

        @@ -74,7 +74,7 @@ and deleted. The FTP class also includes a "mirroring" function that permits an

        Usage Examples

        In this example a connection is opened to the FTP server, and a local file is read and uploaded in ASCII mode. The -file permissions are set to 755. Note: Setting permissions requires PHP 5.

        +file permissions are set to 755. Note: Setting permissions requires PHP 5.

        $this->load->library('ftp');
        @@ -157,26 +157,26 @@ $this->ftp->connect($config);

        Setting FTP Preferences in a Config File

        If you prefer you can store your FTP preferences in a config file. -Simply create a new file called the ftp.php, add the $config +Simply create a new file called the ftp.php, add the $config array in that file. Then save the file at config/ftp.php and it will be used automatically.

        Available connection options:

          -
        • hostname - the FTP hostname. Usually something like:  ftp.example.com
        • +
        • hostname - the FTP hostname. Usually something like:  ftp.example.com
        • username - the FTP username.
        • password - the FTP password.
        • port - The port number. Set to 21 by default.
        • debug - TRUE/FALSE (boolean). Whether to enable debugging to display error messages.
        • -
        • passive - TRUE/FALSE (boolean). Whether to use passive mode. Passive is set automatically by default.
        • +
        • passive - TRUE/FALSE (boolean). Whether to use passive mode. Passive is set automatically by default.

        $this->ftp->upload()

        -

        Uploads a file to your server. You must supply the local path and the remote path, and you can optionally set the mode and permissions. +

        Uploads a file to your server. You must supply the local path and the remote path, and you can optionally set the mode and permissions. Example:

        @@ -190,7 +190,7 @@ Example:

        $this->ftp->download()

        -

        Downloads a file from your server. You must supply the remote path and the local path, and you can optionally set the mode. +

        Downloads a file from your server. You must supply the remote path and the local path, and you can optionally set the mode. Example:

        $this->ftp->download('/public_html/myfile.html', '/local/path/to/myfile.html', 'ascii'); @@ -202,7 +202,7 @@ Example:

        $this->ftp->rename()

        -

        Permits you to rename a file. Supply the source file name/path and the new file name/path.

        +

        Permits you to rename a file. Supply the source file name/path and the new file name/path.

        // Renames green.html to blue.html
        @@ -210,7 +210,7 @@ $this->ftp->rename('/public_html/foo/green.html', '/public_html/foo/blue.html');

        $this->ftp->move()

        -

        Lets you move a file. Supply the source and destination paths:

        +

        Lets you move a file. Supply the source and destination paths:

        // Moves blog.html from "joe" to "fred"
        @@ -221,7 +221,7 @@ $this->ftp->move('/public_html/joe/blog.html', '/public_html/fred/blog.html');

        $this->ftp->delete_file()

        -

        Lets you delete a file. Supply the source path with the file name.

        +

        Lets you delete a file. Supply the source path with the file name.

        $this->ftp->delete_file('/public_html/joe/blog.html'); @@ -229,10 +229,10 @@ $this->ftp->delete_file('/public_html/joe/blog.html');

        $this->ftp->delete_dir()

        -

        Lets you delete a directory and everything it contains. Supply the source path to the directory with a trailing slash.

        +

        Lets you delete a directory and everything it contains. Supply the source path to the directory with a trailing slash.

        -

        Important  Be VERY careful with this function. It will recursively delete -everything within the supplied path, including sub-folders and all files. Make absolutely sure your path is correct. +

        Important  Be VERY careful with this function. It will recursively delete +everything within the supplied path, including sub-folders and all files. Make absolutely sure your path is correct. Try using the list_files() function first to verify that your path is correct.

        @@ -242,7 +242,7 @@ $this->ftp->delete_dir('/public_html/path/to/folder/');

        $this->ftp->list_files()

        -

        Permits you to retrieve a list of files on your server returned as an array. You must supply +

        Permits you to retrieve a list of files on your server returned as an array. You must supply the path to the desired directory.

        @@ -255,7 +255,7 @@ print_r($list);

        $this->ftp->mirror()

        Recursively reads a local folder and everything it contains (including sub-folders) and creates a -mirror via FTP based on it. Whatever the directory structure of the original file path will be recreated on the server. +mirror via FTP based on it. Whatever the directory structure of the original file path will be recreated on the server. You must supply a source path and a destination path:

        @@ -266,7 +266,7 @@ $this->ftp->mirror('/path/to/myfolder/', '/public_html/myfolder/');

        $this->ftp->mkdir()

        -

        Lets you create a directory on your server. Supply the path ending in the folder name you wish to create, with a trailing slash. +

        Lets you create a directory on your server. Supply the path ending in the folder name you wish to create, with a trailing slash. Permissions can be set by passed an octal value in the second parameter (if you are running PHP 5).

        @@ -277,7 +277,7 @@ $this->ftp->mkdir('/public_html/foo/bar/', DIR_WRITE_MODE);

        $this->ftp->chmod()

        -

        Permits you to set file permissions. Supply the path to the file or folder you wish to alter permissions on:

        +

        Permits you to set file permissions. Supply the path to the file or folder you wish to alter permissions on:

        // Chmod "bar" to 777
        @@ -288,7 +288,7 @@ $this->ftp->chmod('/public_html/foo/bar/', DIR_WRITE_MODE);

        $this->ftp->close();

        -

        Closes the connection to your server. It's recommended that you use this when you are finished uploading.

        +

        Closes the connection to your server. It's recommended that you use this when you are finished uploading.

        diff --git a/user_guide/libraries/image_lib.html b/user_guide/libraries/image_lib.html index dbf07768e..e6d38fc96 100644 --- a/user_guide/libraries/image_lib.html +++ b/user_guide/libraries/image_lib.html @@ -68,11 +68,11 @@ Image Manipulation Class
      4. Image Watermarking
    -

    All three major image libraries are supported: GD/GD2, NetPBM, and ImageMagick

    +

    All three major image libraries are supported: GD/GD2, NetPBM, and ImageMagick

    Note: Watermarking is only available using the GD/GD2 library. In addition, even though other libraries are supported, GD is required in -order for the script to calculate the image properties. The image processing, however, will be performed with the +order for the script to calculate the image properties. The image processing, however, will be performed with the library you specify.

    @@ -82,14 +82,14 @@ library you specify.

    using the $this->load->library function:

    $this->load->library('image_lib'); -

    Once the library is loaded it will be ready for use. The image library object you will use to call all functions is: $this->image_lib

    +

    Once the library is loaded it will be ready for use. The image library object you will use to call all functions is: $this->image_lib

    Processing an Image

    Regardless of the type of processing you would like to perform (resizing, cropping, rotation, or watermarking), the general process is identical. You will set some preferences corresponding to the action you intend to perform, then -call one of four available processing functions. For example, to create an image thumbnail you'll do this:

    +call one of four available processing functions. For example, to create an image thumbnail you'll do this:

    $config['image_library'] = 'gd2';
    $config['source_image'] = '/path/to/image/mypic.jpg';
    @@ -106,7 +106,7 @@ $this->image_lib->resize();

    The above code tells the image_resize function to look for an image called mypic.jpg located in the source_image folder, then create a thumbnail that is 75 X 50 pixels using the GD2 image_library. Since the maintain_ratio option is enabled, the thumb will be as close to the target width and -height as possible while preserving the original aspect ratio. The thumbnail will be called mypic_thumb.jpg +height as possible while preserving the original aspect ratio. The thumbnail will be called mypic_thumb.jpg

    Note: In order for the image class to be allowed to do any processing, the @@ -126,7 +126,7 @@ folder containing the image files must have write permissions.

  • $this->image_lib->clear()
  • -

    These functions return boolean TRUE upon success and FALSE for failure. If they fail you can retrieve the +

    These functions return boolean TRUE upon success and FALSE for failure. If they fail you can retrieve the error message using this function:

    echo $this->image_lib->display_errors(); @@ -138,7 +138,7 @@ error message using this function:

        echo $this->image_lib->display_errors();
    }
    -

    Note: You can optionally specify the HTML formatting to be applied to the errors, by submitting the opening/closing +

    Note: You can optionally specify the HTML formatting to be applied to the errors, by submitting the opening/closing tags in the function, like this:

    $this->image_lib->display_errors('<p>', '</p>'); @@ -146,11 +146,11 @@ tags in the function, like this:

    Preferences

    -

    The preferences described below allow you to tailor the image processing to suit your needs.

    +

    The preferences described below allow you to tailor the image processing to suit your needs.

    Note that not all preferences are available for every -function. For example, the x/y axis preferences are only available for image cropping. Likewise, the width and height -preferences have no effect on cropping. The "availability" column indicates which functions support a given preference.

    +function. For example, the x/y axis preferences are only available for image cropping. Likewise, the width and height +preferences have no effect on cropping. The "availability" column indicates which functions support a given preference.

    Availability Legend:

    @@ -187,7 +187,7 @@ preferences have no effect on cropping. The "availability" column indicates whi library_path None None -Sets the server path to your ImageMagick or NetPBM library. If you use either of those libraries you must supply the path. +Sets the server path to your ImageMagick or NetPBM library. If you use either of those libraries you must supply the path. R, C, X @@ -195,7 +195,7 @@ preferences have no effect on cropping. The "availability" column indicates whi source_image None None -Sets the source image name/path. The path must be a relative or absolute server path, not a URL. +Sets the source image name/path. The path must be a relative or absolute server path, not a URL. R, C, S, W @@ -203,7 +203,7 @@ preferences have no effect on cropping. The "availability" column indicates whi dynamic_output FALSE TRUE/FALSE (boolean) -Determines whether the new image file should be written to disk or generated dynamically. Note: If you choose the dynamic setting, only one image can be shown at a time, and it can't be positioned on the page. It simply outputs the raw image dynamically to your browser, along with image headers. +Determines whether the new image file should be written to disk or generated dynamically. Note: If you choose the dynamic setting, only one image can be shown at a time, and it can't be positioned on the page. It simply outputs the raw image dynamically to your browser, along with image headers. R, C, X, W @@ -221,7 +221,7 @@ preferences have no effect on cropping. The "availability" column indicates whi new_image None None -Sets the destination image name/path. You'll use this preference when creating an image copy. The path must be a relative or absolute server path, not a URL. +Sets the destination image name/path. You'll use this preference when creating an image copy. The path must be a relative or absolute server path, not a URL. R, C, X, W @@ -253,7 +253,7 @@ preferences have no effect on cropping. The "availability" column indicates whi thumb_marker _thumb None -Specifies the thumbnail indicator. It will be inserted just before the file extension, so mypic.jpg would become mypic_thumb.jpg +Specifies the thumbnail indicator. It will be inserted just before the file extension, so mypic.jpg would become mypic_thumb.jpg R @@ -281,7 +281,7 @@ preferences have no effect on cropping. The "availability" column indicates whi rotation_angle None 90, 180, 270, vrt, hor -Specifies the angle of rotation when rotating images. Note that PHP rotates counter-clockwise, so a 90 degree rotation to the right must be specified as 270. +Specifies the angle of rotation when rotating images. Note that PHP rotates counter-clockwise, so a 90 degree rotation to the right must be specified as 270. X @@ -306,7 +306,7 @@ preferences have no effect on cropping. The "availability" column indicates whi

    Setting preferences in a config file

    If you prefer not to set preferences using the above method, you can instead put them into a config file. -Simply create a new file called image_lib.php, add the $config +Simply create a new file called image_lib.php, add the $config array in that file. Then save the file in: config/image_lib.php and it will be used automatically. You will NOT need to use the $this->image_lib->initialize function if you save your preferences in a config file.

    @@ -319,7 +319,7 @@ or create a thumbnail image.

    For practical purposes there is no difference between creating a copy and creating a thumbnail except a thumb will have the thumbnail marker as part of the name (ie, mypic_thumb.jpg).

    -

    All preferences listed in the table above are available for this function except these three: rotation_angle, x_axis, and y_axis.

    +

    All preferences listed in the table above are available for this function except these three: rotation_angle, x_axis, and y_axis.

    Creating a Thumbnail

    @@ -358,7 +358,7 @@ preferences for the X and Y axis (in pixels) specifying where to crop, like this $config['x_axis'] = '100';
    $config['y_axis'] = '40';
    -

    All preferences listed in the table above are available for this function except these: rotation_angle, width, height, create_thumb, new_image.

    +

    All preferences listed in the table above are available for this function except these: rotation_angle, width, height, create_thumb, new_image.

    Here's an example showing how you might crop an image:

    @@ -378,8 +378,8 @@ if ( ! $this->image_lib->crop())

    Note: Without a visual interface it is difficult to crop images, so this function is not very useful -unless you intend to build such an interface. That's exactly what we did using for the photo -gallery module in ExpressionEngine, the CMS we develop. We added a JavaScript UI that lets the cropping +unless you intend to build such an interface. That's exactly what we did using for the photo +gallery module in ExpressionEngine, the CMS we develop. We added a JavaScript UI that lets the cropping area be selected.

    $this->image_lib->rotate()

    @@ -443,7 +443,7 @@ containing your watermark over the source image.

    Just as with the other functions (resizing, cropping, and rotating) the general process for watermarking involves setting the preferences corresponding to the action you intend to perform, then -calling the watermark function. Here is an example:

    +calling the watermark function. Here is an example:

    $config['source_image'] = '/path/to/image/mypic.jpg';
    @@ -452,9 +452,9 @@ $config['wm_type'] = 'text';
    $config['wm_font_path'] = './system/fonts/texb.ttf';
    $config['wm_font_size'] = '16';
    $config['wm_font_color'] = 'ffffff';
    -$config['wm_vrt_alignment'] = 'bottom';
    -$config['wm_hor_alignment'] = 'center';
    -$config['wm_padding'] = '20';
    +$config['wm_vrt_alignment'] = 'bottom';
    +$config['wm_hor_alignment'] = 'center';
    +$config['wm_padding'] = '20';

    $this->image_lib->initialize($config);
    @@ -462,7 +462,7 @@ $this->image_lib->initialize($config); $this->image_lib->watermark();
    -

    The above example will use a 16 pixel True Type font to create the text "Copyright 2006 - John Doe". The watermark +

    The above example will use a 16 pixel True Type font to create the text "Copyright 2006 - John Doe". The watermark will be positioned at the bottom/center of the image, 20 pixels from the bottom of the image.

    Note: In order for the image class to be allowed to do any processing, the image file must have "write" file permissions. For example, 777.

    @@ -491,14 +491,14 @@ will be positioned at the bottom/center of the image, 20 pixels from the bottom source_image None None -Sets the source image name/path. The path must be a relative or absolute server path, not a URL. +Sets the source image name/path. The path must be a relative or absolute server path, not a URL. dynamic_output FALSE TRUE/FALSE (boolean) -Determines whether the new image file should be written to disk or generated dynamically. Note: If you choose the dynamic setting, only one image can be shown at a time, and it can't be positioned on the page. It simply outputs the raw image dynamically to your browser, along with image headers. +Determines whether the new image file should be written to disk or generated dynamically. Note: If you choose the dynamic setting, only one image can be shown at a time, and it can't be positioned on the page. It simply outputs the raw image dynamically to your browser, along with image headers. @@ -563,28 +563,28 @@ will be positioned at the bottom/center of the image, 20 pixels from the bottom wm_text None None -The text you would like shown as the watermark. Typically this will be a copyright notice. +The text you would like shown as the watermark. Typically this will be a copyright notice. wm_font_path None None -The server path to the True Type Font you would like to use. If you do not use this option, the native GD font will be used. +The server path to the True Type Font you would like to use. If you do not use this option, the native GD font will be used. wm_font_size 16 None -The size of the text. Note: If you are not using the True Type option above, the number is set using a range of 1 - 5. Otherwise, you can use any valid pixel size for the font you're using. +The size of the text. Note: If you are not using the True Type option above, the number is set using a range of 1 - 5. Otherwise, you can use any valid pixel size for the font you're using. wm_font_color ffffff None -The font color, specified in hex. Note, you must use the full 6 character hex value (ie, 993300), rather than the three character abbreviated version (ie fff). +The font color, specified in hex. Note, you must use the full 6 character hex value (ie, 993300), rather than the three character abbreviated version (ie fff). diff --git a/user_guide/libraries/input.html b/user_guide/libraries/input.html index 08b8ab0d3..6070b6c48 100644 --- a/user_guide/libraries/input.html +++ b/user_guide/libraries/input.html @@ -70,20 +70,20 @@ Input Class

    Security Filtering

    -

    The security filtering function is called automatically when a new controller is invoked. It does the following:

    +

    The security filtering function is called automatically when a new controller is invoked. It does the following:

      -
    • Destroys the global GET array. Since CodeIgniter does not utilize GET strings, there is no reason to allow it.
    • +
    • Destroys the global GET array. Since CodeIgniter does not utilize GET strings, there is no reason to allow it.
    • Destroys all global variables in the event register_globals is turned on.
    • Filters the POST/COOKIE array keys, permitting only alpha-numeric (and a few other) characters.
    • -
    • Provides XSS (Cross-site Scripting Hacks) filtering. This can be enabled globally, or upon request.
    • +
    • Provides XSS (Cross-site Scripting Hacks) filtering. This can be enabled globally, or upon request.
    • Standardizes newline characters to \n

    XSS Filtering

    -

    The Input class has the ability to filter input automatically to prevent cross-site scripting attacks. If you want the filter to run automatically every time it encounters POST or COOKIE data you can enable it by opening your +

    The Input class has the ability to filter input automatically to prevent cross-site scripting attacks. If you want the filter to run automatically every time it encounters POST or COOKIE data you can enable it by opening your application/config/config.php file and setting this:

    $config['global_xss_filtering'] = TRUE; @@ -93,9 +93,9 @@ Input Class

    Using POST, COOKIE, or SERVER Data

    -

    CodeIgniter comes with three helper functions that let you fetch POST, COOKIE or SERVER items. The main advantage of using the provided +

    CodeIgniter comes with three helper functions that let you fetch POST, COOKIE or SERVER items. The main advantage of using the provided functions rather than fetching an item directly ($_POST['something']) is that the functions will check to see if the item is set and -return false (boolean) if not. This lets you conveniently use data without having to test whether an item exists first. +return false (boolean) if not. This lets you conveniently use data without having to test whether an item exists first. In other words, normally you might do something like this:

    @@ -128,7 +128,7 @@ else

    The function returns FALSE (boolean) if the item you are attempting to retrieve does not exist.

    -

    The second optional parameter lets you run the data through the XSS filter. It's enabled by setting the second parameter to boolean TRUE;

    +

    The second optional parameter lets you run the data through the XSS filter. It's enabled by setting the second parameter to boolean TRUE;

    $this->input->post('some_data', TRUE); @@ -179,7 +179,7 @@ else

    $this->input->set_cookie()

    -

    Sets a cookie containing the values you specify. There are two ways to pass information to this function so that a cookie can be set: +

    Sets a cookie containing the values you specify. There are two ways to pass information to this function so that a cookie can be set: Array Method, and Discrete Parameters:

    Array Method

    @@ -203,10 +203,10 @@ $this->input->set_cookie($cookie);

    Only the name and value are required. To delete a cookie set it with the expiration blank.

    -

    The expiration is set in seconds, which will be added to the current time. Do not include the time, but rather only the -number of seconds from now that you wish the cookie to be valid. If the expiration is set to +

    The expiration is set in seconds, which will be added to the current time. Do not include the time, but rather only the +number of seconds from now that you wish the cookie to be valid. If the expiration is set to zero the cookie will only last as long as the browser is open.

    -

    For site-wide cookies regardless of how your site is requested, add your URL to the domain starting with a period, like this: .your-domain.com

    +

    For site-wide cookies regardless of how your site is requested, add your URL to the domain starting with a period, like this: .your-domain.com

    The path is usually not needed since the function sets a root path.

    The prefix is only needed if you need to avoid name collisions with other identically named cookies for your server.

    The secure boolean is only needed if you want to make it a secure cookie by setting it to TRUE.

    @@ -219,25 +219,25 @@ zero the cookie will only last as long as the browser is open.

    $this->input->cookie()

    -

    Lets you fetch a cookie. The first parameter will contain the name of the cookie you are looking for (including any prefixes):

    +

    Lets you fetch a cookie. The first parameter will contain the name of the cookie you are looking for (including any prefixes):

    cookie('some_cookie');

    The function returns FALSE (boolean) if the item you are attempting to retrieve does not exist.

    -

    The second optional parameter lets you run the data through the XSS filter. It's enabled by setting the second parameter to boolean TRUE;

    +

    The second optional parameter lets you run the data through the XSS filter. It's enabled by setting the second parameter to boolean TRUE;

    cookie('some_cookie', TRUE);

    $this->input->ip_address()

    -

    Returns the IP address for the current user. If the IP address is not valid, the function will return an IP of: 0.0.0.0

    +

    Returns the IP address for the current user. If the IP address is not valid, the function will return an IP of: 0.0.0.0

    echo $this->input->ip_address();

    $this->input->valid_ip($ip)

    -

    Takes an IP address as input and returns TRUE or FALSE (boolean) if it is valid or not. Note: The $this->input->ip_address() function above +

    Takes an IP address as input and returns TRUE or FALSE (boolean) if it is valid or not. Note: The $this->input->ip_address() function above validates the IP automatically.

    if ( ! $this->input->valid_ip($ip))
    @@ -256,7 +256,7 @@ else

    See the User Agent Class for methods which extract information from the user agent string.

    $this->input->request_headers()

    -

    Useful if running in a non-Apache environment where apache_request_headers() will not be supported. Returns an array of headers.

    +

    Useful if running in a non-Apache environment where apache_request_headers() will not be supported. Returns an array of headers.

    $headers = $this->input->request_headers(); diff --git a/user_guide/libraries/javascript.html b/user_guide/libraries/javascript.html index 4e262279d..cd3adf1d2 100644 --- a/user_guide/libraries/javascript.html +++ b/user_guide/libraries/javascript.html @@ -65,11 +65,11 @@ JavaScript Driver $this->load->library('javascript'); -

    The Javascript class also accepts parameters, js_library_driver (string) default 'jquery' and autoload (bool) default TRUE. You may override the defaults if you wish by sending an associative array:

    +

    The Javascript class also accepts parameters, js_library_driver (string) default 'jquery' and autoload (bool) default TRUE. You may override the defaults if you wish by sending an associative array:

    $this->load->library('javascript', array('js_library_driver' => 'scripto', 'autoload' => FALSE)); -

    Again, presently only 'jquery' is available. You may wish to set autoload to FALSE, though, if you do not want the jQuery library to automatically include a script tag for the main jQuery script file. This is useful if you are loading it from a location outside of CodeIgniter, or already have the script tag in your markup.

    +

    Again, presently only 'jquery' is available. You may wish to set autoload to FALSE, though, if you do not want the jQuery library to automatically include a script tag for the main jQuery script file. This is useful if you are loading it from a location outside of CodeIgniter, or already have the script tag in your markup.

    Once loaded, the jQuery library object will be available using: $this->javascript

    Setup and Configuration

    @@ -93,7 +93,7 @@ JavaScript Driver $this->load->library('jquery'); -

    You may send an optional parameter to determine whether or not a script tag for the main jQuery file will be automatically included when loading the library. It will be created by default. To prevent this, load the library as follows:

    +

    You may send an optional parameter to determine whether or not a script tag for the main jQuery file will be automatically included when loading the library. It will be created by default. To prevent this, load the library as follows:

    $this->load->library('jquery', FALSE); @@ -115,7 +115,7 @@ JavaScript Driver

    Effects

    -

    The query library supports a powerful Effects repertoire. Before an effect can be used, it must be loaded:

    +

    The query library supports a powerful Effects repertoire. Before an effect can be used, it must be loaded:

    $this->jquery->effect([optional path] plugin name); // for example @@ -125,8 +125,8 @@ $this->jquery->effect('bounce');

    hide() / show()

    Each of this functions will affect the visibility of an item on your page. hide() will set an item invisible, show() will reveal it.

    -

    $this->jquery->hide(target, optional speed, optional extra information);
    - $this->jquery->show(target, optional speed, optional extra information);

    +

    $this->jquery->hide(target, optional speed, optional extra information);
    + $this->jquery->show(target, optional speed, optional extra information);

    • "target" will be any valid jQuery selector or selectors.
    • @@ -162,8 +162,8 @@ $this->jquery->click('#trigger', $this->jquery->animate('#note', $pa

      fadeIn() / fadeOut()

      -

      $this->jquery->fadeIn(target, optional speed, optional extra information);
      - $this->jquery->fadeOut(target, optional speed, optional extra information);

      +

      $this->jquery->fadeIn(target, optional speed, optional extra information);
      + $this->jquery->fadeOut(target, optional speed, optional extra information);

      • "target" will be any valid jQuery selector or selectors.
      • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
      • @@ -182,8 +182,8 @@ $this->jquery->click('#trigger', $this->jquery->animate('#note', $pa

        fadeIn() / fadeOut()

        These effects cause an element(s) to disappear or reappear over time.

        -

        $this->jquery->fadeIn(target, optional speed, optional extra information);
        - $this->jquery->fadeOut(target, optional speed, optional extra information);

        +

        $this->jquery->fadeIn(target, optional speed, optional extra information);
        + $this->jquery->fadeOut(target, optional speed, optional extra information);

        • "target" will be any valid jQuery selector or selectors.
        • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
        • @@ -193,9 +193,9 @@ $this->jquery->click('#trigger', $this->jquery->animate('#note', $pa

          slideUp() / slideDown() / slideToggle()

          These effects cause an element(s) to slide.

          -

          $this->jquery->slideUp(target, optional speed, optional extra information);
          - $this->jquery->slideDown(target, optional speed, optional extra information);
          -$this->jquery->slideToggle(target, optional speed, optional extra information);

          +

          $this->jquery->slideUp(target, optional speed, optional extra information);
          + $this->jquery->slideDown(target, optional speed, optional extra information);
          +$this->jquery->slideToggle(target, optional speed, optional extra information);

          • "target" will be any valid jQuery selector or selectors.
          • "speed" is optional, and is set to either slow, normal, fast, or alternatively a number of milliseconds.
          • diff --git a/user_guide/libraries/language.html b/user_guide/libraries/language.html index 75863c2ac..1b253fa00 100644 --- a/user_guide/libraries/language.html +++ b/user_guide/libraries/language.html @@ -60,30 +60,30 @@ Language Class

            The Language Class provides functions to retrieve language files and lines of text for purposes of internationalization.

            -

            In your CodeIgniter system folder you'll find one called language containing sets of language files. You can create +

            In your CodeIgniter system folder you'll find one called language containing sets of language files. You can create your own language files as needed in order to display error and other messages in other languages.

            -

            Language files are typically stored in your system/language directory. Alternately you can create a folder called language inside -your application folder and store them there. CodeIgniter will look first in your application/language -directory. If the directory does not exist or the specified language is not located there CI will instead look in your global +

            Language files are typically stored in your system/language directory. Alternately you can create a folder called language inside +your application folder and store them there. CodeIgniter will look first in your application/language +directory. If the directory does not exist or the specified language is not located there CI will instead look in your global system/language folder.

            -

            Note:  Each language should be stored in its own folder. For example, the English files are located at: +

            Note:  Each language should be stored in its own folder. For example, the English files are located at: system/language/english

            Creating Language Files

            -

            Language files must be named with _lang.php as the file extension. For example, let's say you want to create a file -containing error messages. You might name it: error_lang.php

            +

            Language files must be named with _lang.php as the file extension. For example, let's say you want to create a file +containing error messages. You might name it: error_lang.php

            Within the file you will assign each line of text to an array called $lang with this prototype:

            $lang['language_key'] = "The actual message to be shown";

            Note: It's a good practice to use a common prefix for all messages in a given file to avoid collisions with -similarly named items in other files. For example, if you are creating error messages you might prefix them with error_

            +similarly named items in other files. For example, if you are creating error messages you might prefix them with error_

            $lang['error_email_missing'] = "You must submit an email address";
            $lang['error_url_missing'] = "You must submit a URL";
            @@ -92,12 +92,12 @@ $lang['error_username_missing'] = "You must submit a username";
            Loading A Language File -

            In order to fetch a line from a particular file you must load the file first. Loading a language file is done with the following code:

            +

            In order to fetch a line from a particular file you must load the file first. Loading a language file is done with the following code:

            $this->lang->load('filename', 'language');

            Where filename is the name of the file you wish to load (without the file extension), and language -is the language set containing it (ie, english). If the second parameter is missing, the default language set in your +is the language set containing it (ie, english). If the second parameter is missing, the default language set in your application/config/config.php file will be used.

            @@ -109,7 +109,7 @@ is the language set containing it (ie, english). If the second parameter is mis

            Where language_key is the array key corresponding to the line you wish to show.

            -

            Note: This function simply returns the line. It does not echo it for you.

            +

            Note: This function simply returns the line. It does not echo it for you.

            Using language lines as form labels

            diff --git a/user_guide/libraries/loader.html b/user_guide/libraries/loader.html index 1d93af5ed..50ec60c1f 100644 --- a/user_guide/libraries/loader.html +++ b/user_guide/libraries/loader.html @@ -58,7 +58,7 @@ Loader Class

            Loader Class

            -

            Loader, as the name suggests, is used to load elements. These elements can be libraries (classes) View files, +

            Loader, as the name suggests, is used to load elements. These elements can be libraries (classes) View files, Helpers, Models, or your own files.

            Note: This class is initialized automatically by the system so there is no need to do it manually.

            @@ -69,7 +69,7 @@ Loader Class

            $this->load->library('class_name', $config, 'object name')

            -

            This function is used to load core classes. Where class_name is the name of the class you want to load. +

            This function is used to load core classes. Where class_name is the name of the class you want to load. Note: We use the terms "class" and "library" interchangeably.

            For example, if you would like to send email with CodeIgniter, the first step is to load the email class within your controller:

            @@ -96,7 +96,7 @@ For example, if you have file located at:

            Setting options

            -

            The second (optional) parameter allows you to optionally pass configuration setting. You will typically pass these as an array:

            +

            The second (optional) parameter allows you to optionally pass configuration setting. You will typically pass these as an array:

            $config = array (
            @@ -113,7 +113,7 @@ $this->load->library('email', $config);

            Assigning a Library to a different object name

            -

            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 Session, it +

            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 Session, it will be assigned to a variable named $this->session.

            If you prefer to set your own class names you can pass its value to the third parameter:

            @@ -131,20 +131,20 @@ $this->my_session

            $this->load->view('file_name', $data, true/false)

            -

            This function is used to load your View files. If you haven't read the Views section of the +

            This function is used to load your View files. If you haven't read the Views section of the user guide it is recommended that you do since it shows you how this function is typically used.

            -

            The first parameter is required. It is the name of the view file you would like to load.  Note: The .php file extension does not need to be specified unless you use something other than .php.

            +

            The first parameter is required. It is the name of the view file you would like to load.  Note: The .php file extension does not need to be specified unless you use something other than .php.

            The second optional parameter can take an associative array or an object as input, which it runs through the PHP extract function to -convert to variables that can be used in your view files. Again, read the Views page to learn +convert to variables that can be used in your view files. Again, read the Views page to learn how this might be useful.

            The third optional parameter lets you change the behavior of the function so that it returns data as a string -rather than sending it to your browser. This can be useful if you want to process the data in some way. If you -set the parameter to true (boolean) it will return data. The default behavior is false, which sends it -to your browser. Remember to assign it to a variable if you want the data returned:

            +rather than sending it to your browser. This can be useful if you want to process the data in some way. If you +set the parameter to true (boolean) it will return data. The default behavior is false, which sends it +to your browser. Remember to assign it to a variable if you want the data returned:

            $string = $this->load->view('myfile', '', true); @@ -159,7 +159,7 @@ to your browser. Remember to assign it to a variable if you want the data retur
            $this->fubar->function();

            $this->load->database('options', true/false)

            -

            This function lets you load the database class. The two parameters are optional. Please see the +

            This function lets you load the database class. The two parameters are optional. Please see the database section for more info.

            @@ -168,9 +168,9 @@ $this->fubar->function();

            $this->load->vars($array)

            This function takes an associative array as input and generates variables using the PHP extract function. -This function produces the same result as using the second parameter of the $this->load->view() function above. The reason you might +This function produces the same result as using the second parameter of the $this->load->view() function above. The reason you might want to use this function independently is if you would like to set some global variables in the constructor of your controller -and have them become available in any view file loaded from any function. You can have multiple calls to this function. The data get cached +and have them become available in any view file loaded from any function. You can have multiple calls to this function. The data get cached and merged into one array for conversion to variables.

            @@ -180,7 +180,7 @@ and merged into one array for conversion to variables.

            $this->load->file('filepath/filename', true/false)

            -

            This is a generic file loading function. Supply the filepath and name in the first parameter and it will open and read the file. +

            This is a generic file loading function. Supply the filepath and name in the first parameter and it will open and read the file. By default the data is sent to your browser, just like a View file, but if you set the second parameter to true (boolean) it will instead return the data as a string.

            @@ -194,7 +194,7 @@ it will instead return the data as a string.

            Application "Packages"

            -

            An application package allows for the easy distribution of complete sets of resources in a single directory, complete with its own libraries, models, helpers, config, and language files. It is recommended that these packages be placed in the application/third_party folder. Below is a sample map of an package directory

            +

            An application package allows for the easy distribution of complete sets of resources in a single directory, complete with its own libraries, models, helpers, config, and language files. It is recommended that these packages be placed in the application/third_party folder. Below is a sample map of an package directory

            Sample Package "Foo Bar" Directory Map

            @@ -210,18 +210,18 @@ libraries/
            models/
            -

            Whatever the purpose of the "Foo Bar" application package, it has its own config files, helpers, language files, libraries, and models. To use these resources in your controllers, you first need to tell the Loader that you are going to be loading resources from a package, by adding the package path.

            +

            Whatever the purpose of the "Foo Bar" application package, it has its own config files, helpers, language files, libraries, and models. To use these resources in your controllers, you first need to tell the Loader that you are going to be loading resources from a package, by adding the package path.

            $this->load->add_package_path()

            -

            Adding a package path instructs the Loader class to prepend a given path for subsequent requests for resources. As an example, the "Foo Bar" application package above has a library named Foo_bar.php. In our controller, we'd do the following:

            +

            Adding a package path instructs the Loader class to prepend a given path for subsequent requests for resources. As an example, the "Foo Bar" application package above has a library named Foo_bar.php. In our controller, we'd do the following:

            $this->load->add_package_path(APPPATH.'third_party/foo_bar/');
            $this->load->library('foo_bar');

            $this->load->remove_package_path()

            -

            When your controller is finished using resources from an application package, and particularly if you have other application packages you want to work with, you may wish to remove the package path so the Loader no longer looks in that folder for resources. To remove the last path added, simply call the method with no parameters.

            +

            When your controller is finished using resources from an application package, and particularly if you have other application packages you want to work with, you may wish to remove the package path so the Loader no longer looks in that folder for resources. To remove the last path added, simply call the method with no parameters.

            $this->load->remove_package_path()

            @@ -231,8 +231,8 @@ $this->load->library('foo_bar');

            Package view files

            -

            By Default, package view files paths are set when add_package_path() is called. View paths are looped through, and once a match is encountered that view is loaded.

            -

            In this instance, it is possible for view naming collisions within packages to occur, and possibly the incorrect package being loaded. To ensure against this, set an optional second parameter of FALSE when calling add_package_path().

            +

            By Default, package view files paths are set when add_package_path() is called. View paths are looped through, and once a match is encountered that view is loaded.

            +

            In this instance, it is possible for view naming collisions within packages to occur, and possibly the incorrect package being loaded. To ensure against this, set an optional second parameter of FALSE when calling add_package_path().

            $this->load->add_package_path(APPPATH.'my_app', TRUE);
            diff --git a/user_guide/libraries/output.html b/user_guide/libraries/output.html index 4d1f8d97a..8846e15ff 100644 --- a/user_guide/libraries/output.html +++ b/user_guide/libraries/output.html @@ -58,7 +58,7 @@ Output Class

            Output Class

            -

            The Output class is a small class with one main function: To send the finalized web page to the requesting browser. It is +

            The Output class is a small class with one main function: To send the finalized web page to the requesting browser. It is also responsible for caching your web pages, if you use that feature.

            Note: This class is initialized automatically by the system so there is no need to do it manually.

            @@ -70,7 +70,7 @@ It is possible, however, for you to manually intervene with the output if you ne

            $this->output->set_output();

            -

            Permits you to manually set the final output string. Usage example:

            +

            Permits you to manually set the final output string. Usage example:

            $this->output->set_output($data); @@ -95,7 +95,7 @@ $this->output

            $this->output->get_output();

            -

            Permits you to manually retrieve any output that has been sent for storage in the output class. Usage example:

            +

            Permits you to manually retrieve any output that has been sent for storage in the output class. Usage example:

            $string = $this->output->get_output();

            Note that data will only be retrievable from this function if it has been previously sent to the output class by one of the @@ -104,7 +104,7 @@ CodeIgniter functions like $this->load->view().

            $this->output->append_output();

            -

            Appends data onto the output string. Usage example:

            +

            Appends data onto the output string. Usage example:

            $this->output->append_output($data); @@ -112,7 +112,7 @@ CodeIgniter functions like $this->load->view().

            $this->output->set_header();

            -

            Permits you to manually set server headers, which the output class will send for you when outputting the final rendered display. Example:

            +

            Permits you to manually set server headers, which the output class will send for you when outputting the final rendered display. Example:

            $this->output->set_header("HTTP/1.0 200 OK");
            @@ -125,10 +125,10 @@ $this->output->set_header("Pragma: no-cache");

            $this->output->set_status_header(code, 'text');

            -

            Permits you to manually set a server status header. Example:

            +

            Permits you to manually set a server status header. Example:

            $this->output->set_status_header('401');
            -// Sets the header as: Unauthorized
            +// Sets the header as: Unauthorized

            See here for a full list of headers.

            @@ -147,14 +147,14 @@ at the bottom of your pages for debugging and optimization purposes.

            $this->output->set_profiler_sections();

            -

            Permits you to enable/disable specific sections of the Profiler when enabled. Please refer to the Profiler documentation for further information.

            +

            Permits you to enable/disable specific sections of the Profiler when enabled. Please refer to the Profiler documentation for further information.

            $this->output->cache();

            -

            The CodeIgniter output library also controls caching. For more information, please see the caching documentation.

            +

            The CodeIgniter output library also controls caching. For more information, please see the caching documentation.

            Parsing Execution Variables

            -

            CodeIgniter will parse the pseudo-variables {elapsed_time} and {memory_usage} in your output by default. To disable this, set the $parse_exec_vars class property to FALSE in your controller. +

            CodeIgniter will parse the pseudo-variables {elapsed_time} and {memory_usage} in your output by default. To disable this, set the $parse_exec_vars class property to FALSE in your controller. $this->output->parse_exec_vars = FALSE; diff --git a/user_guide/libraries/pagination.html b/user_guide/libraries/pagination.html index 3c366a69f..a6b9287a3 100644 --- a/user_guide/libraries/pagination.html +++ b/user_guide/libraries/pagination.html @@ -72,26 +72,26 @@ Pagination Class $this->load->library('pagination');

            $config['base_url'] = 'http://example.com/index.php/test/page/';
            $config['total_rows'] = 200;
            -$config['per_page'] = 20; +$config['per_page'] = 20;

            $this->pagination->initialize($config);

            -echo $this->pagination->create_links(); +echo $this->pagination->create_links();

            Notes:

            -

            The $config array contains your configuration variables. It is passed to the $this->pagination->initialize function as shown above. Although there are some twenty items you can configure, at -minimum you need the three shown. Here is a description of what those items represent:

            +

            The $config array contains your configuration variables. It is passed to the $this->pagination->initialize function as shown above. Although there are some twenty items you can configure, at +minimum you need the three shown. Here is a description of what those items represent:

              -
            • base_url This is the full URL to the controller class/function containing your pagination. In the example - above, it is pointing to a controller called "Test" and a function called "page". Keep in mind that you can +
            • base_url This is the full URL to the controller class/function containing your pagination. In the example + above, it is pointing to a controller called "Test" and a function called "page". Keep in mind that you can re-route your URI if you need a different structure.
            • total_rows This number represents the total rows in the result set you are creating pagination for. Typically this number will be the total rows that your database query returned.
            • -
            • per_page The number of items you intend to show per page. In the above example, you would be showing 20 items per page.
            • +
            • per_page The number of items you intend to show per page. In the above example, you would be showing 20 items per page.

            The create_links() function returns an empty string when there is no pagination to show.

            @@ -100,7 +100,7 @@ minimum you need the three shown. Here is a description of what those items rep

            Setting preferences in a config file

            If you prefer not to set preferences using the above method, you can instead put them into a config file. -Simply create a new file called pagination.php, add the $config +Simply create a new file called pagination.php, add the $config array in that file. Then save the file in: config/pagination.php and it will be used automatically. You will NOT need to use the $this->pagination->initialize function if you save your preferences in a config file.

            @@ -122,9 +122,9 @@ something different you can specify it.

            $config['page_query_string'] = TRUE

            By default, the pagination library assume you are using URI Segments, and constructs your links something like

            http://example.com/index.php/test/page/20

            -

            If you have $config['enable_query_strings'] set to TRUE your links will automatically be re-written using Query Strings. This option can also be explictly set. Using $config['page_query_string'] set to TRUE, the pagination link will become.

            +

            If you have $config['enable_query_strings'] set to TRUE your links will automatically be re-written using Query Strings. This option can also be explictly set. Using $config['page_query_string'] set to TRUE, the pagination link will become.

            http://example.com/index.php?c=test&m=page&per_page=20

            -

            Note that "per_page" is the default query string passed, however can be configured using $config['query_string_segment'] = 'your_string'

            +

            Note that "per_page" is the default query string passed, however can be configured using $config['query_string_segment'] = 'your_string'

            Adding Enclosing Markup

            If you would like to surround the entire pagination with some markup you can do it with these two prefs:

            diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html index cb2f100a2..4f04aaf48 100644 --- a/user_guide/libraries/parser.html +++ b/user_guide/libraries/parser.html @@ -83,10 +83,10 @@ variables or variable tag pairs. If you've never used a template engine, pseudo- PHP from your templates (view files).

            Note: CodeIgniter does not require you to use this class -since using pure PHP in your view pages lets them run a little faster. However, some developers prefer to use a template engine if +since using pure PHP in your view pages lets them run a little faster. However, some developers prefer to use a template engine if they work with designers who they feel would find some confusion working with PHP.

            -

            Also Note: The Template Parser Class is not a +

            Also Note: The Template Parser Class is not a full-blown template parsing solution. We've kept it very lean on purpose in order to maintain maximum performance.

            @@ -102,7 +102,7 @@ full-blown template parsing solution. We've kept it very lean on purpose in orde

            $this->parser->parse()

            -

            This method accepts a template name and data array as input, and it generates a parsed version. Example:

            +

            This method accepts a template name and data array as input, and it generates a parsed version. Example:

            $this->load->library('parser');

            @@ -114,11 +114,11 @@ $data = array(
            $this->parser->parse('blog_template', $data);

            The first parameter contains the name of the view file (in this example the file would be called blog_template.php), -and the second parameter contains an associative array of data to be replaced in the template. In the above example, the +and the second parameter contains an associative array of data to be replaced in the template. In the above example, the template would contain two variables: {blog_title} and {blog_heading}

            -

            There is no need to "echo" or do something with the data returned by $this->parser->parse(). It is automatically -passed to the output class to be sent to the browser. However, if you do want the data returned instead of sent to the output class you can +

            There is no need to "echo" or do something with the data returned by $this->parser->parse(). It is automatically +passed to the output class to be sent to the browser. However, if you do want the data returned instead of sent to the output class you can pass TRUE (boolean) to the third parameter:

            $string = $this->parser->parse('blog_template', $data, TRUE); @@ -130,8 +130,8 @@ pass TRUE (boolean) to the third parameter:

            Variable Pairs

            -

            The above example code allows simple variables to be replaced. What if you would like an entire block of variables to be -repeated, with each iteration containing new values? Consider the template example we showed at the top of the page:

            +

            The above example code allows simple variables to be replaced. What if you would like an entire block of variables to be +repeated, with each iteration containing new values? Consider the template example we showed at the top of the page:

            <html>
            <head>
            diff --git a/user_guide/libraries/security.html b/user_guide/libraries/security.html index 735187459..0cb1d0cb1 100644 --- a/user_guide/libraries/security.html +++ b/user_guide/libraries/security.html @@ -63,11 +63,11 @@ Security Class

            XSS Filtering

            CodeIgniter comes with a Cross Site Scripting Hack prevention filter which can either run automatically to filter -all POST and COOKIE data that is encountered, or you can run it on a per item basis. By default it does not +all POST and COOKIE data that is encountered, or you can run it on a per item basis. By default it does not run globally since it requires a bit of processing overhead, and since you may not need it in all cases.

            The XSS filter looks for commonly used techniques to trigger Javascript or other types of code that attempt to hijack cookies -or do other malicious things. If anything disallowed is encountered it is rendered safe by converting the data to character entities.

            +or do other malicious things. If anything disallowed is encountered it is rendered safe by converting the data to character entities.

            Note: This function should only be used to deal with data upon submission. It's not something that should be used for general runtime processing since it requires a fair amount of processing overhead.

            @@ -88,7 +88,7 @@ Note: This function should only be used to deal with data upon submission. It's

            Note: If you use the form validation class, it gives you the option of XSS filtering as well.

            -

            An optional second parameter, is_image, allows this function to be used to test images for potential XSS attacks, useful for file upload security. When this second parameter is set to TRUE, instead of returning an altered string, the function returns TRUE if the image is safe, and FALSE if it contained potentially malicious information that a browser may attempt to execute.

            +

            An optional second parameter, is_image, allows this function to be used to test images for potential XSS attacks, useful for file upload security. When this second parameter is set to TRUE, instead of returning an altered string, the function returns TRUE if the image is safe, and FALSE if it contained potentially malicious information that a browser may attempt to execute.

            if ($this->security->xss_clean($file, TRUE) === FALSE)
            {
            @@ -98,7 +98,7 @@ Note: This function should only be used to deal with data upon submission. It's

            $this->security->sanitize_filename()

            -

            When accepting filenames from user input, it is best to sanitize them to prevent directory traversal and other security related issues. To do so, use the sanitize_filename() method of the Security class. Here is an example:

            +

            When accepting filenames from user input, it is best to sanitize them to prevent directory traversal and other security related issues. To do so, use the sanitize_filename() method of the Security class. Here is an example:

            $filename = $this->security->sanitize_filename($this->input->post('filename')); diff --git a/user_guide/libraries/sessions.html b/user_guide/libraries/sessions.html index a6f3c601c..bb8f1fc9b 100644 --- a/user_guide/libraries/sessions.html +++ b/user_guide/libraries/sessions.html @@ -61,7 +61,7 @@ Session Class

            The Session class permits you maintain a user's "state" and track their activity while they browse your site. The Session class stores session information for each user as serialized (and optionally encrypted) data in a cookie. It can also store the session data in a database table for added security, as this permits the session ID in the -user's cookie to be matched against the stored session ID. By default only the cookie is saved. If you choose to +user's cookie to be matched against the stored session ID. By default only the cookie is saved. If you choose to use the database option you'll need to create the session table as indicated below.

            @@ -93,8 +93,8 @@ will cause it to read, create, and update sessions.

            If sessions data does not exist (or if it has expired) a new session will be created and saved in the cookie. If a session does exist, its information will be updated and the cookie will be updated. With each update, the session_id will be regenerated.

            -

            It's important for you to understand that once initialized, the Session class runs automatically. There is nothing -you need to do to cause the above behavior to happen. You can, as you'll see below, work with session data or +

            It's important for you to understand that once initialized, the Session class runs automatically. There is nothing +you need to do to cause the above behavior to happen. You can, as you'll see below, work with session data or even add your own data to a user's session, but the process of reading, writing, and updating a session is automatic.

            @@ -106,7 +106,7 @@ even add your own data to a user's session, but the process of reading, writing,
          • The user's unique Session ID (this is a statistically random string with very strong entropy, hashed with MD5 for portability, and regenerated (by default) every five minutes)
          • The user's IP Address
          • The user's User Agent data (the first 50 characters of the browser data string)
          • -
          • The "last activity" time stamp.
          • +
          • The "last activity" time stamp.

          The above data is stored in a cookie as a serialized array with this prototype:

          @@ -124,7 +124,7 @@ making the data highly secure and impervious to being read or altered by someone can be found here, although the Session class will take care of initializing and encrypting the data automatically.

          -

          Note: Session cookies are only updated every five minutes by default to reduce processor load. If you repeatedly reload a page +

          Note: Session cookies are only updated every five minutes by default to reduce processor load. If you repeatedly reload a page you'll notice that the "last activity" time only updates if five minutes or more has passed since the last time the cookie was written. This time is configurable by changing the $config['sess_time_to_update'] line in your system/config/config.php file.

          @@ -134,7 +134,7 @@ the cookie was written. This time is configurable by changing the $config['sess_ $this->session->userdata('item'); -

          Where item is the array index corresponding to the item you wish to fetch. For example, to fetch the session ID you +

          Where item is the array index corresponding to the item you wish to fetch. For example, to fetch the session ID you will do this:

          $session_id = $this->session->userdata('session_id'); @@ -145,7 +145,7 @@ will do this:

          Adding Custom Session Data

          A useful aspect of the session array is that you can add your own data to it and it will be stored in the user's cookie. -Why would you want to do this? Here's one example:

          +Why would you want to do this? Here's one example:

          Let's say a particular user logs into your site. Once authenticated, you could add their username and email address to the session cookie, making that data globally available to you without @@ -155,7 +155,7 @@ having to run a database query when you need it.

          $this->session->set_userdata($array); -

          Where $array is an associative array containing your new data. Here's an example:

          +

          Where $array is an associative array containing your new data. Here's an example:

          $newdata = array(
          @@ -167,7 +167,7 @@ having to run a database query when you need it.

          $this->session->set_userdata($newdata);

          If you want to add userdata one value at a time, set_userdata() also supports this syntax.

          $this->session->set_userdata('some_name', 'some_value');

          -

          Note: Cookies can only hold 4KB of data, so be careful not to exceed the capacity. The +

          Note: Cookies can only hold 4KB of data, so be careful not to exceed the capacity. The encryption process in particular produces a longer data string than the original so keep careful track of how much data you are storing.

          Retrieving All Session Data

          @@ -179,10 +179,10 @@ encryption process in particular produces a longer data string than the original
           Array
           (
          -    [session_id] => 4a5a5dca22728fb0a84364eeb405b601
          -    [ip_address] => 127.0.0.1
          -    [user_agent] => Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7;
          -    [last_activity] => 1303142623
          +  [session_id] => 4a5a5dca22728fb0a84364eeb405b601
          +  [ip_address] => 127.0.0.1
          +  [user_agent] => Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7;
          +  [last_activity] => 1303142623
           )
           
          @@ -206,20 +206,20 @@ $this->session->unset_userdata($array_items);

          $this->session->keep_flashdata('item');

          Saving Session Data to a Database

          While the session data array stored in the user's cookie contains a Session ID, -unless you store session data in a database there is no way to validate it. For some applications that require little or no -security, session ID validation may not be needed, but if your application requires security, validation is mandatory. Otherwise, an old session +unless you store session data in a database there is no way to validate it. For some applications that require little or no +security, session ID validation may not be needed, but if your application requires security, validation is mandatory. Otherwise, an old session could be restored by a user modifying their cookies.

          When session data is available in a database, every time a valid session is found in the user's cookie, a database -query is performed to match it. If the session ID does not match, the session is destroyed. Session IDs can never +query is performed to match it. If the session ID does not match, the session is destroyed. Session IDs can never be updated, they can only be generated when a new session is created.

          -

          In order to store sessions, you must first create a database table for this purpose. Here is the basic +

          In order to store sessions, you must first create a database table for this purpose. Here is the basic prototype (for MySQL) required by the session class:

          -

          Note: In the above code we are using a "url helper". You can find more information in the Helpers Functions page.

          +

          Note: In the above code we are using a "url helper". You can find more information in the Helpers Functions page.

          The Server

          @@ -381,7 +381,7 @@ class Xmlrpc_server extends CI_Controller { $response = array( array( - 'you_said' => $parameters['0'], + 'you_said' => $parameters['0'], 'i_respond' => 'Not bad at all.'), 'struct'); @@ -452,7 +452,7 @@ The Server receives the request and maps it to the "process" function, where a r $this->xmlrpc->request($request);

          $this->xmlrpc->send_request()

          -

          The request sending function. Returns boolean TRUE or FALSE based on success for failure, enabling it to be used conditionally.

          +

          The request sending function. Returns boolean TRUE or FALSE based on success for failure, enabling it to be used conditionally.

          $this->xmlrpc->set_debug(TRUE);

          Enables debugging, which will display a variety of information and error data helpful during development.

          @@ -463,7 +463,7 @@ $this->xmlrpc->request($request); echo $this->xmlrpc->display_error();

          $this->xmlrpc->display_response()

          -

          Returns the response from the remote server once request is received. The response will typically be an associative array.

          +

          Returns the response from the remote server once request is received. The response will typically be an associative array.

          $this->xmlrpc->display_response();

          $this->xmlrpc->send_error_message()

          diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index 031126603..2fc5fd81b 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -81,7 +81,7 @@ $this->zip->add_data($name, $data);
          // Write the zip file to a folder on your server. Name it "my_backup.zip"
          $this->zip->archive('/path/to/directory/my_backup.zip');

          - // Download the file to your desktop. Name it "my_backup.zip"
          + // Download the file to your desktop. Name it "my_backup.zip"
          $this->zip->download('my_backup.zip'); @@ -100,7 +100,7 @@ $this->zip->add_data($name, $data);

          You are allowed multiple calls to this function in order to -add several files to your archive. Example:

          +add several files to your archive. Example:

          $name = 'mydata1.txt';
          @@ -139,8 +139,8 @@ $this->zip->add_data($name, $data);

          $this->zip->add_dir()

          -

          Permits you to add a directory. Usually this function is unnecessary since you can place your data into folders when -using $this->zip->add_data(), but if you would like to create an empty folder you can do so. Example:

          +

          Permits you to add a directory. Usually this function is unnecessary since you can place your data into folders when +using $this->zip->add_data(), but if you would like to create an empty folder you can do so. Example:

          $this->zip->add_dir('myfolder'); // Creates a folder called "myfolder" @@ -148,49 +148,49 @@ using $this->zip->add_data(), but if you would like to create an empt

          $this->zip->read_file()

          -

          Permits you to compress a file that already exists somewhere on your server. Supply a file path and the zip class will +

          Permits you to compress a file that already exists somewhere on your server. Supply a file path and the zip class will read it and add it to the archive:

          $path = '/path/to/photo.jpg';

          $this->zip->read_file($path);

          - // Download the file to your desktop. Name it "my_backup.zip"
          + // Download the file to your desktop. Name it "my_backup.zip"
          $this->zip->download('my_backup.zip');

          If you would like the Zip archive to maintain the directory structure of the file in it, pass TRUE (boolean) in the -second parameter. Example:

          +second parameter. Example:

          $path = '/path/to/photo.jpg';

          $this->zip->read_file($path, TRUE);

          - // Download the file to your desktop. Name it "my_backup.zip"
          + // Download the file to your desktop. Name it "my_backup.zip"
          $this->zip->download('my_backup.zip');
          -

          In the above example, photo.jpg will be placed inside two folders: path/to/

          +

          In the above example, photo.jpg will be placed inside two folders: path/to/

          $this->zip->read_dir()

          -

          Permits you to compress a folder (and its contents) that already exists somewhere on your server. Supply a file path to the -directory and the zip class will recursively read it and recreate it as a Zip archive. All files contained within the -supplied path will be encoded, as will any sub-folders contained within it. Example:

          +

          Permits you to compress a folder (and its contents) that already exists somewhere on your server. Supply a file path to the +directory and the zip class will recursively read it and recreate it as a Zip archive. All files contained within the +supplied path will be encoded, as will any sub-folders contained within it. Example:

          $path = '/path/to/your/directory/';

          $this->zip->read_dir($path);

          - // Download the file to your desktop. Name it "my_backup.zip"
          + // Download the file to your desktop. Name it "my_backup.zip"
          $this->zip->download('my_backup.zip');

          By default the Zip archive will place all directories listed in the first parameter inside the zip. If you want the tree preceding the target folder to be ignored -you can pass FALSE (boolean) in the second parameter. Example:

          +you can pass FALSE (boolean) in the second parameter. Example:

          $path = '/path/to/your/directory/';

          @@ -204,7 +204,7 @@ $this->zip->read_dir($path, FALSE);

          $this->zip->archive()

          -

          Writes the Zip-encoded file to a directory on your server. Submit a valid server path ending in the file name. Make sure the +

          Writes the Zip-encoded file to a directory on your server. Submit a valid server path ending in the file name. Make sure the directory is writable (666 or 777 is usually OK). Example:

          $this->zip->archive('/path/to/folder/myarchive.zip'); // Creates a file named myarchive.zip @@ -223,7 +223,7 @@ that cause the download to happen and the file to be treated as binary.

          $this->zip->get_zip()

          -

          Returns the Zip-compressed file data. Generally you will not need this function unless you want to do something unique with the data. +

          Returns the Zip-compressed file data. Generally you will not need this function unless you want to do something unique with the data. Example:

          -- cgit v1.2.3-24-g4f1b From e63ee8e73476fddc7cb1300274bf50e1bd6b098b Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 15 Apr 2011 11:37:39 +0900 Subject: update Prev/Next Topic link on user_guide/libraries/caching.html --- user_guide/libraries/caching.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'user_guide/libraries') diff --git a/user_guide/libraries/caching.html b/user_guide/libraries/caching.html index 3fa9fa6a4..7e1339217 100644 --- a/user_guide/libraries/caching.html +++ b/user_guide/libraries/caching.html @@ -180,11 +180,11 @@ if ($this->cache->apc->is_supported())
          -- cgit v1.2.3-24-g4f1b From 0d3432b4c043d04c5cfebbf970f547fa2af82ee8 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 15 Apr 2011 11:38:43 +0900 Subject: fix title and update Prev/Next Topic link on user_guide/libraries/javascript.html --- user_guide/libraries/javascript.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'user_guide/libraries') diff --git a/user_guide/libraries/javascript.html b/user_guide/libraries/javascript.html index cd3adf1d2..5929cbec9 100644 --- a/user_guide/libraries/javascript.html +++ b/user_guide/libraries/javascript.html @@ -2,7 +2,7 @@ -CodeIgniter User Guide : JavaScript Class +JavaScript Class : CodeIgniter User Guide @@ -235,11 +235,11 @@ $this->jquery->slideToggle(target, optional speed, optional extra informat -- cgit v1.2.3-24-g4f1b From c0d129c4d248471c2dfdc4584c2b00c4fcf62cb3 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 15 Apr 2011 11:39:01 +0900 Subject: update Prev/Next Topic link on user_guide/libraries/zip.html --- user_guide/libraries/zip.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide/libraries') diff --git a/user_guide/libraries/zip.html b/user_guide/libraries/zip.html index 2fc5fd81b..e6405cc8f 100644 --- a/user_guide/libraries/zip.html +++ b/user_guide/libraries/zip.html @@ -279,7 +279,7 @@ Previous Topic:   XML-RPC Class    ·   Top of Page   ·   User Guide Home   ·   -Next Topic:  Array Helper +Next Topic:  Caching Class

          CodeIgniter  ·  Copyright © 2006 - 2011  ·  EllisLab, Inc.

    -- cgit v1.2.3-24-g4f1b