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 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 b81f909f8aaa3bedc3820c0d4c9056b57113b46e Mon Sep 17 00:00:00 2001 From: Roger Herbert Date: Mon, 12 Mar 2012 12:46:02 +0000 Subject: updated docs & changelog --- user_guide_src/source/changelog.rst | 1 + user_guide_src/source/helpers/date_helper.rst | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 8579218b0..469461e43 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 an optional third parameter to ``timespan()`` that constrains the number of time units displayed. - Database diff --git a/user_guide_src/source/helpers/date_helper.rst b/user_guide_src/source/helpers/date_helper.rst index ad06dd628..b21d147bd 100644 --- a/user_guide_src/source/helpers/date_helper.rst +++ b/user_guide_src/source/helpers/date_helper.rst @@ -255,14 +255,16 @@ Formats a unix timestamp so that is appears similar to this The first parameter must contain a Unix timestamp. The second parameter must contain a timestamp that is greater that the first timestamp. If -the second parameter empty, the current time will be used. The most -common purpose for this function is to show how much time has elapsed -from some point in time in the past to now. +the second parameter empty, the current time will be used. The third +parameter is optional and limits the number of time units to display. +The most common purpose for this function is to show how much time has +elapsed from some point in time in the past to now. -.. php:method:: timespan($seconds = 1, $time = '') +.. php:method:: timespan($seconds = 1, $time = '', $units = '') :param integer $seconds: a number of seconds :param string $time: Unix timestamp + :param integer $units: a number of time units to display :returns: string Example @@ -271,7 +273,8 @@ Example $post_date = '1079621429'; $now = time(); - echo timespan($post_date, $now); + $units = 2; + echo timespan($post_date, $now, $units); .. note:: The text generated by this function is found in the following language file: language//date_lang.php -- 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
+ // Would produce: form_checkbox() =============== -- cgit v1.2.3-24-g4f1b From 4ad0fd86e8dc6dba74305dbb0c88c593b46a19a2 Mon Sep 17 00:00:00 2001 From: freewil Date: Tue, 13 Mar 2012 22:37:42 -0400 Subject: add support for httponly cookies --- user_guide_src/source/changelog.rst | 2 ++ 1 file changed, 2 insertions(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index f9e742264..de0eb84c2 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -35,6 +35,8 @@ Release Date: Not Released - Removed previously deprecated SHA1 Library. - Removed previously deprecated use of ``$autoload['core']`` in application/config/autoload.php. Only entries in ``$autoload['libraries']`` are auto-loaded now. + - Added support for HttpOnly cookies with new config option ``cookie_httponly`` (Off by default). + This affects session and CSRF cookies, as well as the behavior of set_cookie() in the Input library and cookie helper. - Helpers -- cgit v1.2.3-24-g4f1b From 8840c96cc0608859ad4b5341c31db9bb1f833792 Mon Sep 17 00:00:00 2001 From: freewil Date: Sun, 18 Mar 2012 15:23:09 -0400 Subject: use php's hash() function for do_hash() helper --- user_guide_src/source/changelog.rst | 1 + user_guide_src/source/helpers/security_helper.rst | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 274026481..45bd41beb 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -47,6 +47,7 @@ Release Date: Not Released - 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() can now also handle file paths as opposed to just directories. + - do_hash() now uses PHP's native hash() function, supporting more algorithms. - Database diff --git a/user_guide_src/source/helpers/security_helper.rst b/user_guide_src/source/helpers/security_helper.rst index 01018c61a..b1bcf2b4a 100644 --- a/user_guide_src/source/helpers/security_helper.rst +++ b/user_guide_src/source/helpers/security_helper.rst @@ -34,8 +34,9 @@ More info can be found there. do_hash() ========= -Permits you to create SHA1 or MD5 one way hashes suitable for encrypting -passwords. Will create SHA1 by default. Examples +Permits you to create one way hashes suitable for encrypting +passwords. Will create SHA1 by default. See `hash_algos() `_ +for a full list of supported algorithms. :: @@ -43,7 +44,7 @@ passwords. Will create SHA1 by default. Examples $str = do_hash($str, 'md5'); // MD5 .. note:: This function was formerly named dohash(), which has been - deprecated in favor of `do_hash()`. + removed in favor of `do_hash()`. strip_image_tags() ================== -- cgit v1.2.3-24-g4f1b From 50bff7c06c177f580db956ef5df9a490141de5f6 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 19 Mar 2012 12:16:38 +0200 Subject: Fix possible error messages with do_hash() and alter a changelog entry --- user_guide_src/source/changelog.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 1c709d4d5..5dcf54dd9 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -35,8 +35,6 @@ Release Date: Not Released - Removed previously deprecated SHA1 Library. - Removed previously deprecated use of ``$autoload['core']`` in application/config/autoload.php. Only entries in ``$autoload['libraries']`` are auto-loaded now. - - Added support for HttpOnly cookies with new config option ``cookie_httponly`` (Off by default). - This affects session and CSRF cookies, as well as the behavior of set_cookie() in the Input library and cookie helper. - Helpers @@ -111,6 +109,7 @@ Release Date: Not Released - $config['rewrite_short_tags'] now has no effect when using PHP 5.4 as *`. + - Added support for HTTP-Only cookies with new config option ``cookie_httponly`` (default FALSE). Bug fixes for 3.0 ------------------ -- cgit v1.2.3-24-g4f1b