From 46e3a9a365e6bae7954f5118db1409faa5f5decd Mon Sep 17 00:00:00 2001 From: Mike Funk Date: Fri, 24 Feb 2012 09:38:35 -0500 Subject: added config check, changelog entry, and user guide update. --- user_guide_src/source/changelog.rst | 1 + user_guide_src/source/libraries/table.rst | 2 ++ 2 files changed, 3 insertions(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index dc6b29516..0e5fea491 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -72,6 +72,7 @@ Release Date: Not Released - Minor speed optimizations and method & property visibility declarations in the Calendar Library. - Removed SHA1 function in the :doc:`Encryption Library `. - Added $config['csrf_regeneration'] to the CSRF protection in the :doc:`Security library `, which makes token regeneration optional. + - Allowed for setting table class defaults in a config file. - Core diff --git a/user_guide_src/source/libraries/table.rst b/user_guide_src/source/libraries/table.rst index 9bc3f3423..6a808abc2 100644 --- a/user_guide_src/source/libraries/table.rst +++ b/user_guide_src/source/libraries/table.rst @@ -116,6 +116,8 @@ example, only the table opening tag is being changed:: $tmpl = array ( 'table_open' => '' ); $this->table->set_template($tmpl); + +You can also set defaults for these in a config file. ****************** Function Reference -- cgit v1.2.3-24-g4f1b From 326a5e75db1e03e453f488f2d612b0f421806129 Mon Sep 17 00:00:00 2001 From: Mike Funk Date: Fri, 24 Feb 2012 10:06:28 -0500 Subject: added config process method checking for delimiter values, updated changelog and user guide. --- user_guide_src/source/changelog.rst | 1 + user_guide_src/source/libraries/form_validation.rst | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index dc6b29516..3aa9d6573 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -72,6 +72,7 @@ Release Date: Not Released - Minor speed optimizations and method & property visibility declarations in the Calendar Library. - Removed SHA1 function in the :doc:`Encryption Library `. - Added $config['csrf_regeneration'] to the CSRF protection in the :doc:`Security library `, which makes token regeneration optional. + - Form Validation library now allows setting of error delimiters in the config file via $config['error_prefix'] and $config['error_suffix']. - Core diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst index e7875bc22..1b3fa61d1 100644 --- a/user_guide_src/source/libraries/form_validation.rst +++ b/user_guide_src/source/libraries/form_validation.rst @@ -523,7 +523,7 @@ Changing the Error Delimiters By default, the Form Validation class adds a paragraph tag (

) around each error message shown. You can either change these delimiters -globally or individually. +globally, individually, or change the defaults in a config file. #. **Changing delimiters Globally** To globally change the error delimiters, in your controller function, @@ -543,6 +543,12 @@ globally or individually. ', ''); ?> +#. **Set delimiters in a config file** + You can add your error delimiters in application/config/form_validation.php as follows:: + + $config['error_prefix'] = '

'; + $config['error_suffix'] = '

'; + Showing Errors Individually =========================== -- cgit v1.2.3-24-g4f1b From 571e41eee86494c45f09fc723849011ca5a4f45b Mon Sep 17 00:00:00 2001 From: Mike Funk Date: Fri, 24 Feb 2012 10:10:07 -0500 Subject: fixed suffix documentation. --- user_guide_src/source/libraries/form_validation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst index 1b3fa61d1..36ad85dd2 100644 --- a/user_guide_src/source/libraries/form_validation.rst +++ b/user_guide_src/source/libraries/form_validation.rst @@ -547,7 +547,7 @@ globally, individually, or change the defaults in a config file. You can add your error delimiters in application/config/form_validation.php as follows:: $config['error_prefix'] = '

'; - $config['error_suffix'] = '

'; + $config['error_suffix'] = '

'; Showing Errors Individually -- cgit v1.2.3-24-g4f1b From 840a89396dbd67b7be5539bf2e9ce94274795ad8 Mon Sep 17 00:00:00 2001 From: Mike Funk Date: Fri, 24 Feb 2012 10:11:37 -0500 Subject: updated documentation to differentiate prefix and suffix more. --- user_guide_src/source/libraries/form_validation.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst index 36ad85dd2..b70fc44d0 100644 --- a/user_guide_src/source/libraries/form_validation.rst +++ b/user_guide_src/source/libraries/form_validation.rst @@ -546,8 +546,8 @@ globally, individually, or change the defaults in a config file. #. **Set delimiters in a config file** You can add your error delimiters in application/config/form_validation.php as follows:: - $config['error_prefix'] = '

'; - $config['error_suffix'] = '

'; + $config['error_prefix'] = '
'; + $config['error_suffix'] = '
'; Showing Errors Individually -- cgit v1.2.3-24-g4f1b From 03a57655f3cdc6c0b9f717f4466a4547247729d3 Mon Sep 17 00:00:00 2001 From: Mike Davies Date: Wed, 29 Feb 2012 17:52:36 -0500 Subject: Added support for Wincache when running CI on Windows boxes Wincache is directly analogous to APC, except with less problems on a Windows environment. Performance wise they are almost identical (for user mode caching at least). Need to have the Wincache PHP module downloaded from http://www.iis.net/download/wincacheforphp. --- user_guide_src/source/changelog.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index dc6b29516..e879568ed 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -29,6 +29,7 @@ Release Date: Not Released - Added support for m4a, aac, m4u, xspf, au, ac3, flac, ogg Audio files to mimes.php. - Added support for kmz and kml (Google Earth) files to mimes.php. - Added application/xml for xml and application/xml, text/xsl for xsl in mimes.php. + - Added support for Wincache PHP extension - Changed logger to only chmod when file is first created. - Removed previously deprecated SHA1 Library. - Removed previously deprecated use of ``$autoload['core']`` in application/config/autoload.php. -- cgit v1.2.3-24-g4f1b From fce2ed6d1d3026c485e79ce5bf236effc67981be Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sun, 11 Mar 2012 22:04:48 +0200 Subject: Added an Android <= 2.1 specific check to force_download() --- user_guide_src/source/changelog.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 8579218b0..139899af0 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -43,6 +43,7 @@ Release Date: Not Released - Changed humanize to include a second param for the separator. - Refactored ``plural()`` and ``singular()`` to avoid double pluralization and support more words. - Added an optional third parameter to ``force_download()`` that enables/disables sending the actual file MIME type in the Content-Type header (disabled by default). + - Added a work-around in force_download() for a bug Android <= 2.1, where the filename extension needs to be in uppercase. - Database -- cgit v1.2.3-24-g4f1b From 0ba29f5aa019b9c4a002fbecacf6ed33f3b68a3d Mon Sep 17 00:00:00 2001 From: nihaopaul Date: Mon, 12 Mar 2012 16:46:58 +0800 Subject: form_dropdown() will now also take an array for unity with other form helpers. --- user_guide_src/source/changelog.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 139899af0..f462e1b11 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -44,6 +44,7 @@ Release Date: Not Released - Refactored ``plural()`` and ``singular()`` to avoid double pluralization and support more words. - Added an optional third parameter to ``force_download()`` that enables/disables sending the actual file MIME type in the Content-Type header (disabled by default). - Added a work-around in force_download() for a bug Android <= 2.1, where the filename extension needs to be in uppercase. + - form_dropdown() will now also take an array for unity with other form helpers. - Database -- cgit v1.2.3-24-g4f1b From 89338828264a6b50e0eb63c449a96f14f0f84076 Mon Sep 17 00:00:00 2001 From: Taufan Aditya Date: Mon, 12 Mar 2012 21:03:37 +0700 Subject: Path helper improvement --- user_guide_src/source/changelog.rst | 1 + user_guide_src/source/helpers/path_helper.rst | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index f462e1b11..6900279ec 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -45,6 +45,7 @@ Release Date: Not Released - Added an optional third parameter to ``force_download()`` that enables/disables sending the actual file MIME type in the Content-Type header (disabled by default). - Added a work-around in force_download() for a bug Android <= 2.1, where the filename extension needs to be in uppercase. - form_dropdown() will now also take an array for unity with other form helpers. + - set_realpath() improvement. - Database diff --git a/user_guide_src/source/helpers/path_helper.rst b/user_guide_src/source/helpers/path_helper.rst index 1a70af458..6efd93cc1 100644 --- a/user_guide_src/source/helpers/path_helper.rst +++ b/user_guide_src/source/helpers/path_helper.rst @@ -28,10 +28,13 @@ cannot be resolved. :: + $file = '/etc/php5/apache2/php.ini'; + echo set_realpath($file); // returns "/etc/php5/apache2/php.ini" + $non_existent_file = '/path/to/non-exist-file.txt'; + echo set_realpath($non_existent_file, TRUE); // returns an error, as the path could not be resolved + echo set_realpath($non_existent_file, FALSE); // returns "/path/to/non-exist-file.txt" $directory = '/etc/passwd'; - echo set_realpath($directory); // returns "/etc/passwd" + echo set_realpath($directory); // returns "/etc/passwd/" $non_existent_directory = '/path/to/nowhere'; echo set_realpath($non_existent_directory, TRUE); // returns an error, as the path could not be resolved - echo set_realpath($non_existent_directory, FALSE); // returns "/path/to/nowhere" - - + echo set_realpath($non_existent_directory, FALSE); // returns "/path/to/nowhere" \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 95bd1d1a5f5bdccfde53cc27d7d5c20991112643 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 12 Mar 2012 16:22:28 +0200 Subject: Remove collation parameter from db_set_charset() (no longer needed) --- user_guide_src/source/changelog.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 2ea810d30..1c9e1992d 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -68,6 +68,8 @@ Release Date: Not Released - Added a constructor to the DB_result class and moved all driver-specific properties and logic out of the base DB_driver class to allow better abstraction. - Removed limit() and order_by() support for UPDATE and DELETE queries in PostgreSQL driver. Postgres does not support those features. - Removed protect_identifiers() and renamed _protect_identifiers() to it instead - it was just an alias. + - MySQL and MySQLi drivers now require at least MySQL version 5.1. + - db_set_charset() now only requires one parameter (collation was only needed due to legacy support for MySQL versions prior to 5.1). - Libraries @@ -140,7 +142,7 @@ Bug fixes for 3.0 - Fixed a bug in PDO's _version() method where it used to return the client version as opposed to the server one. - Fixed a bug in PDO's insert_id() method where it could've failed if it's used with Postgre versions prior to 8.1. - Fixed a bug in CUBRID's affected_rows() method where a connection resource was passed to cubrid_affected_rows() instead of a result. -- Fixed a bug (#638) - db_set_charset() ignored its arguments and always used the configured charset and collation instead. +- Fixed a bug (#638) - db_set_charset() ignored its arguments and always used the configured charset instead. - Fixed a bug (#413) - Oracle's error handling methods used to only return connection-related errors. - Fixed a bug (#804) - Profiler library was trying to handle objects as strings in some cases, resulting in warnings being issued by htmlspecialchars(). - Fixed a bug (#1101) - MySQL/MySQLi result method field_data() was implemented as if it was handling a DESCRIBE result instead of the actual result set. -- cgit v1.2.3-24-g4f1b From 2004325337c501b201fe55f653f86d3ba8432d06 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 12 Mar 2012 16:48:28 +0200 Subject: Update the list of supported databases --- user_guide_src/source/general/requirements.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/general/requirements.rst b/user_guide_src/source/general/requirements.rst index a927b7af6..05e87961a 100644 --- a/user_guide_src/source/general/requirements.rst +++ b/user_guide_src/source/general/requirements.rst @@ -4,5 +4,5 @@ Server Requirements - `PHP `_ version 5.2.4 or newer. - A Database is required for most web application programming. Current - supported databases are MySQL (5.1+), MySQLi, MS SQL, Postgres, Oracle, - SQLite, ODBC and CUBRID. \ No newline at end of file + supported databases are MySQL (5.1+), MySQLi, MS SQL, SQLSRV, Oracle, + PostgreSQL, SQLite, CUBRID, Interbase, ODBC and PDO. -- cgit v1.2.3-24-g4f1b From 311b230cf32dda94102866e56e8dd1ef81b5685b Mon Sep 17 00:00:00 2001 From: Taufan Aditya Date: Mon, 12 Mar 2012 21:49:55 +0700 Subject: Doc --- user_guide_src/source/helpers/path_helper.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/helpers/path_helper.rst b/user_guide_src/source/helpers/path_helper.rst index 6efd93cc1..4a2252834 100644 --- a/user_guide_src/source/helpers/path_helper.rst +++ b/user_guide_src/source/helpers/path_helper.rst @@ -33,8 +33,8 @@ cannot be resolved. $non_existent_file = '/path/to/non-exist-file.txt'; echo set_realpath($non_existent_file, TRUE); // returns an error, as the path could not be resolved echo set_realpath($non_existent_file, FALSE); // returns "/path/to/non-exist-file.txt" - $directory = '/etc/passwd'; - echo set_realpath($directory); // returns "/etc/passwd/" + $directory = '/etc/php5'; + echo set_realpath($directory); // returns "/etc/php5/" $non_existent_directory = '/path/to/nowhere'; echo set_realpath($non_existent_directory, TRUE); // returns an error, as the path could not be resolved echo set_realpath($non_existent_directory, FALSE); // returns "/path/to/nowhere" \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 492aa4207a59bee71390753b1bd25b83f001aae7 Mon Sep 17 00:00:00 2001 From: Michiel Vugteveen Date: Mon, 12 Mar 2012 16:02:45 +0100 Subject: user guide udate --- user_guide_src/source/helpers/form_helper.rst | 265 +++++++++++++++----------- 1 file changed, 152 insertions(+), 113 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/helpers/form_helper.rst b/user_guide_src/source/helpers/form_helper.rst index 3794e0835..95db51d37 100644 --- a/user_guide_src/source/helpers/form_helper.rst +++ b/user_guide_src/source/helpers/form_helper.rst @@ -45,7 +45,7 @@ parameter, like this :: - $attributes = array('class' => 'email', 'id' => 'myform'); + $attributes = array('class' => 'email', 'id' => 'myform'); echo form_open('email/send', $attributes); The above example would create a form similar to this @@ -61,15 +61,15 @@ Hidden fields can be added by passing an associative array to the third paramete :: - $hidden = array('username' => 'Joe', 'member_id' => '234'); + $hidden = array('username' => 'Joe', 'member_id' => '234'); echo form_open('email/send', '', $hidden); The above example would create a form similar to this :: -
- + + form_open_multipart() @@ -87,28 +87,67 @@ name/value string to create one field :: - form_hidden('username', 'johndoe'); + form_hidden('username', 'johndoe'); // Would produce: Or you can submit an associative array to create multiple fields :: - $data = array(                - 'name'  => 'John Doe',                - 'email' => 'john@example.com',                - 'url'   => 'http://example.com'              - ); - - echo form_hidden($data); - + $data = array( + 'name'  => 'John Doe', + 'email' => 'john@example.com', + 'url'   => 'http://example.com' + ); + + echo form_hidden($data); + /* - Would produce: - - + Would produce: + + */ +Or pass an associative array to the values field. + +:: + + $data = array( + 'name'  => 'John Doe', + 'email' => 'john@example.com', + 'url'   => 'http://example.com' + ); + + echo form_hidden('my_array', $data); + + /* + Would produce: + + + + */ + +If you want to create hidden input fields with extra attributes + +:: + + $data = array( + 'type'        => 'hidden', + 'name' => 'email' + 'id'          => 'hiddenemail', + 'value'       => 'john@example.com', + 'class'       => 'hiddenemail' + ); + + echo form_input($data); + + /* + Would produce: + + + */ + form_input() ============ @@ -124,20 +163,20 @@ form to contain :: - $data = array(                - 'name'        => 'username',                - 'id'          => 'username',                - 'value'       => 'johndoe',                - 'maxlength'   => '100',                - 'size'        => '50',                - 'style'       => 'width:50%',              - ); - + $data = array( + 'name'        => 'username', + 'id'          => 'username', + 'value'       => 'johndoe', + 'maxlength'   => '100', + 'size'        => '50', + 'style'       => 'width:50%' + ); + echo form_input($data); - + /* Would produce: - + */ @@ -146,7 +185,7 @@ Javascript, you can pass it as a string in the third parameter :: - $js = 'onClick="some_function()"'; + $js = 'onClick="some_function()"'; echo form_input('username', 'johndoe', $js); form_password() @@ -176,37 +215,37 @@ multiple select for you. Example :: - $options = array(                    - 'small'  => 'Small Shirt',                    - 'med'    => 'Medium Shirt',                    - 'large'   => 'Large Shirt',                    - 'xlarge' => 'Extra Large Shirt',                  - ); - - $shirts_on_sale = array('small', 'large'); - echo form_dropdown('shirts', $options, 'large'); - + $options = array( + 'small'  => 'Small Shirt', + 'med'    => 'Medium Shirt', + 'large'   => 'Large Shirt', + 'xlarge' => 'Extra Large Shirt', + ); + + $shirts_on_sale = array('small', 'large'); + echo form_dropdown('shirts', $options, 'large'); + /* - Would produce: - - + + + + */ - + echo form_dropdown('shirts', $options, $shirts_on_sale); - + /* - Would produce: - - + + + + */ @@ -216,7 +255,7 @@ parameter :: - $js = 'id="shirts" onChange="some_function();"'; + $js = 'id="shirts" onChange="some_function();"'; echo form_dropdown('shirts', $options, 'large', $js); If the array passed as $options is a multidimensional array, @@ -240,38 +279,38 @@ Lets you generate fieldset/legend fields. :: - echo form_fieldset('Address Information'); - echo "

fieldset content here

\n"; + echo form_fieldset('Address Information'); + echo "

fieldset content here

\n"; echo form_fieldset_close(); - + /* Produces: -
- Address Information -

form content here

+
+ Address Information +

form content here

*/ - + Similar to other functions, you can submit an associative array in the second parameter if you prefer to set additional attributes. :: $attributes = array( - 'id' => 'address_info', + 'id' => 'address_info', 'class' => 'address_info' - ); - - echo form_fieldset('Address Information', $attributes); - echo "

fieldset content here

\n"; - echo form_fieldset_close(); - + ); + + echo form_fieldset('Address Information', $attributes); + echo "

fieldset content here

\n"; + echo form_fieldset_close(); + /* - Produces: - -
- Address Information -

form content here

+ Produces: + +
+ Address Information +

form content here

*/ @@ -284,8 +323,8 @@ the tag. For example :: - $string = ""; - echo form_fieldset_close($string); + $string = ""; + echo form_fieldset_close($string); // Would produce:
form_checkbox() @@ -295,7 +334,7 @@ Lets you generate a checkbox field. Simple example :: - echo form_checkbox('newsletter', 'accept', TRUE); + echo form_checkbox('newsletter', 'accept', TRUE); // Would produce: The third parameter contains a boolean TRUE/FALSE to determine whether @@ -306,15 +345,15 @@ array of attributes to the function :: - $data = array(      - 'name'        => 'newsletter',      - 'id'          => 'newsletter',      - 'value'       => 'accept',      - 'checked'     => TRUE,      - 'style'       => 'margin:10px',      - ); - - echo form_checkbox($data); + $data = array( + 'name'        => 'newsletter', + 'id'          => 'newsletter', + 'value'       => 'accept', + 'checked'     => TRUE, + 'style'       => 'margin:10px', + ); + + echo form_checkbox($data); // Would produce: As with other functions, if you would like the tag to contain additional @@ -323,7 +362,7 @@ parameter :: - $js = 'onClick="some_function()"'; + $js = 'onClick="some_function()"'; echo form_checkbox('newsletter', 'accept', TRUE, $js) form_radio() @@ -339,7 +378,7 @@ Lets you generate a standard submit button. Simple example :: - echo form_submit('mysubmit', 'Submit Post!'); + echo form_submit('mysubmit', 'Submit Post!'); // Would produce: Similar to other functions, you can submit an associative array in the @@ -353,7 +392,7 @@ Lets you generate a