From ec90216969c2d7bea46a073ecc9c8a95d42f7d92 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 2 Jul 2012 15:57:34 +0300 Subject: Update changelog with changes from 2.1.2 --- user_guide_src/source/changelog.rst | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 50dab92ac..5f38b58b3 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -301,10 +301,18 @@ Bug fixes for 3.0 - Fixed a bug (#427) - :doc:`Form Validation Library ` method ``strip_image_tags()`` was an alias to a non-existent method. - Fixed a bug (#1545) - :doc:`Query Builder ` method ``limit()`` wasn't executed properly under Oracle. +Version 2.1.2 +============= + +Release Date: June 29, 2012 + +- General Changes + - Improved security in ``xss_clean()``. + Version 2.1.1 ============= -Release Date: June 13, 2012 +Release Date: June 12, 2012 - General Changes - Fixed support for docx, xlsx files in mimes.php. @@ -315,20 +323,20 @@ Release Date: June 13, 2012 - Added support for the IP format parameter to the :doc:`Form Validation Library `. - Helpers - - url_title() performance and output improved. You can now use any string as the word delimiter, but 'dash' and 'underscore' are still supported. + - ``url_title()`` performance and output improved. You can now use any string as the word delimiter, but 'dash' and 'underscore' are still supported. Bug fixes for 2.1.1 ------------------- -- Fixed a bug (#697) - A wrong array key was used in the Upload library to check for mime-types. -- Fixed a bug - form_open() compared $action against site_url() instead of base_url(). -- Fixed a bug - CI_Upload::_file_mime_type() could've failed if mime_content_type() is used for the detection and returns FALSE. +- Fixed a bug (#697) - A wrong array key was used in the :doc:`File Uploading Library ` to check for mime-types. +- Fixed a bug - ``form_open()`` compared $action against ``site_url()`` instead of ``base_url()``. +- Fixed a bug - ``CI_Upload::_file_mime_type()`` could've failed if ``mime_content_type()`` is used for the detection and returns FALSE. - Fixed a bug (#538) - Windows paths were ignored when using the :doc:`Image Manipulation Library ` to create a new file. - Fixed a bug - When database caching was enabled, $this->db->query() checked the cache before binding variables which resulted in cached queries never being found. - Fixed a bug - CSRF cookie value was allowed to be any (non-empty) string before being written to the output, making code injection a risk. - Fixed a bug (#726) - PDO put a 'dbname' argument in it's connection string regardless of the database platform in use, which made it impossible to use SQLite. -- Fixed a bug - CI_DB_pdo_driver::num_rows() was not returning properly value with SELECT queries, cause it was relying on PDOStatement::rowCount(). -- Fixed a bug (#1059) - CI_Image_lib::clear() was not correctly clearing all necessary object properties, namely width and height. +- Fixed a bug - ``CI_DB_pdo_driver::num_rows()`` was not returning properly value with SELECT queries, cause it was relying on ``PDOStatement::rowCount()``. +- Fixed a bug (#1059) - ``CI_Image_lib::clear()`` was not correctly clearing all necessary object properties, namely width and height. Version 2.1.0 ============= -- cgit v1.2.3-24-g4f1b From 0cd553566578dd4c23e1541fc837901bdfefa831 Mon Sep 17 00:00:00 2001 From: vlakoff Date: Mon, 2 Jul 2012 15:20:42 +0200 Subject: Update Array Helper documentation default value of the "default value" parameter has changed in element() and elements() methods --- user_guide_src/source/helpers/array_helper.rst | 34 +++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/helpers/array_helper.rst b/user_guide_src/source/helpers/array_helper.rst index 4308753bb..15b5e17c4 100644 --- a/user_guide_src/source/helpers/array_helper.rst +++ b/user_guide_src/source/helpers/array_helper.rst @@ -21,17 +21,17 @@ The following functions are available: element() ========= -.. php:method:: element($item, $array, $default = FALSE) +.. php:method:: element($item, $array, $default = NULL) :param string $item: Item to fetch from the array :param array $array: Input array :param boolean $default: What to return if the array isn't valid - :returns: FALSE on failure or the array item. + :returns: NULL on failure or the array item. Lets you fetch an item from an array. The function tests whether the array index is set and whether it has a value. If a value exists it is -returned. If a value does not exist it returns FALSE, or whatever you've +returned. If a value does not exist it returns NULL, or whatever you've specified as the default value via the third parameter. Example :: @@ -43,31 +43,31 @@ specified as the default value via the third parameter. Example ); echo element('color', $array); // returns "red" - echo element('size', $array, NULL); // returns NULL + echo element('size', $array, 'foobar'); // returns "foobar" elements() ========== Lets you fetch a number of items from an array. The function tests whether each of the array indices is set. If an index does not exist it -is set to FALSE, or whatever you've specified as the default value via +is set to NULL, or whatever you've specified as the default value via the third parameter. -.. php:method:: elements($items, $array, $default = FALSE) +.. php:method:: elements($items, $array, $default = NULL) :param string $item: Item to fetch from the array :param array $array: Input array :param boolean $default: What to return if the array isn't valid - :returns: FALSE on failure or the array item. + :returns: NULL on failure or the array item. Example :: $array = array( - 'color' => 'red',   - 'shape' => 'round',      - 'radius' => '10',      + 'color' => 'red', + 'shape' => 'round', + 'radius' => '10', 'diameter' => '20' ); @@ -78,25 +78,25 @@ The above will return the following array :: array( - 'color' => 'red',      - 'shape' => 'round',      - 'height' => FALSE + 'color' => 'red', + 'shape' => 'round', + 'height' => NULL ); You can set the third parameter to any default value you like :: - $my_shape = elements(array('color', 'shape', 'height'), $array, NULL); + $my_shape = elements(array('color', 'shape', 'height'), $array, 'foobar'); The above will return the following array :: array(      - 'color' => 'red',      - 'shape' => 'round',      - 'height' => NULL + 'color' => 'red', + 'shape' => 'round', + 'height' => 'foobar' ); This is useful when sending the $_POST array to one of your Models. -- cgit v1.2.3-24-g4f1b From a6ea5721bc34fe8666d403637e3bd84772e73566 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 2 Jul 2012 16:33:11 +0300 Subject: Fix issue #1551 --- 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 5f38b58b3..4dc6c3f8e 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -300,6 +300,7 @@ Bug fixes for 3.0 - Fixed a bug (#79) - :doc:`Form Validation Library ` didn't properly validate array fields that use associative keys or have custom indexes. - Fixed a bug (#427) - :doc:`Form Validation Library ` method ``strip_image_tags()`` was an alias to a non-existent method. - Fixed a bug (#1545) - :doc:`Query Builder ` method ``limit()`` wasn't executed properly under Oracle. +- Fixed a bug (#1551) - :doc:`Date Helper ` function ``standard_date()`` didn't properly format *W3C* and *ATOM* standard dates. Version 2.1.2 ============= -- cgit v1.2.3-24-g4f1b From c02e7c5d929d17e3448b944e2279a4c6dc338614 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 2 Jul 2012 16:43:43 +0300 Subject: Add changelog entry for pull #1556 --- 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 4dc6c3f8e..d8b935252 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -175,6 +175,7 @@ Release Date: Not Released - Added support for setting custom attributes. - Deprecated usage of the "anchor_class" setting (use the new "attributes" setting instead). - Added $config['reuse_query_string'] to allow automatic repopulation of query string arguments, combined with normal URI segments. + - Added the ability to use a proxy with the :doc:`XML-RPC Library `. - Core -- cgit v1.2.3-24-g4f1b From 655cfb789ec2a818ab0c8735224db1a4f79cdef0 Mon Sep 17 00:00:00 2001 From: Omar Date: Mon, 2 Jul 2012 13:53:00 -0300 Subject: Added changelog entry --- 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 d2774ca12..a2446259a 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -150,6 +150,7 @@ Release Date: Not Released - Added support for 3-length hex color values for wm_font_color and wm_shadow_color properties, as well as validation for them. - Class properties wm_font_color, wm_shadow_color and wm_use_drop_shadow are now protected, to avoid breaking the text_watermark() method if they are set manually after initialization. - If property maintain_ratio is set to TRUE, image_reproportion() now doesn't need both width and height to be specified. + - Property maintain_ratio is now taken into account when resizing images using ImageMagick 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. - Added $config['csrf_exclude_uris'] to the CSRF protection in the :doc:`Security library `, which allows you list URIs which will not have the CSRF validation functions run. -- cgit v1.2.3-24-g4f1b From f3ab257d9f4efdb9658135fae89f3c3eec6b6a47 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Mon, 2 Jul 2012 11:12:44 -0700 Subject: Adding contribution guidelines to user guide, including new Developer's Certificate of Origin --- user_guide_src/source/DCO.rst | 27 +++ user_guide_src/source/contributing/index.rst | 105 ++++++++++++ user_guide_src/source/index.rst | 11 ++ user_guide_src/source/license_afl.rst | 245 +++++++++++++++++++++++++++ 4 files changed, 388 insertions(+) create mode 100644 user_guide_src/source/DCO.rst create mode 100644 user_guide_src/source/contributing/index.rst create mode 100644 user_guide_src/source/license_afl.rst (limited to 'user_guide_src') diff --git a/user_guide_src/source/DCO.rst b/user_guide_src/source/DCO.rst new file mode 100644 index 000000000..c8f9b49c6 --- /dev/null +++ b/user_guide_src/source/DCO.rst @@ -0,0 +1,27 @@ +##################################### +Developer's Certificate of Origin 1.1 +##################################### + +By making a contribution to this project, I certify that: + +(1) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +(2) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +(3) The contribution was provided directly to me by some other + person who certified (1), (2) or (3) and I have not modified + it. + +(4) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. diff --git a/user_guide_src/source/contributing/index.rst b/user_guide_src/source/contributing/index.rst new file mode 100644 index 000000000..2ede0e6e5 --- /dev/null +++ b/user_guide_src/source/contributing/index.rst @@ -0,0 +1,105 @@ +########################### +Contributing to CodeIgniter +########################### + +CodeIgniter is a community driven project and accepts contributions of code +and documentation from the community. These contributions are made in the form +of Issues or `Pull Requests `_ on +the `EllisLab CodeIgniter repository +`_ on GitHub. + +Issues are a quick way to point out a bug. If you find a bug or documentation +error in CodeIgniter then please check a few things first: + +- There is not already an open Issue +- The issue has already been fixed (check the develop branch, or look for + closed Issues) +- Is it something really obvious that you fix it yourself? + +Reporting issues is helpful but an even better approach is to send a Pull +Request, which is done by "Forking" the main repository and committing to your +own copy. This will require you to use the version control system called Git. + +********** +Guidelines +********** + +Before we look into how, here are the guidelines. If your Pull Requests fail +to pass these guidelines it will be declined and you will need to re-submit +when you’ve made the changes. This might sound a bit tough, but it is required +for us to maintain quality of the code-base. + +PHP Style +========= + +All code must meet the `Style Guide +`_, which is +essentially the `Allman indent style +`_, underscores and +readable operators. This makes certain that all code is the same format as the +existing code and means it will be as readable as possible. + +Documentation +============= + +If you change anything that requires a change to documentation then you will +need to add it. New classes, methods, parameters, changing default values, etc +are all things that will require a change to documentation. The change-log +must also be updated for every change. Also PHPDoc blocks must be maintained. + +Compatibility +============= + +CodeIgniter is compatible with PHP 5.2.4 so all code supplied must stick to +this requirement. If PHP 5.3 or 5.4 functions or features are used then there +must be a fallback for PHP 5.2.4. + +Branching +========= + +CodeIgniter uses the `Git-Flow +`_ branching model +which requires all pull requests to be sent to the "develop" branch. This is +where the next planned version will be developed. The "master" branch will +always contain the latest stable version and is kept clean so a "hotfix" (e.g: +an emergency security patch) can be applied to master to create a new version, +without worrying about other features holding it up. For this reason all +commits need to be made to "develop" and any sent to "master" will be closed +automatically. If you have multiple changes to submit, please place all +changes into their own branch on your fork. + +One thing at a time: A pull request should only contain one change. That does +not mean only one commit, but one change - however many commits it took. The +reason for this is that if you change X and Y but send a pull request for both +at the same time, we might really want X but disagree with Y, meaning we +cannot merge the request. Using the Git-Flow branching model you can create +new branches for both of these features and send two requests. + +Signing +======= +You must sign your work, certifying that you either wrote the work or +otherwise have the right to pass it on to an open source project. git makes +this trivial as you merely have to use `--signoff` on your commits to your +CodeIgniter fork. + +.. code-block:: bash + + git commit --signoff + +or simply + +.. code-block:: bash + + git commit -s + +This will sign your commits with the information setup in your git config, e.g. + + Signed-off-by: John Q Public + +If you are using Tower there is a "Sign-Off" checkbox in the commit window. You +could even alias git commit to use the -s flag so you don’t have to think about +it. + +By signing your work in this manner, you certify to a "Developer's Certificate +or Origin". The current version of this certificate is in the :doc:`/DCO` file +in the root of this documentation. diff --git a/user_guide_src/source/index.rst b/user_guide_src/source/index.rst index c89b41c74..a349d8bce 100644 --- a/user_guide_src/source/index.rst +++ b/user_guide_src/source/index.rst @@ -91,6 +91,17 @@ Helper Reference helpers/index +*************************** +Contributing to CodeIgniter +*************************** + +.. toctree:: + :glob: + :titlesonly: + + contributing/index + DCO + .. toctree:: :glob: :titlesonly: diff --git a/user_guide_src/source/license_afl.rst b/user_guide_src/source/license_afl.rst new file mode 100644 index 000000000..ca39be9b6 --- /dev/null +++ b/user_guide_src/source/license_afl.rst @@ -0,0 +1,245 @@ +################################### +Academic Free License ("AFL") v 3.0 +################################### + +This Academic Free License (the "License") applies to any original work of +authorship (the "Original Work") whose owner (the "Licensor") has placed the +following licensing notice adjacent to the copyright notice for the Original +Work: + +*Licensed under the Academic Free License version 3.0* + + +***************************** +1) Grant of Copyright License +***************************** + +Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable +license, for the duration of the copyright, to do the following: + + *a)* to reproduce the Original Work in copies, either alone or as part of + a collective work; + + *b)* to translate, adapt, alter, transform, modify, or arrange the + Original Work, thereby creating derivative works ("Derivative Works") + based upon the Original Work; + + *c)* to distribute or communicate copies of the Original Work and + Derivative Works to the public, *under any license of your choice that + does not contradict the terms and conditions, including Licensor's + reserved rights and remedies, in this Academic Free License*; + + *d)* to perform the Original Work publicly; and + + *e)* to display the Original Work publicly. + + +************************** +2) Grant of Patent License +************************** + +Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable +license, under patent claims owned or controlled by the Licensor that are +embodied in the Original Work as furnished by the Licensor, for the duration +of the patents, to make, use, sell, offer for sale, have made, and import the +Original Work and Derivative Works. + + +******************************* +3) Grant of Source Code License +******************************* + +The term "Source Code" means the preferred form of the Original Work for +making modifications to it and all available documentation describing how to +modify the Original Work. Licensor agrees to provide a machine-readable copy +of the Source Code of the Original Work along with each copy of the Original +Work that Licensor distributes. Licensor reserves the right to satisfy this +obligation by placing a machine-readable copy of the Source Code in an +information repository reasonably calculated to permit inexpensive and +convenient access by You for as long as Licensor continues to distribute the +Original Work. + + +******************************** +4) Exclusions From License Grant +******************************** + +Neither the names of Licensor, nor the names of any contributors to the +Original Work, nor any of their trademarks or service marks, may be used to +endorse or promote products derived from this Original Work without express +prior permission of the Licensor. Except as expressly stated herein, nothing +in this License grants any license to Licensor's trademarks, copyrights, +patents, trade secrets or any other intellectual property. No patent license +is granted to make, use, sell, offer for sale, have made, or import +embodiments of any patent claims other than the licensed claims defined in +Section 2) No license is granted to the trademarks of Licensor even if such +marks are included in the Original Work. Nothing in this License shall be +interpreted to prohibit Licensor from licensing under terms different from +this License any Original Work that Licensor otherwise would have a right to +license. + + +********************** +5) External Deployment +********************** + +The term "External Deployment" means the use, distribution, or communication +of the Original Work or Derivative Works in any way such that the Original +Work or Derivative Works may be used by anyone other than You, whether those +works are distributed or communicated to those persons or made available as an +application intended for use over a network. As an express condition for the +grants of license hereunder, You must treat any External Deployment by You of +the Original Work or a Derivative Work as a distribution under section 1(c). + + +********************* +6) Attribution Rights +********************* + +You must retain, in the Source Code of any Derivative Works that You create, +all copyright, patent, or trademark notices from the Source Code of the +Original Work, as well as any notices of licensing and any descriptive text +identified therein as an "Attribution Notice." You must cause the Source Code +for any Derivative Works that You create to carry a prominent Attribution +Notice reasonably calculated to inform recipients that You have modified the +Original Work. + + +**************************************************** +7) Warranty of Provenance and Disclaimer of Warranty +**************************************************** + +Licensor warrants that the copyright in and to the Original Work and the +patent rights granted herein by Licensor are owned by the Licensor or are +sublicensed to You under the terms of this License with the permission of the +contributor(s) of those copyrights and patent rights. Except as expressly +stated in the immediately preceding sentence, the Original Work is provided +under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or +implied, including, without limitation, the warranties of non-infringement, +merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE +QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY +constitutes an essential part of this License. No license to the Original Work +is granted by this License except under this disclaimer. + + +************************** +8) Limitation of Liability +************************** + +Under no circumstances and under no legal theory, whether in tort (including +negligence), contract, or otherwise, shall the Licensor be liable to anyone +for any indirect, special, incidental, or consequential damages of any +character arising as a result of this License or the use of the Original Work +including, without limitation, damages for loss of goodwill, work stoppage, +computer failure or malfunction, or any and all other commercial damages or +losses. This limitation of liability shall not apply to the extent applicable +law prohibits such limitation. + + +***************************** +9) Acceptance and Termination +***************************** + +If, at any time, You expressly assented to this License, that assent indicates +your clear and irrevocable acceptance of this License and all of its terms and +conditions. If You distribute or communicate copies of the Original Work or a +Derivative Work, You must make a reasonable effort under the circumstances to +obtain the express assent of recipients to the terms of this License. This +License conditions your rights to undertake the activities listed in Section +1, including your right to create Derivative Works based upon the Original +Work, and doing so without honoring these terms and conditions is prohibited +by copyright law and international treaty. Nothing in this License is intended +to affect copyright exceptions and limitations (including "fair use" or "fair +dealing"). This License shall terminate immediately and You may no longer +exercise any of the rights granted to You by this License upon your failure to +honor the conditions in Section 1(c). + + +********************************* +10) Termination for Patent Action +********************************* + +This License shall terminate automatically and You may no longer exercise any +of the rights granted to You by this License as of the date You commence an +action, including a cross-claim or counterclaim, against Licensor or any +licensee alleging that the Original Work infringes a patent. This termination +provision shall not apply for an action alleging patent infringement by +combinations of the Original Work with other software or hardware. + + +***************************************** +11) Jurisdiction, Venue and Governing Law +***************************************** + +Any action or suit relating to this License may be brought only in the courts +of a jurisdiction wherein the Licensor resides or in which Licensor conducts +its primary business, and under the laws of that jurisdiction excluding its +conflict-of-law provisions. The application of the United Nations Convention +on Contracts for the International Sale of Goods is expressly excluded. Any +use of the Original Work outside the scope of this License or after its +termination shall be subject to the requirements and penalties of copyright or +patent law in the appropriate jurisdiction. This section shall survive the +termination of this License. + + +******************* +12) Attorneys' Fees +******************* + +In any action to enforce the terms of this License or seeking damages relating +thereto, the prevailing party shall be entitled to recover its costs and +expenses, including, without limitation, reasonable attorneys' fees and costs +incurred in connection with such action, including any appeal of such action. +This section shall survive the termination of this License. + + +***************** +13) Miscellaneous +***************** + +If any provision of this License is held to be unenforceable, such provision +shall be reformed only to the extent necessary to make it enforceable. + + +*************************************** +14) Definition of "You" in This License +*************************************** + +"You" throughout this License, whether in upper or lower case, means an +individual or a legal entity exercising rights under, and complying with all +of the terms of, this License. For legal entities, "You" includes any entity +that controls, is controlled by, or is under common control with you. For +purposes of this definition, "control" means (i) the power, direct or +indirect, to cause the direction or management of such entity, whether by +contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + + +**************** +15) Right to Use +**************** + +You may use the Original Work in all ways not otherwise restricted or +conditioned by this License or by law, and Licensor promises not to interfere +with or be responsible for such uses by You. + + +******************************** +16) Modification of This License +******************************** + +This License is Copyright © 2005 Lawrence Rosen. Permission is granted to +copy, distribute, or communicate this License without modification. Nothing in +this License permits You to modify this License as applied to the Original +Work or to Derivative Works. However, You may modify the text of this License +and copy, distribute or communicate your modified version (the "Modified +License") and apply it to other original works of authorship subject to the +following conditions: (i) You may not indicate in any way that your Modified +License is the "Academic Free License" or "AFL" and you may not use those +names in the name of your Modified License; (ii) You must replace the notice +specified in the first paragraph above with the notice "Licensed under " or with a notice of your own that is not confusingly +similar to the notice in this License; and (iii) You may not claim that your +original works are open source software unless your Modified License has been +approved by Open Source Initiative (OSI) and You comply with its license +review and certification process. \ No newline at end of file -- cgit v1.2.3-24-g4f1b From cf9431e294abc921cf9fe4b9228086d65bd27939 Mon Sep 17 00:00:00 2001 From: vlakoff Date: Tue, 3 Jul 2012 07:01:38 +0200 Subject: Document in the 3.0.0 upgrade guide a breaking change in Array Helper The default return value of Array Helper's element() and elements() functions, when the required elements don't exist, has been changed from FALSE to NULL. --- user_guide_src/source/installation/upgrade_300.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/installation/upgrade_300.rst b/user_guide_src/source/installation/upgrade_300.rst index 14199092f..676c99e6a 100644 --- a/user_guide_src/source/installation/upgrade_300.rst +++ b/user_guide_src/source/installation/upgrade_300.rst @@ -45,4 +45,10 @@ need to rename the `$active_record` variable to `$query_builder`. Step 5: Move your errors folder =============================== -In version 3.0.0, the errors folder has been moved from _application/errors* to _application/views/errors*. \ No newline at end of file +In version 3.0.0, the errors folder has been moved from _application/errors* to _application/views/errors*. + +Step 6: Check the calls to Array Helper's element() and elements() functions +============================================================================ + +The default return value of these functions, when the required elements +don't exist, has been changed from FALSE to NULL. \ No newline at end of file -- cgit v1.2.3-24-g4f1b From f2dcca6f9212923e54fb62ae58f79dc713b111ad Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 3 Jul 2012 16:05:34 +0300 Subject: Update the upgrade notes --- user_guide_src/source/installation/downloads.rst | 8 +- user_guide_src/source/installation/upgrade_210.rst | 8 +- user_guide_src/source/installation/upgrade_211.rst | 33 ++++++++ user_guide_src/source/installation/upgrade_212.rst | 16 ++++ user_guide_src/source/installation/upgrade_300.rst | 97 ++++++++++++++++++---- user_guide_src/source/installation/upgrading.rst | 3 +- 6 files changed, 141 insertions(+), 24 deletions(-) create mode 100644 user_guide_src/source/installation/upgrade_211.rst create mode 100644 user_guide_src/source/installation/upgrade_212.rst (limited to 'user_guide_src') diff --git a/user_guide_src/source/installation/downloads.rst b/user_guide_src/source/installation/downloads.rst index a4a6b7fbe..45a8f80a7 100644 --- a/user_guide_src/source/installation/downloads.rst +++ b/user_guide_src/source/installation/downloads.rst @@ -2,8 +2,14 @@ Downloading CodeIgniter ####################### -- `CodeIgniter V 2.1.0 (Current +- `CodeIgniter V 3.0.0 (Current version) `_ +- `CodeIgniter V + 2.1.2 `_ +- `CodeIgniter V + 2.1.1 `_ +- `CodeIgniter V + 2.1.0 `_ - `CodeIgniter V 2.0.3 `_ - `CodeIgniter V diff --git a/user_guide_src/source/installation/upgrade_210.rst b/user_guide_src/source/installation/upgrade_210.rst index 9d7e1a265..647537d1f 100644 --- a/user_guide_src/source/installation/upgrade_210.rst +++ b/user_guide_src/source/installation/upgrade_210.rst @@ -12,11 +12,11 @@ Replace all files and directories in your "system" folder and replace your index.php file. If any modifications were made to your index.php they will need to be made fresh in this new one. +.. note:: If you have any custom developed files in these folders please + make copies of them first. + Step 2: Replace config/user_agents.php ====================================== This config file has been updated to contain more user agent types, -please copy it to application/config/user_agents.php. - -.. note:: If you have any custom developed files in these folders please - make copies of them first. \ No newline at end of file +please copy it to _application/config/user_agents.php*. \ No newline at end of file diff --git a/user_guide_src/source/installation/upgrade_211.rst b/user_guide_src/source/installation/upgrade_211.rst new file mode 100644 index 000000000..80248a758 --- /dev/null +++ b/user_guide_src/source/installation/upgrade_211.rst @@ -0,0 +1,33 @@ +############################# +Upgrading from 2.1.0 to 2.1.1 +############################# + +Before performing an update you should take your site offline by +replacing the index.php file with a static one. + +Step 1: Update your CodeIgniter files +===================================== + +Replace all files and directories in your "system" folder and replace +your index.php file. If any modifications were made to your index.php +they will need to be made fresh in this new one. + +.. note:: If you have any custom developed files in these folders please + make copies of them first. + +Step 2: Replace config/mimes.php +================================ + +This config file has been updated to contain more user mime-types, please copy +it to _application/config/mimes.php*. + +Step 3: Update your IP address tables +===================================== + +This upgrade adds support for IPv6 IP addresses. In order to store them, you need +to enlarge your ip_address columns to 45 characters. For example, CodeIgniter's +session table will need to change + +:: + + ALTER TABLE ci_sessions CHANGE ip_address ip_address varchar(45) default '0' NOT NULL diff --git a/user_guide_src/source/installation/upgrade_212.rst b/user_guide_src/source/installation/upgrade_212.rst new file mode 100644 index 000000000..cdbf977d7 --- /dev/null +++ b/user_guide_src/source/installation/upgrade_212.rst @@ -0,0 +1,16 @@ +############################# +Upgrading from 2.1.1 to 2.1.2 +############################# + +Before performing an update you should take your site offline by +replacing the index.php file with a static one. + +Step 1: Update your CodeIgniter files +===================================== + +Replace all files and directories in your "system" folder and replace +your index.php file. If any modifications were made to your index.php +they will need to be made fresh in this new one. + +.. note:: If you have any custom developed files in these folders please + make copies of them first. \ No newline at end of file diff --git a/user_guide_src/source/installation/upgrade_300.rst b/user_guide_src/source/installation/upgrade_300.rst index 676c99e6a..7b0d8abe9 100644 --- a/user_guide_src/source/installation/upgrade_300.rst +++ b/user_guide_src/source/installation/upgrade_300.rst @@ -1,15 +1,14 @@ ############################# -Upgrading from 2.1.0 to 3.0.0 +Upgrading from 2.1.2 to 3.0.0 ############################# .. note:: These upgrade notes are for a version that is yet to be released. +Before performing an update you should take your site offline by replacing the index.php file with a static one. -Before performing an update you should take your site offline by -replacing the index.php file with a static one. - +************************************* Step 1: Update your CodeIgniter files -===================================== +************************************* Replace all files and directories in your "system" folder and replace your index.php file. If any modifications were made to your index.php @@ -18,22 +17,23 @@ they will need to be made fresh in this new one. .. note:: If you have any custom developed files in these folders please make copies of them first. -Step 2: Change References to the SHA Library -============================================ - -The previously deprecated SHA library has been removed in CodeIgniter 3.0. -Alter your code to use the native `sha1()` PHP function to generate a sha1 hash. +******************************** +Step 2: Replace config/mimes.php +******************************** -Additionally, the `sha1()` method in the :doc:`Encryption Library <../libraries/encryption>` has been removed. +This config file has been updated to contain more user mime-types, please copy +it to _application/config/mimes.php*. +************************************************************** Step 3: Remove $autoload['core'] from your config/autoload.php -============================================================== +************************************************************** -Use of the `$autoload['core']` config array has been deprecated as of CodeIgniter 1.4.1 and is now removed. -Move any entries that you might have listed there to `$autoload['libraries']` instead. +Use of the ``$autoload['core']`` config array has been deprecated as of CodeIgniter 1.4.1 and is now removed. +Move any entries that you might have listed there to ``$autoload['libraries']`` instead. +*************************************** Step 4: Update your config/database.php -======================================= +*************************************** Due to 3.0.0's renaming of Active Record to Query Builder, inside your `config/database.php`, you will need to rename the `$active_record` variable to `$query_builder`. @@ -42,13 +42,74 @@ need to rename the `$active_record` variable to `$query_builder`. // $active_record = TRUE; $query_builder = TRUE; +******************************* Step 5: Move your errors folder -=============================== +******************************* In version 3.0.0, the errors folder has been moved from _application/errors* to _application/views/errors*. +**************************************************************************** Step 6: Check the calls to Array Helper's element() and elements() functions -============================================================================ +**************************************************************************** The default return value of these functions, when the required elements -don't exist, has been changed from FALSE to NULL. \ No newline at end of file +don't exist, has been changed from FALSE to NULL. + +*************************************************************** +Step 7: Remove usage of (previously) deprecated functionalities +*************************************************************** + +In addition to the ``$autoload['core']`` configuration setting, there's a number of other functionalities +that have been removed in CodeIgniter 3.0.0: + +The SHA1 library +================ + +The previously deprecated SHA1 library has been removed, alter your code to use PHP's native +``sha1()`` function to generate a SHA1 hash. + +Additionally, the ``sha1()`` method in the :doc:`Encryption Library <../libraries/encryption>` has been removed. + +The EXT constant +================ + +Usage of the ``EXT`` constant has been deprecated since dropping support for PHP 4. There's no +longer a need to maintain different filename extensions and in this new CodeIgniter version, +the ``EXT`` constant has been removed. Use just '.php' instead. + +Smiley helper js_insert_smiley() +================================ + +:doc:`Smiley Helper <../helpers/smiley_helper>` function ``js_insert_smiley()`` has been deprecated +since CodeIgniter 1.7.2 and is now removed. You'll need to switch to ``smiley_js()`` instead. + +Security helper do_hash() +========================= + +:doc:`Security Helper <../helpers/security_helper>` function ``do_hash()`` is now just an alias for +PHP's native ``hash()`` function. It is deprecated and scheduled for removal in CodeIgniter 3.1+. + +.. note:: This function is still available, but you're strongly encouraged to remove it's usage sooner + rather than later. + +File helper read_file() +======================= + +:doc:`File Helper <../helpers/file_helper>` function ``read_file()`` is now just an alias for +PHP's native ``file_get_contents()`` function. It is deprecated and scheduled for removal in +CodeIgniter 3.1+. + +.. note:: This function is still available, but you're strongly encouraged to remove it's usage sooner + rather than later. + +Pagination library 'anchor_class' setting +========================================= + +The :doc:`Pagination Library <../libraries/pagination>` now supports adding pretty much any HTML +attribute to your anchors via the 'attributes' configuration setting. This includes passing the +'class' attribute and using the separate 'anchor_class' setting no longer makes sense. +As a result of that, the 'anchor_class' setting is now deprecated and scheduled for removal in +CodeIgniter 3.1+. + +.. note:: This setting is still available, but you're strongly encouraged to remove it's usage sooner + rather than later. \ No newline at end of file diff --git a/user_guide_src/source/installation/upgrading.rst b/user_guide_src/source/installation/upgrading.rst index 255c6a557..3609e4213 100644 --- a/user_guide_src/source/installation/upgrading.rst +++ b/user_guide_src/source/installation/upgrading.rst @@ -5,7 +5,8 @@ Upgrading From a Previous Version Please read the upgrade notes corresponding to the version you are upgrading from. -- :doc:`Upgrading from 2.1.1 to 3.0.0 ` +- :doc:`Upgrading from 2.1.2 to 3.0.0 ` +- :doc:`Upgrading from 2.1.1 to 2.1.2 ` - :doc:`Upgrading from 2.1.0 to 2.1.1 ` - :doc:`Upgrading from 2.0.2 to 2.0.3 ` - :doc:`Upgrading from 2.0.1 to 2.0.2 ` -- cgit v1.2.3-24-g4f1b From b94b91afc77bcc133ff282559015933602bb2d3f Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 4 Jul 2012 12:32:14 +0300 Subject: Some user guide updates --- user_guide_src/source/database/configuration.rst | 122 +++++++++++++---------- user_guide_src/source/database/connecting.rst | 34 ++++--- user_guide_src/source/general/models.rst | 61 ++++++------ 3 files changed, 118 insertions(+), 99 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/database/configuration.rst b/user_guide_src/source/database/configuration.rst index 7a19c840f..c17de600a 100644 --- a/user_guide_src/source/database/configuration.rst +++ b/user_guide_src/source/database/configuration.rst @@ -12,26 +12,44 @@ it the respective environment config folder. The config settings are stored in a multi-dimensional array with this prototype:: - $db['default']['hostname'] = "localhost"; - $db['default']['username'] = "root"; - $db['default']['password'] = ""; - $db['default']['database'] = "database_name"; - $db['default']['dbdriver'] = "mysql"; - $db['default']['dbprefix'] = ""; - $db['default']['pconnect'] = TRUE; - $db['default']['db_debug'] = FALSE; - $db['default']['cache_on'] = FALSE; - $db['default']['cachedir'] = ""; - $db['default']['char_set'] = "utf8"; - $db['default']['dbcollat'] = "utf8_general_ci"; - $db['default']['swap_pre'] = ""; - $db['default']['autoinit'] = TRUE; - $db['default']['stricton'] = FALSE; - -If you use PDO as your dbdriver, you can specify the full DSN string describe a connection to the database like this:: - + $db['default'] = array( + 'dsn' => '', + 'hostname' => 'localhost', + 'username' => 'root', + 'password' => '', + 'database' => 'database_name', + 'dbdriver' => 'mysqli', + 'dbprefix' => '', + 'pconnect' => TRUE, + 'db_debug' => TRUE, + 'cache_on' => FALSE, + 'cachedir' => '', + 'char_set' => 'utf8', + 'dbcollat' => 'utf8_general_ci', + 'swap_pre' => '', + 'autoinit' => TRUE, + 'stricton' => FALSE, + 'failover' => array() + ); + +Some database drivers (such as PDO, PostgreSQL, Oracle, ODBC) might +require a full DSN string to be provided. If that is the case, you +should use the 'dsn' configuration setting, as if you're using the +driver's underlying native PHP extension, like this:: + + // PDO $db['default']['dsn'] = 'pgsql:host=localhost;port=5432;dbname=database_name'; + // Oracle + $db['default']['dsn'] = '//localhost/XE'; + +.. note:: If you do not specify a DSN string for a driver that requires it, CodeIgniter + will try to build it with the rest of the provided settings. + +.. note:: If you provide a DSN string and it is missing some valid settings (e.g. the + database character set), which are present in the rest of the configuration + fields, CodeIgniter will append them. + You can also specify failovers for the situation when the main connection cannot connect for some reason. These failovers can be specified by setting the failover for a connection like this:: @@ -41,7 +59,7 @@ These failovers can be specified by setting the failover for a connection like t 'username' => '', 'password' => '', 'database' => '', - 'dbdriver' => 'mysql', + 'dbdriver' => 'mysqli', 'dbprefix' => '', 'pconnect' => TRUE, 'db_debug' => TRUE, @@ -58,7 +76,7 @@ These failovers can be specified by setting the failover for a connection like t 'username' => '', 'password' => '', 'database' => '', - 'dbdriver' => 'mysql', + 'dbdriver' => 'mysqli', 'dbprefix' => '', 'pconnect' => TRUE, 'db_debug' => TRUE, @@ -81,30 +99,34 @@ production, test, etc.) under a single installation, you can set up a connection group for each, then switch between groups as needed. For example, to set up a "test" environment you would do this:: - $db['test']['hostname'] = "localhost"; - $db['test']['username'] = "root"; - $db['test']['password'] = ""; - $db['test']['database'] = "database_name"; - $db['test']['dbdriver'] = "mysql"; - $db['test']['dbprefix'] = ""; - $db['test']['pconnect'] = TRUE; - $db['test']['db_debug'] = FALSE; - $db['test']['cache_on'] = FALSE; - $db['test']['cachedir'] = ""; - $db['test']['char_set'] = "utf8"; - $db['test']['dbcollat'] = "utf8_general_ci"; - $db['test']['swap_pre'] = ""; - $db['test']['autoinit'] = TRUE; - $db['test']['stricton'] = FALSE; + $db['test'] = array( + 'dsn' => '', + 'hostname' => 'localhost', + 'username' => 'root', + 'password' => '', + 'database' => 'database_name', + 'dbdriver' => 'mysqli', + 'dbprefix' => '', + 'pconnect' => TRUE, + 'db_debug' => TRUE, + 'cache_on' => FALSE, + 'cachedir' => '', + 'char_set' => 'utf8', + 'dbcollat' => 'utf8_general_ci', + 'swap_pre' => '', + 'autoinit' => TRUE, + 'stricton' => FALSE, + 'failover' => array() + ); Then, to globally tell the system to use that group you would set this variable located in the config file:: - $active_group = "test"; + $active_group = 'test'; -Note: The name "test" is arbitrary. It can be anything you want. By -default we've used the word "default" for the primary connection, but it -too can be renamed to something more relevant to your project. +.. note:: The name 'test' is arbitrary. It can be anything you want. By + default we've used the word "default" for the primary connection, + but it too can be renamed to something more relevant to your project. Query Builder ------------- @@ -119,8 +141,8 @@ when the database classes are initialized. $query_builder = TRUE; -.. note:: that some CodeIgniter classes such as Sessions require Active - Records be enabled to access certain functionality. +.. note:: that some CodeIgniter classes such as Sessions require Query + Builder to be enabled to access certain functionality. Explanation of Values: ---------------------- @@ -128,11 +150,12 @@ Explanation of Values: ====================== ================================================================================================== Name Config Description ====================== ================================================================================================== -**hostname** The hostname of your database server. Often this is "localhost". +**dsn** The DSN connect string (an all-in-one configuration sequence). +**hostname** The hostname of your database server. Often this is 'localhost'. **username** The username used to connect to the database. **password** The password used to connect to the database. **database** The name of the database you want to connect to. -**dbdriver** The database type. ie: mysql, postgre, odbc, etc. Must be specified in lower case. +**dbdriver** The database type. ie: mysqli, postgre, odbc, etc. Must be specified in lower case. **dbprefix** An optional table prefix which will added to the table name when running :doc: `Query Builder ` queries. This permits multiple CodeIgniter installations to share one database. @@ -144,14 +167,7 @@ Explanation of Values: **char_set** The character set used in communicating with the database. **dbcollat** The character collation used in communicating with the database - .. note:: For MySQL and MySQLi databases, this setting is only used - as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7 - (and in table creation queries made with DB Forge). There is an - incompatibility in PHP with mysql_real_escape_string() which can - make your site vulnerable to SQL injection if you are using a - multi-byte character set and are running versions lower than these. - Sites using Latin-1 or UTF-8 database character set and collation are - unaffected. + .. note:: Only used in the 'mysql' and 'mysqli' drivers. **swap_pre** A default table prefix that should be swapped with dbprefix. This is useful for distributed applications where you might run manually written queries, and need the prefix to still be @@ -163,11 +179,11 @@ Explanation of Values: **port** The database port number. To use this value you have to add a line to the database config array. :: - $db['default']['port'] = 5432; + $db['default']['port'] = 5432; ====================== ================================================================================================== .. note:: Depending on what database platform you are using (MySQL, PostgreSQL, etc.) not all values will be needed. For example, when using SQLite you will not need to supply a username or password, and the database name will be the path to your database file. The information above assumes - you are using MySQL. + you are using MySQL. \ No newline at end of file diff --git a/user_guide_src/source/database/connecting.rst b/user_guide_src/source/database/connecting.rst index 5822ca62c..9b8117076 100644 --- a/user_guide_src/source/database/connecting.rst +++ b/user_guide_src/source/database/connecting.rst @@ -57,25 +57,28 @@ file. To connect manually to a desired database you can pass an array of values:: - $config['hostname'] = "localhost"; - $config['username'] = "myusername"; - $config['password'] = "mypassword"; - $config['database'] = "mydatabase"; - $config['dbdriver'] = "mysql"; - $config['dbprefix'] = ""; - $config['pconnect'] = FALSE; - $config['db_debug'] = TRUE; - $config['cache_on'] = FALSE; - $config['cachedir'] = ""; - $config['char_set'] = "utf8"; - $config['dbcollat'] = "utf8_general_ci"; + $config['hostname'] = 'localhost'; + $config['username'] = 'myusername'; + $config['password'] = 'mypassword'; + $config['database'] = 'mydatabase'; + $config['dbdriver'] = 'mysqli'; + $config['dbprefix'] = ''; + $config['pconnect'] = FALSE; + $config['db_debug'] = TRUE; + $config['cache_on'] = FALSE; + $config['cachedir'] = ''; + $config['char_set'] = 'utf8'; + $config['dbcollat'] = 'utf8_general_ci'; $this->load->database($config); For information on each of these values please see the :doc:`configuration page `. -.. note:: For the PDO driver, $config['hostname'] should look like - this: 'mysql:host=localhost' +.. note:: For the PDO driver, you should use the $config['dsn'] setting + instead of 'hostname' and 'database': + + | + | $config['dsn'] = 'mysql:host=localhost;dbname=mydatabase'; Or you can submit your database values as a Data Source Name. DSNs must have this prototype:: @@ -149,5 +152,4 @@ connections, you can explicitly close the connection. :: - $this->db->close(); - + $this->db->close(); \ No newline at end of file diff --git a/user_guide_src/source/general/models.rst b/user_guide_src/source/general/models.rst index 2e1e025ee..4e52a9648 100644 --- a/user_guide_src/source/general/models.rst +++ b/user_guide_src/source/general/models.rst @@ -72,10 +72,11 @@ The basic prototype for a model class is this:: class Model_name extends CI_Model { - function __construct() - { - parent::__construct(); - } + public function __construct() + { + parent::__construct(); + } + } Where **Model_name** is the name of your class. Class names **must** have @@ -87,10 +88,11 @@ example, if your class is this:: class User_model extends CI_Model { - function __construct() - { - parent::__construct(); - } + public function __construct() + { + parent::__construct(); + } + } Your file will be this:: @@ -102,7 +104,7 @@ Loading a Model Your models will typically be loaded and called from within your :doc:`controller ` functions. To load a model you will use -the following function:: +the following method:: $this->load->model('model_name'); @@ -112,33 +114,34 @@ application/models/blog/queries.php you'll load it using:: $this->load->model('blog/queries'); -Once loaded, you will access your model functions using an object with -the same name as your class:: +Once loaded, you will access your model methods using an object with the +same name as your class:: $this->load->model('model_name'); - $this->model_name->function(); + $this->model_name->method(); If you would like your model assigned to a different object name you can -specify it via the second parameter of the loading function:: +specify it via the second parameter of the loading method:: - $this->load->model('model_name', 'fubar'); + $this->load->model('model_name', 'foobar'); - $this->fubar->function(); + $this->foobar->method(); Here is an example of a controller, that loads a model, then serves a view:: class Blog_controller extends CI_Controller { - function blog() - { - $this->load->model('blog'); + public function blog() + { + $this->load->model('blog'); - $data['query'] = $this->Blog->get_last_ten_entries(); + $data['query'] = $this->Blog->get_last_ten_entries(); + + $this->load->view('blog', $data); + } - $this->load->view('blog', $data); - } } @@ -170,15 +173,13 @@ database. The following options for connecting are available to you: - You can manually pass database connectivity settings via the third parameter:: - $config['hostname'] = "localhost"; - $config['username'] = "myusername"; - $config['password'] = "mypassword"; - $config['database'] = "mydatabase"; - $config['dbdriver'] = "mysql"; - $config['dbprefix'] = ""; + $config['hostname'] = 'localhost'; + $config['username'] = 'myusername'; + $config['password'] = 'mypassword'; + $config['database'] = 'mydatabase'; + $config['dbdriver'] = 'mysqli'; + $config['dbprefix'] = ''; $config['pconnect'] = FALSE; $config['db_debug'] = TRUE; - $this->load->model('Model_name', '', $config); - - + $this->load->model('Model_name', '', $config); \ No newline at end of file -- cgit v1.2.3-24-g4f1b From ac57033236d5b62ba553b6bea87623f0dbeb2f49 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 4 Jul 2012 13:04:10 +0300 Subject: Deprecate Date helper standard_date() --- user_guide_src/source/changelog.rst | 8 +++--- user_guide_src/source/helpers/date_helper.rst | 29 ++++++++++++++-------- user_guide_src/source/installation/upgrade_300.rst | 28 ++++++++++++++++++++- 3 files changed, 50 insertions(+), 15 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index efe49cfe0..37063f752 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -52,7 +52,11 @@ Release Date: Not Released - Helpers - - :doc:`Date Helper ` function now() now works with all timezone strings supported by PHP. + - :doc:`Date Helper ` changes include: + - ``now()`` now works with all timezone strings supported by PHP. + - Added an optional third parameter to ``timespan()`` that constrains the number of time units displayed. + - Added an optional parameter to ``timezone_menu()`` that allows more attributes to be added to the generated select tag. + - Deprecated ``standard_date()``, which now just uses the native ``date()`` with `DateTime constants `_. - ``create_captcha()`` accepts additional colors parameter, allowing for color customization. - :doc:`URL Helper ` changes include: - ``url_title()`` will now trim extra dashes from beginning and end. @@ -63,7 +67,6 @@ 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. - 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. - ``do_hash()`` now uses PHP's native ``hash()`` function (supporting more algorithms) and is deprecated. @@ -72,7 +75,6 @@ Release Date: Not Released - ``set_realpath()`` can now also handle file paths as opposed to just directories. - Added an optional paramater to ``delete_files()`` to enable it to skip deleting files such as .htaccess and index.html. - ``read_file()`` is now a deprecated alias of ``file_get_contents()``. - - Added an optional parameter to :doc:`Date Helper ` function ``timezone_menu()`` that allows more attributes to be added to the generated select tag. - :doc:`Security Helper ` function ``strip_image_tags()`` is now an alias for the same method in the :doc:`Security Library `. - Database diff --git a/user_guide_src/source/helpers/date_helper.rst b/user_guide_src/source/helpers/date_helper.rst index 5adfb18d2..e332a913f 100644 --- a/user_guide_src/source/helpers/date_helper.rst +++ b/user_guide_src/source/helpers/date_helper.rst @@ -40,7 +40,7 @@ If a timezone is not provided, it will return time() based on "time_reference" s mdate() ======= -This function is identical to PHPs `date() `_ +This function is identical to PHP's `date() `_ function, except that it lets you use MySQL style date codes, where each code letter is preceded with a percent sign: %Y %m %d etc. @@ -85,21 +85,28 @@ Example The first parameter must contain the format, the second parameter must contain the date as a Unix timestamp. +.. note:: This function is DEPRECATED. Use the native ``date()`` combined + with `DateTime's format constants `_ + instead: + + | + | echo date(DATE_RFC822, time()); + Supported formats: =============== ======================= ====================================== Constant Description Example =============== ======================= ====================================== -DATE_ATOM Atom 2005-08-15T16:13:03+0000 -DATE_COOKIE HTTP Cookies Sun, 14 Aug 2005 16:13:03 UTC -DATE_ISO8601 ISO-8601 2005-08-14T16:13:03+00:00 -DATE_RFC822 RFC 822 Sun, 14 Aug 05 16:13:03 UTC -DATE_RFC850 RFC 850 Sunday, 14-Aug-05 16:13:03 UTC -DATE_RFC1036 RFC 1036 Sunday, 14-Aug-05 16:13:03 UTC -DATE_RFC1123 RFC 1123 Sun, 14 Aug 2005 16:13:03 UTC -DATE_RFC2822 RFC 2822 Sun, 14 Aug 2005 16:13:03 +0000 -DATE_RSS RSS Sun, 14 Aug 2005 16:13:03 UTC -DATE_W3C W3C 2005-08-14T16:13:03+0000 +DATE_ATOM Atom 2005-08-15T16:13:03+0000 +DATE_COOKIE HTTP Cookies Sun, 14 Aug 2005 16:13:03 UTC +DATE_ISO8601 ISO-8601 2005-08-14T16:13:03+00:00 +DATE_RFC822 RFC 822 Sun, 14 Aug 05 16:13:03 UTC +DATE_RFC850 RFC 850 Sunday, 14-Aug-05 16:13:03 UTC +DATE_RFC1036 RFC 1036 Sunday, 14-Aug-05 16:13:03 UTC +DATE_RFC1123 RFC 1123 Sun, 14 Aug 2005 16:13:03 UTC +DATE_RFC2822 RFC 2822 Sun, 14 Aug 2005 16:13:03 +0000 +DATE_RSS RSS Sun, 14 Aug 2005 16:13:03 UTC +DATE_W3C W3C 2005-08-14T16:13:03+0000 =============== ======================= ====================================== local_to_gmt() diff --git a/user_guide_src/source/installation/upgrade_300.rst b/user_guide_src/source/installation/upgrade_300.rst index 7b0d8abe9..6b93750d1 100644 --- a/user_guide_src/source/installation/upgrade_300.rst +++ b/user_guide_src/source/installation/upgrade_300.rst @@ -102,6 +102,32 @@ CodeIgniter 3.1+. .. note:: This function is still available, but you're strongly encouraged to remove it's usage sooner rather than later. +Date helper standard_date() +=========================== + +:doc:`Date Helper <../helpers/date_helper>` function ``standard_date()`` is being deprecated due +to the availability of native PHP `constants `_, +which when combined with ``date()`` provide the same functionality. Furthermore, they have the +exact same names as the ones suppored by ``standard_date()``. Here are examples of how to replace +it's usage: + +:: + + // Old way + standard_date(); // defaults to stanard_date('DATE_RFC822', now()); + + // Replacement + date(DATE_RFC822, now()); + + // Old way + standard_date('DATE_ATOM', $time); + + // Replacement + date(DATE_ATOM, $time); + +.. note:: This function is still available, but you're strongly encouraged to remove its' usage sooner + rather than later as it is scheduled for removal in CodeIgniter 3.1+. + Pagination library 'anchor_class' setting ========================================= @@ -111,5 +137,5 @@ attribute to your anchors via the 'attributes' configuration setting. This inclu As a result of that, the 'anchor_class' setting is now deprecated and scheduled for removal in CodeIgniter 3.1+. -.. note:: This setting is still available, but you're strongly encouraged to remove it's usage sooner +.. note:: This setting is still available, but you're strongly encouraged to remove its' usage sooner rather than later. \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 9d21400f12bfe3a09d27afb00a22ae96fbbed1d5 Mon Sep 17 00:00:00 2001 From: vlakoff Date: Wed, 4 Jul 2012 13:03:26 +0200 Subject: Fix typos in upgrade_300.rst --- user_guide_src/source/installation/upgrade_300.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/installation/upgrade_300.rst b/user_guide_src/source/installation/upgrade_300.rst index 6b93750d1..f304a716f 100644 --- a/user_guide_src/source/installation/upgrade_300.rst +++ b/user_guide_src/source/installation/upgrade_300.rst @@ -108,13 +108,13 @@ Date helper standard_date() :doc:`Date Helper <../helpers/date_helper>` function ``standard_date()`` is being deprecated due to the availability of native PHP `constants `_, which when combined with ``date()`` provide the same functionality. Furthermore, they have the -exact same names as the ones suppored by ``standard_date()``. Here are examples of how to replace +exact same names as the ones supported by ``standard_date()``. Here are examples of how to replace it's usage: :: // Old way - standard_date(); // defaults to stanard_date('DATE_RFC822', now()); + standard_date(); // defaults to standard_date('DATE_RFC822', now()); // Replacement date(DATE_RFC822, now()); -- cgit v1.2.3-24-g4f1b From 0054750cf2e071cbe6903dba59e43a6bb8e639d1 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 4 Jul 2012 06:51:15 -0700 Subject: Fixing upgrade file references --- user_guide_src/source/installation/upgrade_210.rst | 14 +++++--------- user_guide_src/source/installation/upgrade_211.rst | 18 ++++++++++++++++++ user_guide_src/source/installation/upgrade_212.rst | 18 ++++++++++++++++++ user_guide_src/source/installation/upgrading.rst | 4 +++- 4 files changed, 44 insertions(+), 10 deletions(-) create mode 100644 user_guide_src/source/installation/upgrade_211.rst create mode 100644 user_guide_src/source/installation/upgrade_212.rst (limited to 'user_guide_src') diff --git a/user_guide_src/source/installation/upgrade_210.rst b/user_guide_src/source/installation/upgrade_210.rst index 9d7e1a265..1625c64bd 100644 --- a/user_guide_src/source/installation/upgrade_210.rst +++ b/user_guide_src/source/installation/upgrade_210.rst @@ -8,15 +8,11 @@ replacing the index.php file with a static one. Step 1: Update your CodeIgniter files ===================================== -Replace all files and directories in your "system" folder and replace -your index.php file. If any modifications were made to your index.php -they will need to be made fresh in this new one. +Replace all files and directories in your "system" folder. -Step 2: Replace config/user_agents.php -====================================== +Step 2: Update your user guide +============================== -This config file has been updated to contain more user agent types, -please copy it to application/config/user_agents.php. +Please also replace your local copy of the user guide with the new +version. -.. note:: If you have any custom developed files in these folders please - make copies of them first. \ No newline at end of file diff --git a/user_guide_src/source/installation/upgrade_211.rst b/user_guide_src/source/installation/upgrade_211.rst new file mode 100644 index 000000000..882a520c5 --- /dev/null +++ b/user_guide_src/source/installation/upgrade_211.rst @@ -0,0 +1,18 @@ +############################# +Upgrading from 2.1.0 to 2.1.1 +############################# + +Before performing an update you should take your site offline by +replacing the index.php file with a static one. + +Step 1: Update your CodeIgniter files +===================================== + +Replace all files and directories in your "system" folder. + +Step 2: Update your user guide +============================== + +Please also replace your local copy of the user guide with the new +version. + diff --git a/user_guide_src/source/installation/upgrade_212.rst b/user_guide_src/source/installation/upgrade_212.rst new file mode 100644 index 000000000..fa0fb8073 --- /dev/null +++ b/user_guide_src/source/installation/upgrade_212.rst @@ -0,0 +1,18 @@ +############################# +Upgrading from 2.1.1 to 2.1.2 +############################# + +Before performing an update you should take your site offline by +replacing the index.php file with a static one. + +Step 1: Update your CodeIgniter files +===================================== + +Replace all files and directories in your "system" folder. + +Step 2: Update your user guide +============================== + +Please also replace your local copy of the user guide with the new +version. + diff --git a/user_guide_src/source/installation/upgrading.rst b/user_guide_src/source/installation/upgrading.rst index 255c6a557..545f344ee 100644 --- a/user_guide_src/source/installation/upgrading.rst +++ b/user_guide_src/source/installation/upgrading.rst @@ -5,8 +5,10 @@ Upgrading From a Previous Version Please read the upgrade notes corresponding to the version you are upgrading from. -- :doc:`Upgrading from 2.1.1 to 3.0.0 ` +- :doc:`Upgrading from 2.1.2 to 3.0.0 ` +- :doc:`Upgrading from 2.1.1 to 2.1.2 ` - :doc:`Upgrading from 2.1.0 to 2.1.1 ` +- :doc:`Upgrading from 2.0.3 to 2.1.0 ` - :doc:`Upgrading from 2.0.2 to 2.0.3 ` - :doc:`Upgrading from 2.0.1 to 2.0.2 ` - :doc:`Upgrading from 2.0 to 2.0.1 ` -- cgit v1.2.3-24-g4f1b From a78c6e0cf48b090f9e5ac5f303efe361c10a1881 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 4 Jul 2012 06:52:19 -0700 Subject: Fix URL helper link --- user_guide_src/source/libraries/config.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/libraries/config.rst b/user_guide_src/source/libraries/config.rst index 694896353..08d9c2905 100644 --- a/user_guide_src/source/libraries/config.rst +++ b/user_guide_src/source/libraries/config.rst @@ -175,7 +175,7 @@ This function retrieves the URL to your site, plus an optional path such as to a stylesheet or image. The two functions above are normally accessed via the corresponding -functions in the :doc:`URL Helper `. +functions in the :doc:`URL Helper `. $this->config->system_url(); ***************************** -- cgit v1.2.3-24-g4f1b From be3177f7614c96ad3137ddb9764d5e1188c6f9bc Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 4 Jul 2012 07:02:55 -0700 Subject: Fixed a change log formatting issue and doc reference --- user_guide_src/source/changelog.rst | 3 ++- 1 file changed, 2 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 d8b935252..a2788ca77 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -136,6 +136,7 @@ Release Date: Not Released - Added unbuffered_row() method for getting a row without prefetching whole result (consume less memory). - Libraries + - CI_Session now respects php.ini's session.gc_probability and session.gc_divisor - Added max_filename_increment config setting for Upload library. - CI_Loader::_ci_autoloader() is now a protected method. @@ -175,7 +176,7 @@ Release Date: Not Released - Added support for setting custom attributes. - Deprecated usage of the "anchor_class" setting (use the new "attributes" setting instead). - Added $config['reuse_query_string'] to allow automatic repopulation of query string arguments, combined with normal URI segments. - - Added the ability to use a proxy with the :doc:`XML-RPC Library `. + - Added the ability to use a proxy with the :doc:`XML-RPC Library `. - Core -- cgit v1.2.3-24-g4f1b From 1a85653e093d0f9b4028d808b57747cdbff17a65 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Wed, 4 Jul 2012 07:06:08 -0700 Subject: added general/welcome to the toctree --- user_guide_src/source/index.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'user_guide_src') diff --git a/user_guide_src/source/index.rst b/user_guide_src/source/index.rst index a349d8bce..e42425bab 100644 --- a/user_guide_src/source/index.rst +++ b/user_guide_src/source/index.rst @@ -110,6 +110,7 @@ Contributing to CodeIgniter * overview/index general/requirements + general/welcome installation/index general/index libraries/index -- cgit v1.2.3-24-g4f1b From 626f1a657206a8b33a59c20388d0ec4de4593487 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 4 Jul 2012 22:38:52 +0300 Subject: Add PDO support for list_fields() Signed-off-by: Andrey Andreev --- 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 f69ce5c15..e5c46ff93 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -136,6 +136,7 @@ Release Date: Not Released - Added ODBC support for create_database(), drop_database() and drop_table() in :doc:`Database Forge `. - Added PDO support for create_database(), drop_database and drop_table() in :doc:`Database Forge `. - Added unbuffered_row() method for getting a row without prefetching whole result (consume less memory). + - Added PDO support for ``list_fields()`` in :doc:`Database Results `. - Libraries -- cgit v1.2.3-24-g4f1b From f5a8530cc937d193aa928bc25f2970eae772d6ef Mon Sep 17 00:00:00 2001 From: Rene Brokholm Date: Thu, 5 Jul 2012 09:05:32 +0200 Subject: code cleanup and changelog added --- 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 e5c46ff93..9a7cec320 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -137,6 +137,7 @@ Release Date: Not Released - Added PDO support for create_database(), drop_database and drop_table() in :doc:`Database Forge `. - Added unbuffered_row() method for getting a row without prefetching whole result (consume less memory). - Added PDO support for ``list_fields()`` in :doc:`Database Results `. + - Added capability for packages to hold database.php config files - Libraries -- cgit v1.2.3-24-g4f1b From 26086874ebb5425a38e879018f9a654182f93b40 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 5 Jul 2012 11:21:58 +0300 Subject: Rename the 'interbase' DB driver to 'ibase' in order to match PHP's function prefix --- user_guide_src/source/changelog.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 9a7cec320..bfbb1bf18 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -95,7 +95,7 @@ Release Date: Not Released - Added support for backup() in :doc:`Database Utilities `. - Added 'dsn' configuration setting for drivers that support DSN strings (PDO, PostgreSQL, Oracle, ODBC, CUBRID). - Improved PDO database support. - - Added Interbase/Firebird database support via the "interbase" driver. + - Added Interbase/Firebird database support via the 'ibase' driver. - Added an optional database name parameter to db_select(). - Replaced the _error_message() and _error_number() methods with error(), that returns an array containing the last database error code and message. - Improved version() implementation so that drivers that have a native function to get the version number don't have to be defined in the core DB_driver class. -- cgit v1.2.3-24-g4f1b From c7db6bb9b64c8322af4d727bcb71122cd7f09dbf Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 5 Jul 2012 15:11:20 +0300 Subject: Clean-up the separate drivers' DB result classes from no longer needed methods --- user_guide_src/source/changelog.rst | 1 - 1 file changed, 1 deletion(-) (limited to 'user_guide_src') diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index bfbb1bf18..716e08f63 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -128,7 +128,6 @@ Release Date: Not Released - Added support for drop_table() in :doc:`Database Forge `. - Added support for list_databases() in :doc:`Database Utilities `. - Generally improved for speed and cleaned up all of its components. - - *Row* result methods now really only fetch only the needed number of rows, instead of depending entirely on result(). - num_rows() is now only called explicitly by the developer and no longer re-executes statements. - Improved support of the SQLite driver, including: - Added support for replace() in :doc:`Query Builder `. -- cgit v1.2.3-24-g4f1b